Bug 1358861 - rpm -qla shows "(contains no files)"
Summary: rpm -qla shows "(contains no files)"
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Panu Matilainen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-21 15:53 UTC by Igor Gnatenko
Modified: 2019-12-02 14:31 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2019-12-02 14:31:34 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github rpm-software-management rpm issues 962 0 'None' 'open' 'Rpm spits informative garbage to stdout instead of stderr' 2019-12-02 14:31:34 UTC

Description Igor Gnatenko 2016-07-21 15:53:38 UTC
$ rpm -qla | grep "(contains no files)" | wc -l
25

it's quite useless.

rpm-4.13.0-0.rc1.40.fc25.x86_64

Comment 1 Ľuboš Kardoš 2016-07-22 08:26:11 UTC
Yes, in this particular case it may be useless. But it can be useful when somebody call "rpm -ql somepackage" and we want to have behaviour of queries consistent. And this always behaved like this so if we changed this, we could break some existing scripts or other tools which use rpm and I think that isn't worth it. 

Btw what are you trying to count? Don't forget that output of "rpm -qla" contains ghost files, duplicate files (if two packages contain the same file), ...

Comment 2 Igor Gnatenko 2016-08-05 06:27:45 UTC
(In reply to Ľuboš Kardoš from comment #1)
> Yes, in this particular case it may be useless. But it can be useful when
> somebody call "rpm -ql somepackage" and we want to have behaviour of queries
> consistent. And this always behaved like this so if we changed this, we
> could break some existing scripts or other tools which use rpm and I think
> that isn't worth it. 
I agree that if we query files for one package - it should be there, but not when > 1 packages.
> 
> Btw what are you trying to count? Don't forget that output of "rpm -qla"
> contains ghost files, duplicate files (if two packages contain the same
> file), ...
I didn't remember exactly, but it was too confusing.

Comment 3 Panu Matilainen 2016-10-12 15:07:38 UTC
Yup, there's an ancient upstream ticket on the topic: http://rpm.org/ticket/31. Spewing redundant information is not unixy at all, 'rpm -ql foo' should really produce zero output on an empty package unless in verbose/debug mode.

Ignoring the issue of potential script breakage, a relatively simple solution would be to change all rpmlog() output to go to stderr instead of stdin/stderr based on level like it now does, and probably adjust a bunch of log levels to silence it in default mode. There are some places like query code which uses rpmlog() for generating "user output", those would need to be changed to fprintf() instead (or add some special log level for that purpose).

Comment 4 Panu Matilainen 2016-10-13 06:54:05 UTC
RFC patch posted on rpm-maint:
http://lists.rpm.org/pipermail/rpm-maint/2016-October/004594.html

Comment 5 Panu Matilainen 2019-12-02 14:31:34 UTC
I don't see this getting worked on anytime soon, moving to upstream tracking. Once again.


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