Packaging guidelines, section File and directory ownership says that directories owned by packages in the "natural dependency chain" can be used and do not have to be explicitly owned. Sometimes the chain is automatically generated, rather than explictly listed in specfile Requires. fedora-review is unable to process this case and wrongly complains about unowned directories.
fedora-review
In particular, any Ruby gem specfile created with gem2rpm will get the following complaint from fedora-review:
gem2rpm
[ ]: Package must own all directories that it creates. Note: Directories without known owners: /usr/share/gems, /usr/share/gems/doc
which is wrong, because the package has an automatically created Requires: ruby(rubygems), satisfied by package rubygems which owns the listed directories.
Requires: ruby(rubygems)
rubygems
I'm pretty sure it's supposed to check the resulting install tree. Is it not doing that?
Ah, you are right, I checked. So the initial descrption of this bug is incorrect. A fresh start:
The bug: Packages created by gem2rpm get incorrect nag about "Note: Directories without known owners: /usr/share/gems, /usr/share/gems/doc", when actually rubygems is in the dependency tree and owns those directories.
Example files: <img alt="rubygem-sync-0.5.0-1.fc34.src.rpm" src="/FedoraReview/issue/raw/files/a67408463eadc4a5ba04111a4fa23d970c91806969b6748186d4d3397090bc90-rubygem-sync-0.5.0-1.fc34.src.rpm" /> <img alt="rubygem-sync.spec" src="/FedoraReview/issue/raw/files/e18c569cd82613f59a08b4e9802466893998a9eca4c9302ec37fbd45947b4ef1-rubygem-sync.spec" />
To reproduce: 1. Download the linked example rubygem-sync specfile and srpm 2. Run fedora-review -n rubygem-syncin that directory 3. In review-rubygem-sync/review.txt, check the result of Package must own all directories that it creates. 4. At the end of the same file, observe Requires for rubygem-sync
fedora-review -n rubygem-sync
review-rubygem-sync/review.txt
rubygem-sync
Observed behavior: 1. Complaint about unowned directories /usr/share/gems and /usr/share/gems/doc are logged 4. But Requires: ruby(rubygems) is present
/usr/share/gems
/usr/share/gems/doc
Expected behavior: 1. No complaints about unowned directories, because 2. Requires: ruby(rubygems) is present
Reason: The complaint is actually forrubygem-<name>-doc package. It has a transitive Require for rubygems through rubygem-<name>. Fedora-review fails to process this: It knows how to process transitive dependencies here, but that fails when the immediate dependency is another subpackage in the same specfile.
rubygem-<name>-doc
rubygem-<name>
Relevant code starts here: plugins/generic.py line 1102
Fixed by #419
Login to comment on this ticket.