Blame SOURCES/BZ-1292150-updateinfo-list-available.patch

d2a170
commit 8ccc79d82bf0894def61cd2643d63e4adf3dcd02
d2a170
Author: Valentina Mukhamedzhanova <vmukhame@redhat.com>
d2a170
Date:   Wed Dec 16 15:31:15 2015 +0100
d2a170
d2a170
    Fix 'updateinfo list available' logic and make 'updates' the default
d2a170
d2a170
diff --git a/docs/yum.8 b/docs/yum.8
d2a170
index 99862fa..e428148 100644
d2a170
--- a/docs/yum.8
d2a170
+++ b/docs/yum.8
d2a170
@@ -630,20 +630,19 @@ to your machine (including anything installed, if you supply "all").
d2a170
 .br
d2a170
 
d2a170
 .br
d2a170
-.I \fR "\fB* all\fP"
d2a170
-Is used to display information about both install and available advisories.
d2a170
-.br
d2a170
-.I \fR "\fB* available\fP"
d2a170
-Is used to display information about just available advisories. This is the
d2a170
-default.
d2a170
+.I \fR "\fB* updates\fP"
d2a170
+Is used to display information about advisories for packages that can be
d2a170
+updated. This is the default.
d2a170
 .br
d2a170
 .I \fR "\fB* installed\fP"
d2a170
-Is used to display information about just install advisories.
d2a170
+Is used to display information only about installed advisories.
d2a170
 .br
d2a170
-.I \fR "\fB* updates\fP"
d2a170
-This is mostly the same as "available" but it only shows advisory information
d2a170
-for packages that can be updated to.
d2a170
-
d2a170
+.I \fR "\fB* available\fP"
d2a170
+Is used to display information about advisories for packages available
d2a170
+for updating or installation.
d2a170
+.br
d2a170
+.I \fR "\fB* all\fP"
d2a170
+Is used to display information about both installed and available advisories.
d2a170
 
d2a170
 .br
d2a170
 They all take as arguments:
d2a170
diff -up yum-3.4.3/yumcommands.py.old yum-3.4.3/yumcommands.py
d2a170
--- yum-3.4.3/yumcommands.py.old	2016-03-22 12:22:54.398569730 +0100
d2a170
+++ yum-3.4.3/yumcommands.py	2016-03-22 12:27:30.261523615 +0100
d2a170
@@ -4072,6 +4072,7 @@ class UpdateinfoCommand(YumCommand):
d2a170
         extcmds, show_type, filt_type = self._parse_extcmds(extcmds)
d2a170
 
d2a170
         list_type = "available"
d2a170
+        list_type = "updates"
d2a170
         if extcmds and extcmds[0] in ("updates","available","installed", "all"):
d2a170
             list_type = extcmds.pop(0)
d2a170
             if filt_type is None:
d2a170
@@ -4087,13 +4088,15 @@ class UpdateinfoCommand(YumCommand):
d2a170
         used_map = _upi._ysp_gen_used_map(base.updateinfo_filters)
d2a170
         iname2tup = {}
d2a170
         if False: pass
d2a170
-        elif list_type in ('installed', 'all'):
d2a170
+        elif list_type == 'installed':
d2a170
             name2tup = _upi._get_name2allpkgtup(base)
d2a170
             iname2tup = _upi._get_name2instpkgtup(base)
d2a170
         elif list_type == 'updates':
d2a170
             name2tup = _upi._get_name2oldpkgtup(base)
d2a170
-        elif list_type == 'available':
d2a170
-            name2tup = _upi._get_name2instpkgtup(base)
d2a170
+        elif list_type in ('available', 'all'):
d2a170
+            name2tup = _upi._get_name2aallpkgtup(base)
d2a170
+            iname2tup = _upi._get_name2instpkgtup(base)
d2a170
+
d2a170
 
d2a170
         def _show_pkgtup(pkgtup):
d2a170
             name = pkgtup[0]
d2a170
@@ -4106,6 +4109,10 @@ class UpdateinfoCommand(YumCommand):
d2a170
                     # Remove any that are newer than what we have installed
d2a170
                     if _upi._rpm_tup_vercmp(iname2tup[name], pkgtup) < 0:
d2a170
                         continue
d2a170
+                if list_type == 'available':
d2a170
+                    # Remove any that are installed
d2a170
+                    if name in iname2tup and _upi._rpm_tup_vercmp(iname2tup[name], pkgtup) >= 0:
d2a170
+                        continue
d2a170
 
d2a170
                 if _upi._ysp_should_filter_pkg(opts, name, notice, used_map):
d2a170
                     yield (pkgtup, notice)