RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1196724 - [RFE] please add a file with the content equivalent to "rpm -ql filesystem"
Summary: [RFE] please add a file with the content equivalent to "rpm -ql filesystem"
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: filesystem
Version: 7.2
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: rc
: ---
Assignee: Ondrej Vasik
QA Contact: Alois Mahdal
URL:
Whiteboard:
Depends On:
Blocks: 1295396 1305230 1465906
TreeView+ depends on / blocked
 
Reported: 2015-02-26 15:33 UTC by Jan Pokorný [poki]
Modified: 2018-04-10 15:03 UTC (History)
6 users (show)

Fixed In Version: filesystem-3.2-25.el7
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-10 15:02:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2018:0838 0 None None None 2018-04-10 15:03:10 UTC

Description Jan Pokorný [poki] 2015-02-26 15:33:18 UTC
Use-case:
Detect if particular item in particular path still belongs to filesystem
package or already to the "leaf" package.  This detection is handy if one
doesn't want to hardcode particular path in the specfile
(e.g., using "pkg-config --variable=completionsdir bash-completion"
instead of hardcoding /usr/share/bash-completion/completions) but wants
to own such path up to the boundary with filesystem-backed hierarchy,
as per packaging guidelines).

Note that using "rpm -qf -- $DIR" for such purpose of dynamic directory
ownership within the specfile is not recommended, hence the next sane
detection recipe would be grepping the requested file that filesystem
package should provide (exactly for such "cannot use rpm -q[fl]"
purposes).

Example file location: /usr/share/filesystem/paths.

Please not that filesystem package is somewhat special, where it would
really make sense to have "rpm -qf" precached in the proposed way, no
extension to the scope is considered.

Comment 2 Ondrej Vasik 2015-02-27 12:55:01 UTC
I don't think this is something for RHEL 7. Directory ownership doesn't change too much within the major versions and it is very unlikely I'll drop some directory ownership from filesystem package in the RHEL 7 lifetime. Adding the ownership is much less dangerous, because at the worst case, there will be duplicate ownership (which already happens in many cases).
In addition, I'm not very keen of having this file ... at this moment, rpm -ql filesystem on RHEL 7 shows 14k5 lines and more than 300kbytes - and I don't see that value in that.

Comment 3 Jan Pokorný [poki] 2015-02-27 12:58:59 UTC
> I don't see that value in that

Scenario making such file valuable was provided: one should not call
rpm -ql in the rpmbuild recipe.

Comment 4 Ondrej Vasik 2015-02-27 13:16:51 UTC
Yes, in Fedora, it may make sense - still better than calling rpm in %post - however within the RHEL 7, "Detect if particular item in particular path still belongs to filesystem
package or already to the "leaf" package." is not relevant... as I'm not going to remove any ownerships from the filesystem package there - more likely I'll add few more in RHEL 7 timeframe.
Do I understand correctly that the primary usecase is to have the same spec files in Fedora and RHEL 7 and just having the conditions checking for the ownership?

Comment 7 Jan Pokorný [poki] 2016-07-07 13:42:29 UTC
re [comment 4]:
> Do I understand correctly that the primary usecase is to have the same
> spec files in Fedora and RHEL 7 and just having the conditions checking
> for the ownership?

Yes, that would work well for my use case.  There can be more,
especially if there's a goal for packages not to own directories,
already owned by filesystem, superfluously.


re [comment 6]:
> however, as the ownership in RHEL doesn't change that frequently, I
> don't see many reasons to have such file by default on all systems.

Ownership may not change frequently, however there's no guarantee
pkg-config response will not change because of the changes brought
with some other package (and mind this is also part of my use case).


Simply put, I want to put some flexibility into the package I maintain
and resolving this bug would enable that.  Few extraneous bytes shipped
can hardly be seen as an obstacle (just implementing distro-wide license
files deduplication will spare much much more).


Regarding implementation, there's a possibility to use "%files -f $FILE"
in the spec so as to ensure that $FILE indeed lists everything, and
then either ship also pristine $FILE, or drop any spec-specific
annotations (%dir, %attr, ...) first (preferable).

Comment 14 Alois Mahdal 2017-10-10 19:17:23 UTC
+1 to Kamil's suggestion.

Ondro, do you think it's worth changing?

(From QE POV yes; we would not lose anything by respin at this point.  Also writing test would be a bit easier.)

