Bug 1741076
| Summary: | /usr/share/doc/json-c is present in registry.access.redhat.com/ubi8-minimal | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Jan Pazdziora (Red Hat) <jpazdziora> | |
| Component: | json-c | Assignee: | Joe Orton <jorton> | |
| Status: | CLOSED ERRATA | QA Contact: | Ondrej Mejzlik <omejzlik> | |
| Severity: | low | Docs Contact: | ||
| Priority: | low | |||
| Version: | 8.0 | CC: | omejzlik, pemensik, pmatilai, psklenar | |
| Target Milestone: | rc | Keywords: | AutoVerified, EasyFix, TestCaseProvided, Triaged | |
| Target Release: | 8.0 | Flags: | pm-rhel:
mirror+
|
|
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | Doc Type: | If docs needed, set a value | ||
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 1777815 (view as bug list) | Environment: | ||
| Last Closed: | 2021-05-18 14:47:00 UTC | Type: | Bug | |
| 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: | ||||
| Bug Blocks: | 1777815 | |||
I've also filed bug 1741074 for xz. Oh, the empty directory is not useful. But there should be way to mark empty directory as %doc, but it does not seem to work. # rpm -qVv json-c ......... a /usr/lib/.build-id ......... a /usr/lib/.build-id/18 ......... a /usr/lib/.build-id/18/f2939d6e6ffc72ca6dde301523e18d7ce4b209 ......... /usr/lib64/libjson-c.so.4 ......... /usr/lib64/libjson-c.so.4.0.0 ......... /usr/share/doc/json-c ......... /usr/share/licenses/json-c ......... l /usr/share/licenses/json-c/AUTHORS ......... l /usr/share/licenses/json-c/COPYING Note both doc and license directories are not marked with correct letter. I think this is RPM bug. But doc directory could be removed from json-c package. A directory is never a piece of documentation or a license, it's a directory. This is an interesting quirk though: normally --nodocs causes the package doc directory to be skipped because rpm has special logic to skip directory creation if policies such as --nodocs would cause the directory to be empty. That logic doesn't trigger here because the directory is empty to begin with! The question is, why are you specifically packaging an empty directory in /usr/share/doc/? Empty directory is not required in main package and was already removed in Fedora. It is required just in devel subpackage, where it includes few files from doc, but not all of them. Would it work for devel, when that directory would not be empty? I think that change was made long ago, in commit [1]. json-c originally served as common base for doc and devel packages and subpackages did not own the directory. When that changed, main package did not stop owning it for no reason. It seems when --nodocs is used with json-c-devel, it indeed marks (not installed) both files and its directory. The same with doc. ......... /usr/lib64/pkgconfig/json-c.pc ......... /usr/share/doc/json-c (not installed) ......... d /usr/share/doc/json-c/ChangeLog (not installed) ......... d /usr/share/doc/json-c/README (not installed) ......... d /usr/share/doc/json-c/README.html (not installed) ......... d /usr/share/doc/json-c/README.md (not installed) Ok, directories not possible to list as doc or license seems strange to me. But it has known design (with a weak spot). I think it should be fixed. Would fix the json-c anyway. 1. https://src.fedoraproject.org/rpms/json-c/c/301e4e679aef067f5522dbcbf6a03a1830c26416 Documentation or a license is something you can read, a directory is a container and can contain files of arbitrary types, including but not limited to those two types of documents. There's no way to "fix" this behavior in rpm because packaging empty directories must be supported (hello "filesystem" package). Giving up this bz, let new maintainers handle it. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (json-c bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2021:1601 |
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.