Bug 717534 - extraneous blanks in rpm -q --requires output
Summary: extraneous blanks in rpm -q --requires output
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 14
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: 2011-06-29 07:09 UTC by Ralf Corsepius
Modified: 2012-03-31 06:54 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-03-31 06:54:09 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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.


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