Bug 119691 - list query gives different files from filesbypkg
list query gives different files from filesbypkg
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
i686 Linux
medium Severity low
: ---
: ---
Assigned To: Jeff Johnson
Mike McLean
Depends On:
  Show dependency treegraph
Reported: 2004-04-01 10:27 EST by Jón Fairbairn
Modified: 2007-04-18 13:05 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-04-07 12:56:47 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jón Fairbairn 2004-04-01 10:27:19 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.2)

Description of problem:
rpm --query --list initscripts | grep utmp 

 produces no output


rpm --query --filesbypkg initscripts | grep utmp


initscripts               /var/run/utmp

I don't know whether this is a bug in rpm or in the man page -- the
man page does say that filesbypkg will "List all the files in each
selected package" whereas the description for --list just says "List
files in package", but I hardly think the absence of "all" in the
second makes the distinction clear.

I na�vely assumed that rpm -qla would list all rpm controlled files,
and it seems to me that this is a not unreasonable expectation given
the documentation; if it isn't meant to, some short description of the
intended behaviour would help. I know I can get it with 

rpm -qa --filesbypkg | sed ...burble...

so it's not exactly mission critical!

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

How reproducible:

Steps to Reproduce:
1. rpm -ql initscripts | grep utmp
2. rpm -q --filesbypkg initscripts | grep utmp

Actual Results:  initscripts               /var/run/utmp

Expected Results:  /var/run/utmp
initscripts               /var/run/utmp

Additional info:

I've tried this on several differnt RH9 systems with the same result
in each case.

I'm not sure that "sed" could ever really be described as "easy", but
I'll rate this as "low" since the workaround isn't /hard/...
Comment 1 Jeff Johnson 2004-04-07 12:56:47 EDT
The difference is in whether %ghost is displayed or not.

One can argue that %ghost is part of the package or not,
there are valid points on both sides. Without a clear
call that %ghost files are "in" a package or not, then
it is impossible to determine whether the files should
be filtered on output or not.
Comment 2 Jón Fairbairn 2004-04-07 14:34:56 EDT
Personally it seems to me that "all" should mean "all" -- everything 
that conceivably should be incuded, but failing that there are at
least two possible ways of fixing this:

1 change the manpage so that it says what the distinction between
files listed by --list and --filesbypkg actually is

2 add an argument --including-ghost-files (or --excluding-ghost-files)
and change the behaviour of both accordingly.

I'd submit a patch for (1) if I knew where to find the docbook source
of the manpage.

For anyone else who reads this bug, it seems to be possible to get the
information I wanted with:

rpm -q --queryformat='[%{FILENAMES}\n]' --all

but I can't see from the man page why this should include %ghost files
when rpm -qla does not, so how can I rely on it continuing to do so?

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