Bug 717534

Summary: extraneous blanks in rpm -q --requires output
Product: [Fedora] Fedora Reporter: Ralf Corsepius <rc040203>
Component: rpmAssignee: Panu Matilainen <pmatilai>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 14CC: ffesti, jnovy, pmatilai
Target Milestone: ---Keywords: Upstream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-03-31 06:54:09 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ralf Corsepius 2011-06-29 07:09:34 UTC
Description of problem:
The output generated by "rpm -q --requires ..."
contains extraneous whitespaces.


Version-Release number of selected component (if applicable):
rpm-4.8.1-5.fc14.x86_64

How reproducible:
Always

Steps to Reproduce:
1. run 
rpm -q --requires <someinstalledpackage> > requires.txt
or
rpm -q --requires -o <somerpm> > requires.txt

2. check requires.txt
  
Actual results:
Several lines in requires.txt, contain 2 extra whitespaces (Hex 0x20) at the end of line, e.g.
libc.so.6(GLIBC_2.0)  \n

Expected results:
No extra whitespaces.

Additional info:
AFAIC gather, all lines without "version equations" carry these blanks, so I'd guess these are the delimiters of rpm's "version equations".

I am not sure, if this behavior is intentional.

Comment 1 Panu Matilainen 2011-07-12 13:05:11 UTC
Not exactly intentional, but a side-effect of how --requires and friends are implemented with popt aliases, where there's not a whole lot of control over formatting details.

The simple version of requires is just a query format defined as:
"[%{REQUIRENAME} %{REQUIREFLAGS:depflags} %{REQUIREVERSION}\n]"
While the query formats do support conditionals, the conditionals can only be used on tag existence which doesn't help for this case as REQUIREFLAGS and REQUIREVERSION tags always exist. So while it might be possible to enhance the conditional support in queryformat "language" to allow fixing this, this isn't as easy fix as it might seem on the outset.

Comment 2 Panu Matilainen 2011-10-12 07:58:17 UTC
FWIW this has been fixed upstream some time ago, but backport to rpm 4.8.x of F14 is unlikely to happen at this point.

Comment 3 Panu Matilainen 2012-03-31 06:54:09 UTC
F14 is EOL by now, but this is fixed in rpm >= 4.9.90 / rawhide.