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