Bug 1777815

Summary: empty /usr/share/doc/json-c is present in json-c package
Product: [Fedora] Fedora Reporter: Petr Menšík <pemensik>
Component: json-cAssignee: Björn 'besser82' Esser <besser82>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 30CC: besser82, igor.raits, jiri
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: json-c-0.13.1-8.fc31 json-c-0.13.1-8.fc30 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1741076 Environment:
Last Closed: 2019-12-03 01:10:31 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1741076    
Bug Blocks:    

Description Petr Menšík 2019-11-28 11:37:34 UTC
+++ This bug was initially created as a clone of Bug #1741076 +++

Description of problem:

Container images are typically created with tsflags=nodocs (or its equivalent). However, /usr/share/doc/json-c directory is still present in registry.access.redhat.com/ubi8-minimal image (and registry.access.redhat.com/ubi8).

Version-Release number of selected component (if applicable):

json-c-0.13.1-0.2.el8.x86_64

How reproducible:

Deterministic.

Steps to Reproduce:
1. docker run --rm registry.access.redhat.com/ubi8-minimal ls -la /usr/share/doc/json-c

Actual results:

total 8
drwxr-xr-x. 2 root root 4096 Aug 12  2018 .
drwxr-xr-x. 4 root root 4096 Jul 23 16:18 ..

Expected results:

ls: cannot access '/usr/share/doc/json-c': No such file or directory

Additional info:

The directory /usr/share/doc on the container image is empty apart from the json-c directory and apart from the xz/COPYING file

$ docker run --rm registry.access.redhat.com/ubi8-minimal ls -la /usr/share/doc
total 16
drwxr-xr-x.  4 root root 4096 Jul 23 16:18 .
drwxr-xr-x. 45 root root 4096 Jul 23 16:18 ..
drwxr-xr-x.  2 root root 4096 Aug 12  2018 json-c
drwxr-xr-x.  2 root root 4096 Jul 23 16:17 xz

That makes me think that shipping docs (including the directories) is not expected in these base images and thus json-c could follow suit.

It seems that the difference in behaviour comes from json-c defining

%doc %dir %{_pkgdocdir}

in the .spec file, while other packages use %doc with relative paths to files and let rpm do its work.

--- Additional comment from Jan Pazdziora on 2019-08-14 10:19:14 CEST ---

I've also filed bug 1741074 for xz.

Comment 1 Petr Menšík 2019-11-28 11:42:40 UTC
Also, empty dir is not flagged as %doc, according to output of command:

$ rpm -qlVv json-c json-c-devel
.........    /usr/include/json-c/json.h

.........    /usr/share/doc/json-c
.........  d /usr/share/doc/json-c/ChangeLog
.........  d /usr/share/doc/json-c/README
.........  d /usr/share/doc/json-c/README.html
.........  d /usr/share/doc/json-c/README.md

Note doc files are flagged correctly.
Anyway, since devel and doc subpackages own the directory, there is point for json-c to contain it.

https://src.fedoraproject.org/rpms/json-c/pull-request/2

Comment 2 Fedora Update System 2019-11-29 12:12:06 UTC
FEDORA-2019-0cc173e5af has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2019-0cc173e5af

Comment 3 Fedora Update System 2019-11-30 01:15:04 UTC
json-c-0.13.1-8.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-5508b7e36d

Comment 4 Fedora Update System 2019-11-30 01:19:57 UTC
json-c-0.13.1-8.fc31 has been pushed to the Fedora 31 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-0cc173e5af

Comment 5 Fedora Update System 2019-12-03 01:10:31 UTC
json-c-0.13.1-8.fc31 has been pushed to the Fedora 31 stable repository. If problems still persist, please make note of it in this bug report.

Comment 6 Fedora Update System 2019-12-15 09:00:06 UTC
json-c-0.13.1-8.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.