Comment 15 Ondrej Vasik 2017-10-12 13:16:18 UTC
Ok, I'll do a respin... makes sense... thanks for suggestions, Kamil...

Comment 17 Alois Mahdal 2017-12-01 02:12:00 UTC
Sory, the lists are not the same:

    --- by_rpmdb	2017-11-30 21:02:21.373816722 -0500
    +++ by_file	2017-11-30 21:02:21.433816722 -0500
    @@ -1,5 +1,3 @@
    -/
    -/bin
     /boot
     /dev
     /etc
    @@ -19,15 +17,12 @@
     /etc/xdg/autostart
     /etc/xinetd.d
     /home
    -/lib
    -/lib64
     /media
     /mnt
     /opt
     /proc
     /root
     /run
    -/sbin
     /srv
     /sys
     /tmp
    @@ -38,17 +33,10 @@
     /usr/include
     /usr/lib
     /usr/lib/debug
    -/usr/lib/debug/bin
    -/usr/lib/debug/lib
    -/usr/lib/debug/lib64
    -/usr/lib/debug/sbin
     /usr/lib/debug/usr
    -/usr/lib/debug/usr/.dwz
    -/usr/lib/debug/usr/bin
    -/usr/lib/debug/usr/lib
    -/usr/lib/debug/usr/lib64
    -/usr/lib/debug/usr/sbin
     /usr/lib/games
    +/usr/lib/locale
    +/usr/lib/modules
     /usr/lib/sse2
     /usr/lib64
     /usr/lib64/X11
    @@ -105,6 +93,7 @@
     /usr/share/dict
     /usr/share/doc
     /usr/share/empty
    +/usr/share/filesystem
     /usr/share/games
     /usr/share/ghostscript
     /usr/share/ghostscript/conf.d
    @@ -14547,7 +14536,6 @@
     /usr/src
     /usr/src/debug
     /usr/src/kernels
    -/usr/tmp
     /var
     /var/adm
     /var/cache
    @@ -14560,13 +14548,10 @@
     /var/lib/misc
     /var/lib/rpm-state
     /var/local
    -/var/lock
     /var/log
    -/var/mail
     /var/nis
     /var/opt
     /var/preserve
    -/var/run
     /var/spool
     /var/spool/lpd
     /var/spool/mail

Just catching few cases:

 *  Some differences can be attributed to the fact that they are symlinks,
    but spec file explicitly asks for directories.  Anyway, is this intended?

 *  Also, there are files like /usr/lib/locale, which exist during build time
    but don't end up being owned by *any* package.  Should they be?

 *  Then there's /,

 *  and /usr/share/filesystem: this is rightly owned by the new
    filesystem-content package: so should it be included?  (Before you say
    'yes', won't it break the universe?)

Comment 18 Alois Mahdal 2017-12-01 03:11:18 UTC
By the way, this is the list of symlinks in filesystem package (unchanged since last relase):

    /bin
    /lib
    /lib64
    /sbin
    /usr/lib/debug/bin
    /usr/lib/debug/lib
    /usr/lib/debug/lib64
    /usr/lib/debug/sbin
    /usr/lib/debug/usr/.dwz
    /usr/tmp
    /var/lock
    /var/mail
    /var/run

Comment 19 Ondrej Vasik 2017-12-03 12:13:35 UTC
Thanks for the comments, Alois.
I think / and /usr/share/filesystem should definitely be excluded.
As for the symlinks created by post scriptlets included... that's good question - symlinks are not dirs and find command searches for dirs - however, it makes sense to look for the symlinks too. I'll fix the find command to include them.

unowned /usr/lib/locale is imho bug, and same with /usr/lib/modules ... not new, though... but I can fix the ownership in the respin.

Comment 20 Alois Mahdal 2017-12-04 15:35:46 UTC
Nice.  Just a nitpick, why / should not be included?  It does belong to `filesystem` (checked on Fedora 26).

Comment 21 Ondrej Vasik 2017-12-05 06:03:44 UTC
Ah, sorry, you are right, sorry for confusion, / should be included :) . I shouldn't write quick comments on Sundays :).

Comment 23 Alois Mahdal 2018-01-29 13:49:51 UTC
Verified by re-running new test.  Looks fine.

Comment 26 errata-xmlrpc 2018-04-10 15:02:56 UTC
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, 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/RHEA-2018:0838


Note You need to log in before you can comment on or make changes to this bug.