[yum-commits] 5 commits - docs/yum.conf.5 output.py yumcommands.py yum/config.py yum-cron/yum-cron.py yum/__init__.py
James Antill
james at osuosl.org
Mon Nov 18 22:42:47 UTC 2013
docs/yum.conf.5 | 13 +++++++++++++
output.py | 25 ++++++++++++++++++++++++-
yum-cron/yum-cron.py | 25 +++++++++++++++++++++++--
yum/__init__.py | 5 ++++-
yum/config.py | 1 +
yumcommands.py | 11 +++++++----
6 files changed, 72 insertions(+), 8 deletions(-)
New commits:
commit 05846f0ce0ec09e6030f18f6e508a75347f529c0
Author: James Antill <james at and.org>
Date: Mon Nov 18 17:41:17 2013 -0500
Copy/Paste install for group upgrade lists into yum-cron output. BZ 1031374.
diff --git a/yum-cron/yum-cron.py b/yum-cron/yum-cron.py
index 79c1907..dd0a4c6 100755
--- a/yum-cron/yum-cron.py
+++ b/yum-cron/yum-cron.py
@@ -426,10 +426,31 @@ class UpdateEmitter(object):
return a_wid
-
+ ninstalled = self.tsInfo.installed
+ ginstalled = {}
+ if self.conf.group_command == 'objects' and ninstalled:
+ # Show new pkgs. that are installed via. a group.
+ ninstalled = []
+ for txmbr in self.tsInfo.installed:
+ if not hasattr(txmbr, '_ugroup_member'):
+ ninstalled.append(txmbr)
+ continue
+ if txmbr._ugroup_member not in ginstalled:
+ ginstalled[txmbr._ugroup_member] = []
+ ginstalled[txmbr._ugroup_member].append(txmbr)
+
+ for grp in sorted(ginstalled, key=lambda x: x.ui_name):
+ action = _('Installing for group upgrade "%s"') % grp.ui_name
+ pkglist = ginstalled[grp]
+
+ lines = []
+ for txmbr in pkglist:
+ a_wid = _add_line(lines, data, a_wid, txmbr.po, txmbr.obsoletes)
+
+ pkglist_lines.append((action, lines))
# Iterate through the different groups of packages
- for (action, pkglist) in [(_('Installing'), tsInfo.installed),
+ for (action, pkglist) in [(_('Installing'), ninstalled),
(_('Updating'), tsInfo.updated),
(_('Removing'), tsInfo.removed),
(_('Reinstalling'), tsInfo.reinstalled),
commit 8b977a860595a02dc13b5eefd5f8783ba23e4acf
Author: James Antill <james at and.org>
Date: Mon Nov 18 17:14:48 2013 -0500
Add _ugroup_member to txmbr, list installed for groups pkgs. BZ 1031374.
diff --git a/output.py b/output.py
index cf9e985..e42702e 100755
--- a/output.py
+++ b/output.py
@@ -1506,7 +1506,30 @@ class YumOutput:
a_wid = max(a_wid, len(a))
return a_wid
- for (action, pkglist) in [(_('Installing'), self.tsInfo.installed),
+ ninstalled = self.tsInfo.installed
+ ginstalled = {}
+ if self.conf.group_command == 'objects' and ninstalled:
+ # Show new pkgs. that are installed via. a group.
+ ninstalled = []
+ for txmbr in self.tsInfo.installed:
+ if not hasattr(txmbr, '_ugroup_member'):
+ ninstalled.append(txmbr)
+ continue
+ if txmbr._ugroup_member not in ginstalled:
+ ginstalled[txmbr._ugroup_member] = []
+ ginstalled[txmbr._ugroup_member].append(txmbr)
+
+ for grp in sorted(ginstalled, key=lambda x: x.ui_name):
+ action = _('Installing for group upgrade "%s"') % grp.ui_name
+ pkglist = ginstalled[grp]
+
+ lines = []
+ for txmbr in pkglist:
+ a_wid = _add_line(lines, data, a_wid, txmbr.po, txmbr.obsoletes)
+
+ pkglist_lines.append((action, lines))
+
+ for (action, pkglist) in [(_('Installing'), ninstalled),
(_('Updating'), self.tsInfo.updated),
(_('Removing'), self.tsInfo.removed),
(_('Reinstalling'), self.tsInfo.reinstalled),
diff --git a/yum/__init__.py b/yum/__init__.py
index 6bd5962..f212884 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -3845,6 +3845,8 @@ much more problems).
pkg_warning_level='debug2')
for txmbr in txmbrs:
txmbr.group_member = thisgroup.groupid
+ if lupgrade: # For list transaction.
+ txmbr._ugroup_member = thisgroup
except Errors.InstallError, e:
self.verbose_logger.debug(_('No package named %s available to be installed'),
pkg)
commit 944f42f65e8a2d4bf0928e85850bf81e2876e233
Author: James Antill <james at and.org>
Date: Mon Nov 18 16:05:33 2013 -0500
Add autocheck_running_kernel config. so people can turn it off.
diff --git a/docs/yum.conf.5 b/docs/yum.conf.5
index b93ad32..6fae41d 100644
--- a/docs/yum.conf.5
+++ b/docs/yum.conf.5
@@ -273,7 +273,14 @@ Default is: compat
\fBupgrade_group_objects_upgrade\fR
Either `0' or `1'. Set this to `0' to disable the automatic running of
"group upgrade" when running the "upgrade" command, and group_command is set to
-"objects". Default is `1' (perform the check).
+"objects". Default is `1' (perform the operation).
+
+.IP
+\fBautocheck_running_kernel\fR
+Either `0' or `1'. Set this to `0' to disable the automatic checking of the
+running kernel against updateinfo ("yum updateinfo check-running-kernel"), in
+the "check-update" and "updateinfo summary" commands.
+Default is `1' (perform the check).
.IP
\fBinstallroot \fR
diff --git a/yumcommands.py b/yumcommands.py
index a542ade..2b1c9c0 100644
--- a/yumcommands.py
+++ b/yumcommands.py
@@ -1609,7 +1609,8 @@ class CheckUpdateCommand(YumCommand):
result = 100
# Add check_running_kernel call, if updateinfo is available.
- if updateinfo._repos_downloaded(base.repos.listEnabled()):
+ if (base.conf.autocheck_running_kernel and
+ updateinfo._repos_downloaded(base.repos.listEnabled())):
def _msg(x):
base.verbose_logger.info("%s", x)
updateinfo._check_running_kernel(base, base.upinfo, _msg)
@@ -3850,7 +3851,8 @@ class UpdateinfoCommand(YumCommand):
if maxsize < size:
maxsize = size
if not maxsize:
- _upi._check_running_kernel(base, md_info, _msg)
+ if base.conf.autocheck_running_kernel:
+ _upi._check_running_kernel(base, md_info, _msg)
return
outT = {'newpackage' : 'New Package',
@@ -3880,7 +3882,8 @@ class UpdateinfoCommand(YumCommand):
for sn in sorted(sev_counts, key=_sev_sort_key):
args = (maxsize, sev_counts[sn],sn or '?', outT['security'])
print " %*u %s %s notice(s)" % args
- _upi._check_running_kernel(base, md_info, _msg)
+ if base.conf.autocheck_running_kernel:
+ _upi._check_running_kernel(base, md_info, _msg)
self.show_pkg_info_done = {}
def _get_new_pkgs(self, md_info):
commit aae263a57b9e1695d54d463df36f191f3facfb48
Author: James Antill <james at and.org>
Date: Mon Nov 18 15:58:19 2013 -0500
Add upgrade_group_objects_upgrade config. so people can turn it off.
diff --git a/docs/yum.conf.5 b/docs/yum.conf.5
index 53cef2e..b93ad32 100644
--- a/docs/yum.conf.5
+++ b/docs/yum.conf.5
@@ -270,6 +270,12 @@ packages for all groups).
Default is: compat
.IP
+\fBupgrade_group_objects_upgrade\fR
+Either `0' or `1'. Set this to `0' to disable the automatic running of
+"group upgrade" when running the "upgrade" command, and group_command is set to
+"objects". Default is `1' (perform the check).
+
+.IP
\fBinstallroot \fR
Specifies an alternative installroot, relative to which all packages will be
installed.
diff --git a/yum/__init__.py b/yum/__init__.py
index 6a6f1fc..6bd5962 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -5000,7 +5000,8 @@ much more problems).
tx_return.extend(self.update(po=new))
# Upgrade the installed groups, as part of generic "yum upgrade"
- if self.conf.group_command == 'objects':
+ if (self.conf.group_command == 'objects' and
+ self.conf.upgrade_group_objects_upgrade):
for ievgrp in self.igroups.environments:
tx_return.extend(self._at_groupupgrade('@^' + ievgrp))
for igrp in self.igroups.groups:
diff --git a/yum/config.py b/yum/config.py
index ecb8490..c43c41b 100644
--- a/yum/config.py
+++ b/yum/config.py
@@ -792,6 +792,7 @@ class YumConf(StartupConf):
group_package_types = ListOption(['mandatory', 'default'])
group_command = SelectionOption(__group_command_default__,
('compat', 'objects', 'simple'))
+ upgrade_group_objects_upgrade = BoolOption(True)
timeout = FloatOption(30.0) # FIXME: Should use variation of SecondsOption
commit d6378e152ad8751b5d135d7e8aba49e16f8a374a
Author: James Antill <james at and.org>
Date: Mon Nov 18 15:57:53 2013 -0500
Add distupgrade command as alias for distro-sync, to be compat. with zypper.
diff --git a/yumcommands.py b/yumcommands.py
index 1530161..a542ade 100644
--- a/yumcommands.py
+++ b/yumcommands.py
@@ -506,7 +506,7 @@ class DistroSyncCommand(YumCommand):
:return: a list containing the names of this command
"""
- return ['distribution-synchronization', 'distro-sync']
+ return ['distribution-synchronization', 'distro-sync', 'distupgrade']
def getUsage(self):
"""Return a usage string for this command.
More information about the Yum-commits
mailing list