Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 986740

Summary: yum list is not pipeline-friendly
Product: Red Hat Enterprise Linux 6 Reporter: Paul Reiber <reiber>
Component: yumAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED NOTABUG QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.6CC: james.antill, jzeleny, zpavlas
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-22 06:44:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Paul Reiber 2013-07-22 01:55:33 UTC
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 06:44:28 UTC
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 08:32:01 UTC
Use repoquery instead of "yum list".. It has more options, and the output is much better parseable.