Bug 986740 - yum list is not pipeline-friendly
yum list is not pipeline-friendly
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: yum (Show other bugs)
6.6
All Linux
unspecified Severity low
: rc
: ---
Assigned To: packaging-team-maint
BaseOS QE Security Team
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-21 21:55 EDT by Paul Reiber
Modified: 2014-01-21 01:26 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-07-22 02:44:28 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Paul Reiber 2013-07-21 21:55:33 EDT
Description of problem:

The output of 'yum list' is not pipeline-friendly.

For example, depending on what is installed and how long the package names are, one may need to "unwrap" lines like this, to get a list of installed packages from either epel or ius:

yum list installed|awk '$3 == "@epel" ||  $3 == "@ius" {print} NF == 1 {line=$0}  $2 == "@epel" || $2 == "@ius" {print line,$0}'

The above line-joining becomes necessary because some of output is formatted like this:

package-name-on-one-line
                       version-number-and   @reponame

instead of this:

package-name-on-same-line-as  version-number-and   @reponame

How reproducible:

run "yum list installed"

Steps to Reproduce:
1.  Install packages with long packagenames
2.  run "yum list installed"
3.  Note how yum wraps the information about a package onto the next line

Actual results:

package-name-on-one-line
                       version-number-and   @reponame

Expected results:

package-name-on-same-line-as  version-number-and   @reponame

Additional info:

Someone had to actually add code to get the output to wrap onto a second line, so this should be easy enough to find and remove.  It is much more important that the program be pipeline-friendly than to have it look pretty on screen.
Comment 1 Jan Zeleny 2013-07-22 02:44:28 EDT
I'm sorry to say that this RFE is not that important and thus we have no intention to implement it in RHEL6 timeframe. Also it's worth mentioning that we don't really plan for many new features to go to yum at all. Instead we want to focus on development of dnf.

However if you have a patch implementing the requested behavior, feel free to send it to us for inclusion.
Comment 2 Zdeněk Pavlas 2013-07-22 04:32:01 EDT
Use repoquery instead of "yum list".. It has more options, and the output is much better parseable.

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