Bug 786116 - yum list available fails if not run on tty or with --color=never
Summary: yum list available fails if not run on tty or with --color=never
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: yum
Version: 16
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Fedora Packaging Toolset Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-01-31 14:11 UTC by Jan Stancek
Modified: 2014-01-21 23:20 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-05-02 08:56:19 UTC
Type: ---


Attachments (Terms of Use)
'list available foo-ver-rel' shows old packages. (1.28 KB, patch)
2012-02-01 12:26 UTC, Zdeněk Pavlas
no flags Details | Diff

Description Jan Stancek 2012-01-31 14:11:08 UTC
Description of problem:
I added (RHEL7 alpha) kernel repo to fresh Fedora16 installation. 
"yum list available" behaviour is not consistent when using pipes, redirecting to file or using --color=never.

1. yum --noplugins list available kernel-3.1.4-0.2.el7.x86_64
OK -> I see kernel package listed

2. yum --noplugins list available kernel-3.1.4-0.2.el7.x86_64 | cat
Error: No matching Packages to list
PROBLEM -> No packages

3. yum --noplugins list available kernel-3.1.4-0.2.el7.x86_64 > /tmp/1.txt
Error: No matching Packages to list
PROBLEM -> No package listed in file

4. yum --noplugins list available kernel-3.1.4-0.2.el7.x86_64 > /dev/tty
OK -> I see kernel package listed

5. yum --noplugins --color=auto list available kernel-3.1.4-0.2.el7.x86_64
OK -> I see kernel package listed

6. yum --noplugins --color=never list available kernel-3.1.4-0.2.el7.x86_64
Error: No matching Packages to list
PROBLEM -> Kernel package not listed

Version-Release number of selected component (if applicable):
yum-3.4.3-7.fc16.noarch

How reproducible:
100%

Steps to Reproduce:
1. add RHEL7 alpha kernel repo
2. yum --noplugins list available kernel-3.1.4-0.2.el7.x86_64 | cat
3. yum --noplugins --color=never list available kernel-3.1.4-0.2.el7.x86_64
  
Actual results:
kernel package is not listed

Expected results:
kernel package listed

Additional info:

Comment 2 Zdeněk Pavlas 2012-02-01 11:32:51 UTC
Confirmed.  There's a problem in doPackageLists(), and it's also in the current HEAD.  Depending on the availability of highlighting, 'yum list available' takes two different code paths, with slightly different rules for what's shown as 'available'.  The one with 'pkgnarrow=all' does not work correctly when the pattern includes package version.

The code tries to avoid printing packages as 'Available' when the package is already installed (this works), or a newer version is installed.  We could probably fix this.

Comment 3 Zdeněk Pavlas 2012-02-01 12:26:41 UTC
Created attachment 558808 [details]
'list available foo-ver-rel' shows old packages.

Comment 4 James Antill 2012-02-01 16:18:40 UTC
 To explain more, this happens when you "yum list available pkg-<old-version>" ... when nothing matches <old-version> in the rpmdb.

Comment 5 Fedora Admin XMLRPC Client 2012-04-27 15:28:35 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.


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