Bug 119691 - list query gives different files from filesbypkg
Summary: list query gives different files from filesbypkg
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm
Version: 9
Hardware: i686
OS: Linux
medium
low
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact: Mike McLean
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-04-01 15:27 UTC by Jón Fairbairn
Modified: 2007-04-18 17:05 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2004-04-07 16:56:47 UTC
Embargoed:


Attachments (Terms of Use)

Description Jón Fairbairn 2004-04-01 15:27:19 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.2)
Gecko/20040308

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

 produces no output

 whereas 

rpm --query --filesbypkg initscripts | grep utmp

 outputs

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):
rpm-4.2-0.69

How reproducible:
Always

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 16:56:47 UTC
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 18:34:56 UTC
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.