Blame SOURCES/BZ-1053289-misc-perf+UI+simple-bug+docs-fixes.patch

d2a170
commit 1b14f27c1ff77ca3fb0af7dccc890a6c8bf36d42
d2a170
Author: Zdenek Pavlas <zpavlas@redhat.com>
d2a170
Date:   Wed Nov 6 14:42:59 2013 +0100
d2a170
d2a170
    docs: Suggest "--" when using "-<pkg>" to exclude packages. BZ 1026598
d2a170
d2a170
diff --git a/docs/yum.8 b/docs/yum.8
d2a170
index e42bf49..2cbdf72 100644
d2a170
--- a/docs/yum.8
d2a170
+++ b/docs/yum.8
d2a170
@@ -103,9 +103,13 @@ satisfied\&.  (See \fBSpecifying package names\fP for more information)
d2a170
 If no package matches the given package name(s), they are assumed to be a shell 
d2a170
 glob and any matches are then installed\&. If the name starts with @^ then it
d2a170
 is treated as an environment group (group install @^foo), an @ character and
d2a170
-it's treated as a group (plain group install)\&. If the name starts with
d2a170
-a - character, then a search is done within
d2a170
-the transaction and any matches are removed. If the name is a file, then install works
d2a170
+it's treated as a group (plain group install)\&.
d2a170
+
d2a170
+If the name starts with a "-" character, then a search is done within the
d2a170
+transaction and any matches are removed. Note that Yum options use the same
d2a170
+syntax and it may be necessary to use "--" to resolve any possible conflicts.
d2a170
+
d2a170
+If the name is a file, then install works
d2a170
 like localinstall\&. If the name doesn't match a package, then package
d2a170
 "provides" are searched (e.g. "_sqlitecache.so()(64bit)") as are
d2a170
 filelists (Eg. "/usr/bin/yum"). Also note that for filelists, wildcards will
d2a170
commit d78b1258ec9fd8ed312c4fede9a68db1623bb124
d2a170
Author: Zdenek Pavlas <zpavlas@redhat.com>
d2a170
Date:   Mon Nov 11 08:58:52 2013 +0100
d2a170
d2a170
    docs: exactarch option is removed.
d2a170
d2a170
diff --git a/docs/yum.conf.5 b/docs/yum.conf.5
d2a170
index 5d8578d..53cef2e 100644
d2a170
--- a/docs/yum.conf.5
d2a170
+++ b/docs/yum.conf.5
d2a170
@@ -158,12 +158,6 @@ Can be disabled using --disableexcludes.
d2a170
 Command-line option: \fB\-x\fP
d2a170
 
d2a170
 .IP
d2a170
-\fBexactarch\fR
d2a170
-Either `1' or `0'. Set to `1' to make yum update only update the architectures
d2a170
-of packages that you have installed. ie: with this enabled yum will not install
d2a170
-an i686 package to update an i386 package. Default is `1'.
d2a170
-
d2a170
-.IP
d2a170
 \fBinstallonlypkgs \fR
d2a170
 List of package provides that should only ever be installed, never updated.
d2a170
 Kernels in particular fall into this category. Defaults to kernel,
d2a170
commit d6378e152ad8751b5d135d7e8aba49e16f8a374a
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Mon Nov 18 15:57:53 2013 -0500
d2a170
d2a170
    Add distupgrade command as alias for distro-sync, to be compat. with zypper.
d2a170
d2a170
diff --git a/yumcommands.py b/yumcommands.py
d2a170
index 1530161..a542ade 100644
d2a170
--- a/yumcommands.py
d2a170
+++ b/yumcommands.py
d2a170
@@ -506,7 +506,7 @@ class DistroSyncCommand(YumCommand):
d2a170
 
d2a170
         :return: a list containing the names of this command
d2a170
         """
d2a170
-        return ['distribution-synchronization', 'distro-sync']
d2a170
+        return ['distribution-synchronization', 'distro-sync', 'distupgrade']
d2a170
 
d2a170
     def getUsage(self):
d2a170
         """Return a usage string for this command.
d2a170
commit aae263a57b9e1695d54d463df36f191f3facfb48
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Mon Nov 18 15:58:19 2013 -0500
d2a170
d2a170
    Add upgrade_group_objects_upgrade config. so people can turn it off.
d2a170
d2a170
diff --git a/docs/yum.conf.5 b/docs/yum.conf.5
d2a170
index 53cef2e..b93ad32 100644
d2a170
--- a/docs/yum.conf.5
d2a170
+++ b/docs/yum.conf.5
d2a170
@@ -270,6 +270,12 @@ packages for all groups).
d2a170
 Default is: compat
d2a170
 
d2a170
 .IP
d2a170
+\fBupgrade_group_objects_upgrade\fR
d2a170
+Either `0' or `1'. Set this to `0' to disable the automatic running of
d2a170
+"group upgrade" when running the "upgrade" command, and group_command is set to
d2a170
+"objects". Default is `1' (perform the check).
d2a170
+
d2a170
+.IP
d2a170
 \fBinstallroot \fR
d2a170
 Specifies an alternative installroot, relative to which all packages will be
d2a170
 installed. 
d2a170
diff --git a/yum/__init__.py b/yum/__init__.py
d2a170
index 6a6f1fc..6bd5962 100644
d2a170
--- a/yum/__init__.py
d2a170
+++ b/yum/__init__.py
d2a170
@@ -5000,7 +5000,8 @@ much more problems).
d2a170
                     tx_return.extend(self.update(po=new))
d2a170
 
d2a170
             # Upgrade the installed groups, as part of generic "yum upgrade"
d2a170
-            if self.conf.group_command == 'objects':
d2a170
+            if (self.conf.group_command == 'objects' and
d2a170
+                self.conf.upgrade_group_objects_upgrade):
d2a170
                 for ievgrp in self.igroups.environments:
d2a170
                     tx_return.extend(self._at_groupupgrade('@^' + ievgrp))
d2a170
                 for igrp in self.igroups.groups:
d2a170
diff --git a/yum/config.py b/yum/config.py
d2a170
index ecb8490..c43c41b 100644
d2a170
--- a/yum/config.py
d2a170
+++ b/yum/config.py
d2a170
@@ -792,6 +792,7 @@ class YumConf(StartupConf):
d2a170
     group_package_types = ListOption(['mandatory', 'default'])
d2a170
     group_command = SelectionOption(__group_command_default__,
d2a170
                                     ('compat', 'objects', 'simple'))
d2a170
+    upgrade_group_objects_upgrade = BoolOption(True)
d2a170
     
d2a170
     timeout = FloatOption(30.0) # FIXME: Should use variation of SecondsOption
d2a170
 
d2a170
commit 944f42f65e8a2d4bf0928e85850bf81e2876e233
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Mon Nov 18 16:05:33 2013 -0500
d2a170
d2a170
    Add autocheck_running_kernel config. so people can turn it off.
d2a170
d2a170
diff --git a/docs/yum.conf.5 b/docs/yum.conf.5
d2a170
index b93ad32..6fae41d 100644
d2a170
--- a/docs/yum.conf.5
d2a170
+++ b/docs/yum.conf.5
d2a170
@@ -273,7 +273,14 @@ Default is: compat
d2a170
 \fBupgrade_group_objects_upgrade\fR
d2a170
 Either `0' or `1'. Set this to `0' to disable the automatic running of
d2a170
 "group upgrade" when running the "upgrade" command, and group_command is set to
d2a170
-"objects". Default is `1' (perform the check).
d2a170
+"objects". Default is `1' (perform the operation).
d2a170
+
d2a170
+.IP
d2a170
+\fBautocheck_running_kernel\fR
d2a170
+Either `0' or `1'. Set this to `0' to disable the automatic checking of the
d2a170
+running kernel against updateinfo ("yum updateinfo check-running-kernel"), in
d2a170
+the "check-update" and "updateinfo summary" commands.
d2a170
+Default is `1' (perform the check).
d2a170
 
d2a170
 .IP
d2a170
 \fBinstallroot \fR
d2a170
diff --git a/yumcommands.py b/yumcommands.py
d2a170
index a542ade..2b1c9c0 100644
d2a170
--- a/yumcommands.py
d2a170
+++ b/yumcommands.py
d2a170
@@ -1609,7 +1609,8 @@ class CheckUpdateCommand(YumCommand):
d2a170
                 result = 100
d2a170
 
d2a170
             # Add check_running_kernel call, if updateinfo is available.
d2a170
-            if updateinfo._repos_downloaded(base.repos.listEnabled()):
d2a170
+            if (base.conf.autocheck_running_kernel and
d2a170
+                updateinfo._repos_downloaded(base.repos.listEnabled())):
d2a170
                 def _msg(x):
d2a170
                     base.verbose_logger.info("%s", x)
d2a170
                 updateinfo._check_running_kernel(base, base.upinfo, _msg)
d2a170
@@ -3850,7 +3851,8 @@ class UpdateinfoCommand(YumCommand):
d2a170
             if maxsize < size:
d2a170
                 maxsize = size
d2a170
         if not maxsize:
d2a170
-            _upi._check_running_kernel(base, md_info, _msg)
d2a170
+            if base.conf.autocheck_running_kernel:
d2a170
+                _upi._check_running_kernel(base, md_info, _msg)
d2a170
             return
d2a170
 
d2a170
         outT = {'newpackage' : 'New Package',
d2a170
@@ -3880,7 +3882,8 @@ class UpdateinfoCommand(YumCommand):
d2a170
                 for sn in sorted(sev_counts, key=_sev_sort_key):
d2a170
                     args = (maxsize, sev_counts[sn],sn or '?', outT['security'])
d2a170
                     print "        %*u %s %s notice(s)" % args
d2a170
-        _upi._check_running_kernel(base, md_info, _msg)
d2a170
+        if base.conf.autocheck_running_kernel:
d2a170
+            _upi._check_running_kernel(base, md_info, _msg)
d2a170
         self.show_pkg_info_done = {}
d2a170
 
d2a170
     def _get_new_pkgs(self, md_info):
d2a170
commit ecf31eee67bd3c5668f8b244c086365ebc510c05
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Tue Nov 19 11:57:13 2013 -0500
d2a170
d2a170
    Actually add the config. for autocheck_running_kernel.
d2a170
d2a170
diff --git a/yum/config.py b/yum/config.py
d2a170
index c43c41b..45abfd6 100644
d2a170
--- a/yum/config.py
d2a170
+++ b/yum/config.py
d2a170
@@ -898,6 +898,8 @@ class YumConf(StartupConf):
d2a170
 
d2a170
     depsolve_loop_limit = PositiveIntOption(100, names_of_0=["<forever>"])
d2a170
 
d2a170
+    autocheck_running_kernel = BoolOption(True)
d2a170
+
d2a170
     _reposlist = []
d2a170
 
d2a170
     def dump(self):
d2a170
commit 977a79be0f79069febde1ad81d8c71d240d08605
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Tue Nov 19 14:28:03 2013 -0500
d2a170
d2a170
    Add deltarpm_metadata_percentage config. so people can configure MD downloads.
d2a170
d2a170
diff --git a/docs/yum.conf.5 b/docs/yum.conf.5
d2a170
index 6fae41d..4e79298 100644
d2a170
--- a/docs/yum.conf.5
d2a170
+++ b/docs/yum.conf.5
d2a170
@@ -420,6 +420,15 @@ Use `0' to turn off delta rpm processing. Local repositories (with file://
d2a170
 baseurl) have delta rpms turned off by default.
d2a170
 
d2a170
 .IP
d2a170
+\fBdeltarpm_metadata_percentage\fR
d2a170
+When the relative size of deltarpm metadata vs pkgs is larger than this,
d2a170
+deltarpm metadata is not downloaded from the repo.
d2a170
+Default value is 100 (Deltarpm metadata must be smaller than the packages from
d2a170
+the repo). Note that you can give values over 100, so 200 means that the
d2a170
+metadata is required to be half the size of the packages.
d2a170
+Use `0' to turn off this check, and always download metadata.
d2a170
+
d2a170
+.IP
d2a170
 \fBsslcacert \fR
d2a170
 Path to the directory containing the databases of the certificate authorities
d2a170
 yum should use to verify SSL certificates. Defaults to none - uses system
d2a170
@@ -1043,6 +1052,11 @@ Overrides the \fBdeltarpm_percentage\fR option from the [main] section
d2a170
 for this repository.
d2a170
 
d2a170
 .IP
d2a170
+\fBdeltarpm_metadata_percentage\fR
d2a170
+Overrides the \fBdeltarpm_metadata_percentage\fR option from the [main] section
d2a170
+for this repository.
d2a170
+
d2a170
+.IP
d2a170
 \fBsslcacert \fR
d2a170
 Overrides the \fBsslcacert\fR option from the [main] section for this
d2a170
 repository.
d2a170
diff --git a/yum/config.py b/yum/config.py
d2a170
index cdad4bc..b891f82 100644
d2a170
--- a/yum/config.py
d2a170
+++ b/yum/config.py
d2a170
@@ -805,6 +805,7 @@ class YumConf(StartupConf):
d2a170
     max_connections = IntOption(0, range_min=0)
d2a170
     deltarpm = IntOption(2, range_min=-16, range_max=128)
d2a170
     deltarpm_percentage = IntOption(75, range_min=0, range_max=100)
d2a170
+    deltarpm_metadata_percentage = IntOption(100, range_min=0)
d2a170
 
d2a170
     http_caching = SelectionOption('all', ('none', 'packages', 'all'))
d2a170
     metadata_expire = SecondsOption(60 * 60 * 6) # Time in seconds (6h).
d2a170
@@ -977,7 +978,12 @@ class RepoConf(BaseConfig):
d2a170
     throttle = Inherit(YumConf.throttle)
d2a170
     timeout = Inherit(YumConf.timeout)
d2a170
     ip_resolve = Inherit(YumConf.ip_resolve)
d2a170
+    #  This isn't inherited so that we can automatically disable file:// _only_
d2a170
+    # repos. if they haven't set an explicit deltarpm_percentage for the repo.
d2a170
     deltarpm_percentage = IntOption(None, range_min=0, range_max=100)
d2a170
+    #  Rely on the above config. to do automatic disabling, and thus. no hack
d2a170
+    # needed here.
d2a170
+    deltarpm_metadata_percentage = Inherit(YumConf.deltarpm_metadata_percentage)
d2a170
 
d2a170
     http_caching = Inherit(YumConf.http_caching)
d2a170
     metadata_expire = Inherit(YumConf.metadata_expire)
d2a170
diff --git a/yum/drpm.py b/yum/drpm.py
d2a170
index 1fd7a11..42bf70e 100644
d2a170
--- a/yum/drpm.py
d2a170
+++ b/yum/drpm.py
d2a170
@@ -168,8 +168,13 @@ class DeltaInfo:
d2a170
                 self.verbose_logger.info(_('No Presto metadata available for %s'), repo)
d2a170
                 continue
d2a170
             path = repo.cachedir +'/'+ os.path.basename(data.location[1])
d2a170
-            if not os.path.exists(path) and int(data.size) > reposize[repo]:
d2a170
-                self.verbose_logger.info(_('Not downloading Presto metadata for %s'), repo)
d2a170
+            perc = repo.deltarpm_metadata_percentage
d2a170
+            data_size = int(data.size) * (perc / 100.0)
d2a170
+            if perc and not os.path.exists(path) and data_size > reposize[repo]:
d2a170
+                msg = _('Not downloading deltainfo for %s, MD is %s and rpms are %s')
d2a170
+                self.verbose_logger.info(msg, repo,
d2a170
+                                         progress.format_number(data_size),
d2a170
+                                         progress.format_number(reposize[repo]))
d2a170
                 continue
d2a170
 
d2a170
             def failfunc(e, name=name, repo=repo):
d2a170
commit b70d74e732f360a0a31cfcb9174982fb65369c54
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Wed Nov 27 14:00:32 2013 -0500
d2a170
d2a170
    Add check_config_file_age, so we can turn that off for rhsm repos. BZ 1035440.
d2a170
d2a170
diff --git a/docs/yum.conf.5 b/docs/yum.conf.5
d2a170
index 4e79298..da13dc8 100644
d2a170
--- a/docs/yum.conf.5
d2a170
+++ b/docs/yum.conf.5
d2a170
@@ -290,6 +290,18 @@ installed.
d2a170
 Command-line option: \fB\-\-installroot\fP
d2a170
 
d2a170
 .IP
d2a170
+\fBconfig_file_path \fR
d2a170
+Specifies the path to main the configuration file.
d2a170
+Default is /etc/yum/yum.conf.
d2a170
+
d2a170
+.IP
d2a170
+\fBcheck_config_file_age \fR
d2a170
+Either `0' or `1'. Specifies whether yum should auto metadata expire repos. 
d2a170
+that are older than any of the configuration files that led to them (usually 
d2a170
+the yum.conf file and the foo.repo file).
d2a170
+Default is `1' (perform the check).
d2a170
+
d2a170
+.IP
d2a170
 \fBdistroverpkg\fR
d2a170
 The package used by yum to determine the "version" of the distribution, this
d2a170
 sets $releasever for use in config. files. This
d2a170
diff --git a/yum/config.py b/yum/config.py
d2a170
index ea6c1ac..c38d574 100644
d2a170
--- a/yum/config.py
d2a170
+++ b/yum/config.py
d2a170
@@ -901,6 +901,8 @@ class YumConf(StartupConf):
d2a170
 
d2a170
     autocheck_running_kernel = BoolOption(True)
d2a170
 
d2a170
+    check_config_file_age = BoolOption(True)
d2a170
+
d2a170
     _reposlist = []
d2a170
 
d2a170
     def dump(self):
d2a170
@@ -1005,6 +1007,9 @@ class RepoConf(BaseConfig):
d2a170
     async = BoolOption(True)
d2a170
 
d2a170
     ui_repoid_vars = Inherit(YumConf.ui_repoid_vars)
d2a170
+
d2a170
+    check_config_file_age = Inherit(YumConf.check_config_file_age)
d2a170
+
d2a170
     
d2a170
 class VersionGroupConf(BaseConfig):
d2a170
     """Option definitions for version groups."""
d2a170
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
d2a170
index 67bb7c9..35359e2 100644
d2a170
--- a/yum/yumRepo.py
d2a170
+++ b/yum/yumRepo.py
d2a170
@@ -1170,6 +1170,9 @@ Insufficient space in download directory %s
d2a170
             elif cookie_info[8] > time.time():
d2a170
                 val = False
d2a170
 
d2a170
+            if not self.check_config_file_age:
d2a170
+                return val
d2a170
+
d2a170
             # make sure none of our config files for this repo are newer than
d2a170
             # us
d2a170
             if cookie_info[8] < int(self.repo_config_age):
d2a170
commit a88b3ee54bd6f3b7c6855e0595d443fa6a453798
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Sun Dec 1 19:41:18 2013 -0500
d2a170
d2a170
    Better doc. comment for re_primary_filename().
d2a170
d2a170
diff --git a/yum/misc.py b/yum/misc.py
d2a170
index b817cc0..f551102 100644
d2a170
--- a/yum/misc.py
d2a170
+++ b/yum/misc.py
d2a170
@@ -134,8 +134,9 @@ def re_filename(s):
d2a170
 
d2a170
 def re_primary_filename(filename):
d2a170
     """ Tests if a filename string, can be matched against just primary.
d2a170
-        Note that this can produce false negatives (but not false
d2a170
-        positives). Note that this is a superset of re_primary_dirname(). """
d2a170
+        Note that this can produce false negatives (Eg. /b?n/zsh) but not false
d2a170
+        positives (because the former is a perf hit, and the later is a
d2a170
+        failure). Note that this is a superset of re_primary_dirname(). """
d2a170
     if re_primary_dirname(filename):
d2a170
         return True
d2a170
     if filename == '/usr/lib/sendmail':
d2a170
commit 32e2da9c3e068722f82ae346c761a55ac9d969c9
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Thu Dec 5 16:31:02 2013 -0500
d2a170
d2a170
    Fix needTs check with repo-pkgs list/info.
d2a170
d2a170
diff --git a/yumcommands.py b/yumcommands.py
d2a170
index 2b1c9c0..db1b9d3 100644
d2a170
--- a/yumcommands.py
d2a170
+++ b/yumcommands.py
d2a170
@@ -3712,7 +3712,7 @@ class RepoPkgsCommand(YumCommand):
d2a170
         if len(extcmds) > 1:
d2a170
             cmd = extcmds[1]
d2a170
         if cmd in ('info', 'list'):
d2a170
-            return InfoCommand().cacheRequirement(base, cmd, extcmds[2:])
d2a170
+            return InfoCommand().needTs(base, cmd, extcmds[2:])
d2a170
 
d2a170
         return True
d2a170
 
d2a170
commit 88a93e8de73066a796bbb698c5c6f59b66174448
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Thu Dec 5 16:36:54 2013 -0500
d2a170
d2a170
    Add command variation aliases to check-update.
d2a170
d2a170
diff --git a/yumcommands.py b/yumcommands.py
d2a170
index db1b9d3..3412a60 100644
d2a170
--- a/yumcommands.py
d2a170
+++ b/yumcommands.py
d2a170
@@ -1531,7 +1531,8 @@ class CheckUpdateCommand(YumCommand):
d2a170
 
d2a170
         :return: a list containing the names of this command
d2a170
         """
d2a170
-        return ['check-update']
d2a170
+        return ['check-update',  'check-updates',
d2a170
+                'check-upgrade', 'check-upgrades']
d2a170
 
d2a170
     def getUsage(self):
d2a170
         """Return a usage string for this command.
d2a170
commit ade4e34d1578ad4046b5efe3c3a97ca6bc1791f5
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Thu Dec 5 16:37:07 2013 -0500
d2a170
d2a170
    Add check-update sub-command to repo-pkgs.
d2a170
d2a170
diff --git a/docs/yum.8 b/docs/yum.8
d2a170
index 0914765..dff88af 100644
d2a170
--- a/docs/yum.8
d2a170
+++ b/docs/yum.8
d2a170
@@ -423,6 +423,9 @@ only shows packages from the given repository.
d2a170
 "repository\-packages <repo> info" - Works like the "yum info" command, but
d2a170
 only shows packages from the given repository.
d2a170
 
d2a170
+"repository\-packages <repo> check-update" - Works like the
d2a170
+"yum check-update" command, but only shows packages from the given repository.
d2a170
+
d2a170
 "repository\-packages <repo> install" - Install all of the packages in the
d2a170
 repository, basically the same as: yum install $(repoquery --repoid=<repo> -a).
d2a170
 Specific packages/wildcards can be specified.
d2a170
diff --git a/yumcommands.py b/yumcommands.py
d2a170
index 3412a60..b346128 100644
d2a170
--- a/yumcommands.py
d2a170
+++ b/yumcommands.py
d2a170
@@ -1558,7 +1558,7 @@ class CheckUpdateCommand(YumCommand):
d2a170
         """
d2a170
         checkEnabledRepo(base)
d2a170
 
d2a170
-    def doCommand(self, base, basecmd, extcmds):
d2a170
+    def doCommand(self, base, basecmd, extcmds, repoid=None):
d2a170
         """Execute this command.
d2a170
 
d2a170
         :param base: a :class:`yum.Yumbase` object
d2a170
@@ -1577,10 +1577,10 @@ class CheckUpdateCommand(YumCommand):
d2a170
         base.extcmds.insert(0, 'updates')
d2a170
         result = 0
d2a170
         if True:
d2a170
-            ypl = base.returnPkgLists(extcmds)
d2a170
+            ypl = base.returnPkgLists(extcmds, repoid=repoid)
d2a170
             if (base.conf.obsoletes or
d2a170
                 base.verbose_logger.isEnabledFor(logginglevels.DEBUG_3)):
d2a170
-                typl = base.returnPkgLists(obscmds)
d2a170
+                typl = base.returnPkgLists(obscmds, repoid=repoid)
d2a170
                 ypl.obsoletes = typl.obsoletes
d2a170
                 ypl.obsoletesTuples = typl.obsoletesTuples
d2a170
 
d2a170
@@ -1606,7 +1606,7 @@ class CheckUpdateCommand(YumCommand):
d2a170
                 for obtup in sorted(ypl.obsoletesTuples,
d2a170
                                     key=operator.itemgetter(0)):
d2a170
                     base.updatesObsoletesList(obtup, 'obsoletes',
d2a170
-                                              columns=columns)
d2a170
+                                              columns=columns, repoid=repoid)
d2a170
                 result = 100
d2a170
 
d2a170
             # Add check_running_kernel call, if updateinfo is available.
d2a170
@@ -3516,6 +3516,9 @@ class RepoPkgsCommand(YumCommand):
d2a170
                  'remove-or-distribution-synchronization' : 'remove-or-sync',
d2a170
                  'upgrade' : 'update', # Hack, but meh.
d2a170
                  'upgrade-to' : 'update-to', # Hack, but meh.
d2a170
+                 'check-upgrade' : 'check-update', # Hack, but meh.
d2a170
+                 'check-upgrades' : 'check-update', # Hack, but meh.
d2a170
+                 'check-updates' : 'check-update', # Hack, but meh.
d2a170
                  }
d2a170
         cmd = remap.get(cmd, cmd)
d2a170
 
d2a170
@@ -3524,6 +3527,8 @@ class RepoPkgsCommand(YumCommand):
d2a170
             return ListCommand().doCommand(base, cmd, args, repoid=repoid)
d2a170
         elif cmd == 'info':
d2a170
             return InfoCommand().doCommand(base, cmd, args, repoid=repoid)
d2a170
+        elif cmd == 'check-update':
d2a170
+            return CheckUpdateCommand().doCommand(base, cmd, args,repoid=repoid)
d2a170
 
d2a170
         elif cmd == 'install': # install is simpler version of installPkgs...
d2a170
             for arg in args:
d2a170
@@ -3730,6 +3735,9 @@ class RepoPkgsCommand(YumCommand):
d2a170
             cmd = extcmds[1]
d2a170
         if cmd in ('info', 'list'):
d2a170
             return InfoCommand().cacheRequirement(base, cmd, extcmds[2:])
d2a170
+        if cmd in ('check-update', 'check-upgrade',
d2a170
+                   'check-updates', 'check-upgrades'):
d2a170
+            return CheckUpdateCommand().cacheRequirement(base, cmd, extcmds[2:])
d2a170
         return 'write'
d2a170
 
d2a170
 # Using this a lot, so make it easier...
d2a170
commit 84876b27c49056a8d86112020a9ec4ec7a13e852
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Fri Dec 6 11:04:31 2013 -0500
d2a170
d2a170
     Fix cacheReq manipulation. BZ 1039028.
d2a170
    
d2a170
     Only look at enabled repos. for cacheReq cookie comparisons. BZ 1039028.
d2a170
    
d2a170
     Move all the cacheReq repo. setting into a function.
d2a170
    
d2a170
     Use the function everywhere so we don't overwrite the manipulated value with
d2a170
    the generic value.
d2a170
d2a170
diff --git a/cli.py b/cli.py
d2a170
index 7f6643f..180ba99 100755
d2a170
--- a/cli.py
d2a170
+++ b/cli.py
d2a170
@@ -390,6 +390,13 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
d2a170
                                   self.basecmd, sys.argv[0])
d2a170
             raise CliError
d2a170
     
d2a170
+        self._set_repos_cache_req()
d2a170
+
d2a170
+        self.yum_cli_commands[self.basecmd].doCheck(self, self.basecmd, self.extcmds)
d2a170
+
d2a170
+    def _set_repos_cache_req(self, warning=True):
d2a170
+        """ Set the cacheReq attribute from the commands to the repos. """
d2a170
+
d2a170
         cmd = self.yum_cli_commands[self.basecmd]
d2a170
         cacheReq = 'write'
d2a170
         if hasattr(cmd, 'cacheRequirement'):
d2a170
@@ -404,7 +411,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
d2a170
         # they are _really_ old.
d2a170
         ts_min = None
d2a170
         ts_max = None
d2a170
-        for repo in self.repos.sort():
d2a170
+        for repo in self.repos.listEnabled():
d2a170
             if not os.path.exists(repo.metadata_cookie):
d2a170
                 ts_min = None
d2a170
                 break
d2a170
@@ -428,14 +435,12 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
d2a170
 
d2a170
         if not ts_min:
d2a170
             cacheReq = 'write'
d2a170
-        elif (time.time() - ts_max) > (60 * 60 * 24 * 14):
d2a170
+        elif warning and (time.time() - ts_max) > (60 * 60 * 24 * 14):
d2a170
             self.logger.warning(_("Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast"))
d2a170
 
d2a170
         for repo in self.repos.sort():
d2a170
             repo._metadata_cache_req = cacheReq
d2a170
 
d2a170
-        self.yum_cli_commands[self.basecmd].doCheck(self, self.basecmd, self.extcmds)
d2a170
-
d2a170
     def _shell_history_write(self):
d2a170
         if not hasattr(self, '_shell_history_cmds'):
d2a170
             return
d2a170
@@ -560,11 +565,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
d2a170
 
d2a170
         #  This should already have been done at doCheck() time, but just in
d2a170
         # case repos. got added or something do it again.
d2a170
-        cacheReq = 'write'
d2a170
-        if hasattr(cmd, 'cacheRequirement'):
d2a170
-            cacheReq = cmd.cacheRequirement(self, self.basecmd, self.extcmds)
d2a170
-        for repo in self.repos.sort():
d2a170
-            repo._metadata_cache_req = cacheReq
d2a170
+        self._set_repos_cache_req(warning=False)
d2a170
 
d2a170
         return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds)
d2a170
 
d2a170
commit 8c4c81b8f958ffaf6f3cf710225eee48426ce767
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Fri Dec 6 11:11:05 2013 -0500
d2a170
d2a170
    Add comment about magic float timestamp compat. problem.
d2a170
d2a170
diff --git a/yum/repoMDObject.py b/yum/repoMDObject.py
d2a170
index 97e6797..c2a349e 100755
d2a170
--- a/yum/repoMDObject.py
d2a170
+++ b/yum/repoMDObject.py
d2a170
@@ -172,6 +172,9 @@ class RepoMD:
d2a170
                         thisdata = old
d2a170
                     self.repoData[thisdata.type] = thisdata
d2a170
                     try:
d2a170
+                        # NOTE: This will fail on float timestamps, this is
d2a170
+                        # required for compatability. Fix is to not generate
d2a170
+                        # float timestamps in repomd.xml.
d2a170
                         nts = int(thisdata.timestamp)
d2a170
                         if nts > self.timestamp: # max() not in old python
d2a170
                             self.timestamp = nts
d2a170
commit 833be09639371c9e0c88bc125e40ef682bbc4a30
d2a170
Author: Zdenek Pavlas <zpavlas@redhat.com>
d2a170
Date:   Mon Dec 9 17:58:25 2013 +0100
d2a170
d2a170
    Align the time formatting in the "Total" output with urlgrabber.progress
d2a170
d2a170
diff --git a/output.py b/output.py
d2a170
index e42702e..041910c 100755
d2a170
--- a/output.py
d2a170
+++ b/output.py
d2a170
@@ -1837,7 +1837,7 @@ to exit.
d2a170
         if dl_time <= 0: # This stops divide by zero, among other problems
d2a170
             dl_time = 0.01
d2a170
         ui_size = tl.add(' | %5sB' % self.format_number(remote_size))
d2a170
-        ui_time = tl.add(' %9s' % self.format_time(dl_time))
d2a170
+        ui_time = tl.add('  %s' % self.format_time(dl_time, tl._llen > 80))
d2a170
         ui_end  = tl.add(' ' * 5)
d2a170
         ui_bs   = tl.add(' %5sB/s' % self.format_number(remote_size / dl_time))
d2a170
         msg = "%s%s%s%s%s" % (utf8_width_fill(_("Total"), tl.rest(), tl.rest()),
d2a170
commit e1db5d6a94dee861d1fa0552277bc03f037c6e3a
d2a170
Author: Zdenek Pavlas <zpavlas@redhat.com>
d2a170
Date:   Tue Dec 10 08:47:48 2013 +0100
d2a170
d2a170
    yum-cron: stderr/email: no output if no messages
d2a170
d2a170
diff --git a/yum-cron/yum-cron.py b/yum-cron/yum-cron.py
d2a170
index dd0a4c6..f53fbfb 100755
d2a170
--- a/yum-cron/yum-cron.py
d2a170
+++ b/yum-cron/yum-cron.py
d2a170
@@ -685,6 +685,9 @@ class EmailEmitter(UpdateEmitter):
d2a170
         """Combine the stored messages that have been stored into a
d2a170
         single email message, and send this message.
d2a170
         """
d2a170
+        # Don't send empty emails
d2a170
+        if not self.output:
d2a170
+            return
d2a170
         # Build up the email to be sent
d2a170
         msg = MIMEText(''.join(self.output))
d2a170
         msg['Subject'] = self.subject
d2a170
@@ -708,6 +711,9 @@ class StdIOEmitter(UpdateEmitter):
d2a170
         """Combine the stored messages that have been stored into a
d2a170
         single email message, and send this message to standard output.
d2a170
         """
d2a170
+        # Don't print blank lines
d2a170
+        if not self.output:
d2a170
+            return
d2a170
         print "".join(self.output)
d2a170
 
d2a170
 
d2a170
commit 78c4435ddbb00d11bf42040e8afb34ee1cf107b5
d2a170
Author: Zdenek Pavlas <zpavlas@redhat.com>
d2a170
Date:   Tue Dec 10 10:02:29 2013 +0100
d2a170
d2a170
    Fix a gettext string (typo).
d2a170
d2a170
diff --git a/yum/__init__.py b/yum/__init__.py
d2a170
index f212884..caafae4 100644
d2a170
--- a/yum/__init__.py
d2a170
+++ b/yum/__init__.py
d2a170
@@ -1929,7 +1929,7 @@ much more problems).
d2a170
                     # maybe a file log here, too
d2a170
                     # but raising an exception is not going to do any good
d2a170
                     self.logger.critical(_('%s was supposed to be installed' \
d2a170
-                                           ' but is not!' % txmbr.po))
d2a170
+                                           ' but is not!') % txmbr.po)
d2a170
                     # Note: Get Panu to do te.Failed() so we don't have to
d2a170
                     txmbr.output_state = TS_FAILED
d2a170
                     count = _call_txmbr_cb(txmbr, count)
d2a170
commit cc0d8d11c90515ead4f3e1018e0f82b2edbc8274
d2a170
Author: Zdenek Pavlas <zpavlas@redhat.com>
d2a170
Date:   Tue Dec 10 16:15:57 2013 +0100
d2a170
d2a170
    completion-helper: No pkg list when len(prefix) < 1. BZ 1040033
d2a170
d2a170
diff --git a/etc/yum.bash b/etc/yum.bash
d2a170
index 40541af..aae8992 100644
d2a170
--- a/etc/yum.bash
d2a170
+++ b/etc/yum.bash
d2a170
@@ -19,6 +19,8 @@ _yum_list()
d2a170
 {
d2a170
     # Fail fast for things that look like paths or options.
d2a170
     [[ $2 == */* || $2 == [.~-]* ]] && return
d2a170
+    # Listing all packages takes way too long
d2a170
+    [[ ${#2} -lt 1 ]] && return
d2a170
     _yum_helper list "$@"
d2a170
 }
d2a170
 
d2a170
commit 7479c24ff5196f740614338247a7c513fe56486b
d2a170
Author: Zdenek Pavlas <zpavlas@redhat.com>
d2a170
Date:   Fri Dec 13 09:01:14 2013 +0100
d2a170
d2a170
    completion-helper: accept empty prefix when listing installed pkgs
d2a170
d2a170
diff --git a/etc/yum.bash b/etc/yum.bash
d2a170
index aae8992..16d096c 100644
d2a170
--- a/etc/yum.bash
d2a170
+++ b/etc/yum.bash
d2a170
@@ -19,8 +19,8 @@ _yum_list()
d2a170
 {
d2a170
     # Fail fast for things that look like paths or options.
d2a170
     [[ $2 == */* || $2 == [.~-]* ]] && return
d2a170
-    # Listing all packages takes way too long
d2a170
-    [[ ${#2} -lt 1 ]] && return
d2a170
+    # Listing all available packages takes way too long
d2a170
+    [[ $1 != "installed" && ${#2} -lt 1 ]] && return
d2a170
     _yum_helper list "$@"
d2a170
 }
d2a170
 
d2a170
commit 05846f0ce0ec09e6030f18f6e508a75347f529c0
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Mon Nov 18 17:41:17 2013 -0500
d2a170
d2a170
    Copy/Paste install for group upgrade lists into yum-cron output. BZ 1031374.
d2a170
d2a170
diff --git a/yum-cron/yum-cron.py b/yum-cron/yum-cron.py
d2a170
index 79c1907..dd0a4c6 100755
d2a170
--- a/yum-cron/yum-cron.py
d2a170
+++ b/yum-cron/yum-cron.py
d2a170
@@ -426,10 +426,31 @@ class UpdateEmitter(object):
d2a170
 
d2a170
             return a_wid
d2a170
 
d2a170
-        
d2a170
+        ninstalled = self.tsInfo.installed
d2a170
+        ginstalled = {}
d2a170
+        if self.conf.group_command == 'objects' and ninstalled:
d2a170
+            # Show new pkgs. that are installed via. a group.
d2a170
+            ninstalled = []
d2a170
+            for txmbr in self.tsInfo.installed:
d2a170
+                if not hasattr(txmbr, '_ugroup_member'):
d2a170
+                    ninstalled.append(txmbr)
d2a170
+                    continue
d2a170
+                if txmbr._ugroup_member not in ginstalled:
d2a170
+                    ginstalled[txmbr._ugroup_member] = []
d2a170
+                ginstalled[txmbr._ugroup_member].append(txmbr)
d2a170
+
d2a170
+        for grp in sorted(ginstalled, key=lambda x: x.ui_name):
d2a170
+            action = _('Installing for group upgrade "%s"') % grp.ui_name
d2a170
+            pkglist = ginstalled[grp]
d2a170
+
d2a170
+            lines = []
d2a170
+            for txmbr in pkglist:
d2a170
+                a_wid = _add_line(lines, data, a_wid, txmbr.po, txmbr.obsoletes)
d2a170
+
d2a170
+            pkglist_lines.append((action, lines))        
d2a170
 
d2a170
         # Iterate through the different groups of packages
d2a170
-        for (action, pkglist) in [(_('Installing'), tsInfo.installed),
d2a170
+        for (action, pkglist) in [(_('Installing'), ninstalled),
d2a170
                             (_('Updating'), tsInfo.updated),
d2a170
                             (_('Removing'), tsInfo.removed),
d2a170
                             (_('Reinstalling'), tsInfo.reinstalled),
d2a170
commit d0bba60912ec09dd6bbbc1dfbf2b27688bec3e68
d2a170
Author: Zdenek Pavlas <zpavlas@redhat.com>
d2a170
Date:   Fri Dec 13 09:39:36 2013 +0100
d2a170
d2a170
    yum-cron: Inherit YumOutput. BZ 1040109
d2a170
    
d2a170
    When yum-cron can use bits from output.py, we don't have to
d2a170
    duplicate about 450 lines of code.
d2a170
d2a170
diff --git a/yum-cron/yum-cron.py b/yum-cron/yum-cron.py
d2a170
index f53fbfb..5661fbb 100755
d2a170
--- a/yum-cron/yum-cron.py
d2a170
+++ b/yum-cron/yum-cron.py
d2a170
@@ -21,6 +21,7 @@ from yum.misc import setup_locale
d2a170
 
d2a170
 # FIXME: is it really sane to use this from here?
d2a170
 sys.path.append('/usr/share/yum-cli')
d2a170
+from output import YumOutput
d2a170
 import callback
d2a170
 
d2a170
 default_config_file = '/etc/yum/yum-cron.conf'
d2a170
@@ -155,447 +156,9 @@ class UpdateEmitter(object):
d2a170
         """
d2a170
         pass
d2a170
 
d2a170
-    def _format_number(self, number, SI=0, space=' '):
d2a170
-        """Return a human-readable metric-like string representation
d2a170
-        of a number.
d2a170
-
d2a170
-        :param number: the number to be converted to a human-readable form
d2a170
-        :param SI: If is 0, this function will use the convention
d2a170
-           that 1 kilobyte = 1024 bytes, otherwise, the convention
d2a170
-           that 1 kilobyte = 1000 bytes will be used
d2a170
-        :param space: string that will be placed between the number
d2a170
-           and the SI prefix
d2a170
-        :return: a human-readable metric-like string representation of
d2a170
-           *number*
d2a170
-        """
d2a170
-        symbols = [ ' ', # (none)
d2a170
-                    'k', # kilo
d2a170
-                    'M', # mega
d2a170
-                    'G', # giga
d2a170
-                    'T', # tera
d2a170
-                    'P', # peta
d2a170
-                    'E', # exa
d2a170
-                    'Z', # zetta
d2a170
-                    'Y'] # yotta
d2a170
-    
d2a170
-        if SI: step = 1000.0
d2a170
-        else: step = 1024.0
d2a170
-    
d2a170
-        thresh = 999
d2a170
-        depth = 0
d2a170
-        max_depth = len(symbols) - 1
d2a170
-    
d2a170
-        # we want numbers between 0 and thresh, but don't exceed the length
d2a170
-        # of our list.  In that event, the formatting will be screwed up,
d2a170
-        # but it'll still show the right number.
d2a170
-        while number > thresh and depth < max_depth:
d2a170
-            depth  = depth + 1
d2a170
-            number = number / step
d2a170
-    
d2a170
-        if type(number) == type(1) or type(number) == type(1L):
d2a170
-            format = '%i%s%s'
d2a170
-        elif number < 9.95:
d2a170
-            # must use 9.95 for proper sizing.  For example, 9.99 will be
d2a170
-            # rounded to 10.0 with the .1f format string (which is too long)
d2a170
-            format = '%.1f%s%s'
d2a170
-        else:
d2a170
-            format = '%.0f%s%s'
d2a170
-    
d2a170
-        return(format % (float(number or 0), space, symbols[depth]))
d2a170
-
d2a170
-    def _fmtColumns(self, columns, msg=u'', end=u'', text_width=utf8_width):
d2a170
-        """Return a row of data formatted into a string for output.
d2a170
-        Items can overflow their columns. 
d2a170
-
d2a170
-        :param columns: a list of tuples containing the data to
d2a170
-           output.  Each tuple contains first the item to be output,
d2a170
-           then the amount of space allocated for the column, and then
d2a170
-           optionally a type of highlighting for the item
d2a170
-        :param msg: a string to begin the line of output with
d2a170
-        :param end: a string to end the line of output with
d2a170
-        :param text_width: a function to find the width of the items
d2a170
-           in the columns.  This defaults to utf8 but can be changed
d2a170
-           to len() if you know it'll be fine
d2a170
-        :return: a row of data formatted into a string for output
d2a170
-        """
d2a170
-        total_width = len(msg)
d2a170
-        data = []
d2a170
-        for col_data in columns[:-1]:
d2a170
-            (val, width) = col_data
d2a170
-
d2a170
-            if not width: # Don't count this column, invisible text
d2a170
-                msg += u"%s"
d2a170
-                data.append(val)
d2a170
-                continue
d2a170
-
d2a170
-            (align, width) = self._fmt_column_align_width(width)
d2a170
-            val_width = text_width(val)
d2a170
-            if val_width <= width:
d2a170
-                #  Don't use utf8_width_fill() because it sucks performance
d2a170
-                # wise for 1,000s of rows. Also allows us to use len(), when
d2a170
-                # we can.
d2a170
-                msg += u"%s%s "
d2a170
-                if (align == u'-'):
d2a170
-                    data.extend([val, " " * (width - val_width)])
d2a170
-                else:
d2a170
-                    data.extend([" " * (width - val_width), val])
d2a170
-            else:
d2a170
-                msg += u"%s\n" + " " * (total_width + width + 1)
d2a170
-                data.append(val)
d2a170
-            total_width += width
d2a170
-            total_width += 1
d2a170
-        (val, width) = columns[-1]
d2a170
-        (align, width) = self._fmt_column_align_width(width)
d2a170
-        val = utf8_width_fill(val, width, left=(align == u'-'))
d2a170
-        msg += u"%%s%s" % end
d2a170
-        data.append(val)
d2a170
-        return msg % tuple(data)
d2a170
-
d2a170
-    def _calcColumns(self, data, total_width, columns=None, remainder_column=0, indent=''):
d2a170
-        """Dynamically calculate the widths of the columns that the
d2a170
-        fields in data should be placed into for output.
d2a170
-        
d2a170
-        :param data: a list of dictionaries that represent the data to
d2a170
-           be output.  Each dictionary in the list corresponds to annn
d2a170
-           column of output. The keys of the dictionary are the
d2a170
-           lengths of the items to be output, and the value associated
d2a170
-           with a key is the number of items of that length.
d2a170
-        :param total_width: the total width of the output.
d2a170
-        :param columns: a list containing the minimum amount of space
d2a170
-           that must be allocated for each row. This can be used to
d2a170
-           ensure that there is space available in a column if, for
d2a170
-           example, the actual lengths of the items being output
d2a170
-           cannot be given in *data*
d2a170
-        :param remainder_column: number of the column to receive a few
d2a170
-           extra spaces that may remain after other allocation has
d2a170
-           taken place
d2a170
-        :param indent: string that will be prefixed to a line of
d2a170
-           output to create e.g. an indent
d2a170
-        :return: a list of the widths of the columns that the fields
d2a170
-           in data should be placed into for output
d2a170
-        """
d2a170
-        if total_width is None:
d2a170
-            total_width = self.term.columns
d2a170
-
d2a170
-        cols = len(data)
d2a170
-        # Convert the data to ascending list of tuples, (field_length, pkgs)
d2a170
-        pdata = data
d2a170
-        data  = [None] * cols # Don't modify the passed in data
d2a170
-        for d in range(0, cols):
d2a170
-            data[d] = sorted(pdata[d].items())
d2a170
-
d2a170
-        #  We start allocating 1 char to everything but the last column, and a
d2a170
-        # space between each (again, except for the last column). Because
d2a170
-        # at worst we are better with:
d2a170
-        # |one two three|
d2a170
-        # | four        |
d2a170
-        # ...than:
d2a170
-        # |one two three|
d2a170
-        # |            f|
d2a170
-        # |our          |
d2a170
-        # ...the later being what we get if we pre-allocate the last column, and
d2a170
-        # thus. the space, due to "three" overflowing it's column by 2 chars.
d2a170
-        if columns is None:
d2a170
-            columns = [1] * (cols - 1)
d2a170
-            columns.append(0)
d2a170
-
d2a170
-        total_width -= (sum(columns) + (cols - 1) +
d2a170
-                        utf8_width(indent))
d2a170
-        if not columns[-1]:
d2a170
-            total_width += 1
d2a170
-        while total_width > 0:
d2a170
-            # Find which field all the spaces left will help best
d2a170
-            helps = 0
d2a170
-            val   = 0
d2a170
-            for d in xrange(0, cols):
d2a170
-                thelps = self._calc_columns_spaces_helps(columns[d], data[d],
d2a170
-                                                         total_width)
d2a170
-                if not thelps:
d2a170
-                    continue
d2a170
-                #  We prefer to overflow: the last column, and then earlier
d2a170
-                # columns. This is so that in the best case (just overflow the
d2a170
-                # last) ... grep still "works", and then we make it prettier.
d2a170
-                if helps and (d == (cols - 1)) and (thelps / 2) < helps:
d2a170
-                    continue
d2a170
-                if thelps < helps:
d2a170
-                    continue
d2a170
-                helps = thelps
d2a170
-                val   = d
d2a170
-
d2a170
-            #  If we found a column to expand, move up to the next level with
d2a170
-            # that column and start again with any remaining space.
d2a170
-            if helps:
d2a170
-                diff = data[val].pop(0)[0] - columns[val]
d2a170
-                if not columns[val] and (val == (cols - 1)):
d2a170
-                    #  If we are going from 0 => N on the last column, take 1
d2a170
-                    # for the space before the column.
d2a170
-                    total_width  -= 1
d2a170
-                columns[val] += diff
d2a170
-                total_width  -= diff
d2a170
-                continue
d2a170
-
d2a170
-            overflowed_columns = 0
d2a170
-            for d in xrange(0, cols):
d2a170
-                if not data[d]:
d2a170
-                    continue
d2a170
-                overflowed_columns += 1
d2a170
-            if overflowed_columns:
d2a170
-                #  Split the remaining spaces among each overflowed column
d2a170
-                # equally
d2a170
-                norm = total_width / overflowed_columns
d2a170
-                for d in xrange(0, cols):
d2a170
-                    if not data[d]:
d2a170
-                        continue
d2a170
-                    columns[d] += norm
d2a170
-                    total_width -= norm
d2a170
-
d2a170
-            #  Split the remaining spaces among each column equally, except the
d2a170
-            # last one. And put the rest into the remainder column
d2a170
-            cols -= 1
d2a170
-            norm = total_width / cols
d2a170
-            for d in xrange(0, cols):
d2a170
-                columns[d] += norm
d2a170
-            columns[remainder_column] += total_width - (cols * norm)
d2a170
-            total_width = 0
d2a170
-
d2a170
-        return columns
d2a170
-
d2a170
-    @staticmethod
d2a170
-    def _fmt_column_align_width(width):
d2a170
-        if width < 0:
d2a170
-            return (u"-", -width)
d2a170
-        return (u"", width)
d2a170
-
d2a170
-    @staticmethod
d2a170
-    def _calc_columns_spaces_helps(current, data_tups, left):
d2a170
-        """ Spaces left on the current field will help how many pkgs? """
d2a170
-        ret = 0
d2a170
-        for tup in data_tups:
d2a170
-            if left < (tup[0] - current):
d2a170
-                break
d2a170
-            ret += tup[1]
d2a170
-        return ret
d2a170
-
d2a170
     def _formatTransaction(self, tsInfo):
d2a170
-        """Return a string containing a human-readable formatted
d2a170
-        summary of the transaction.
d2a170
-        
d2a170
-        :param tsInfo: :class:`yum.transactioninfo.TransactionData`
d2a170
-           instance that contains information about the transaction
d2a170
-        :return: a string that contains a formatted summary of the
d2a170
-           transaction
d2a170
-           """
d2a170
-        # Sort the packages in the transaction into different lists,
d2a170
-        # e.g. installed, updated etc
d2a170
-        tsInfo.makelists(True, True)
d2a170
-
d2a170
-        # For each package list, pkglist_lines will contain a tuple
d2a170
-        # that contains the name of the list, and a list of tuples
d2a170
-        # with information about each package in the list
d2a170
-        pkglist_lines = []
d2a170
-        data  = {'n' : {}, 'v' : {}, 'r' : {}}
d2a170
-        a_wid = 0 # Arch can't get "that big" ... so always use the max.
d2a170
-
d2a170
-
d2a170
-        def _add_line(lines, data, a_wid, po, obsoletes=[]):
d2a170
-            # Create a tuple of strings that contain the name, arch,
d2a170
-            # version, repository, size, and obsoletes of the package
d2a170
-            # given in po.  Then, append this tuple to lines.  The
d2a170
-            # strings are formatted so that the tuple can be easily
d2a170
-            # joined together for output.
d2a170
-
d2a170
-            
d2a170
-            (n,a,e,v,r) = po.pkgtup
d2a170
-            
d2a170
-            # Retrieve the version, repo id, and size of the package
d2a170
-            # in human-readable form
d2a170
-            evr = po.printVer()
d2a170
-            repoid = po.ui_from_repo
d2a170
-            size = self._format_number(float(po.size))
d2a170
-
d2a170
-            if a is None: # gpgkeys are weird
d2a170
-                a = 'noarch'
d2a170
-
d2a170
-            lines.append((n, a, evr, repoid, size, obsoletes))
d2a170
-            #  Create a dict of field_length => number of packages, for
d2a170
-            # each field.
d2a170
-            for (d, v) in (("n",len(n)), ("v",len(evr)), ("r",len(repoid))):
d2a170
-                data[d].setdefault(v, 0)
d2a170
-                data[d][v] += 1
d2a170
-            a_wid = max(a_wid, len(a))
d2a170
-
d2a170
-            return a_wid
d2a170
-
d2a170
-        ninstalled = self.tsInfo.installed
d2a170
-        ginstalled = {}
d2a170
-        if self.conf.group_command == 'objects' and ninstalled:
d2a170
-            # Show new pkgs. that are installed via. a group.
d2a170
-            ninstalled = []
d2a170
-            for txmbr in self.tsInfo.installed:
d2a170
-                if not hasattr(txmbr, '_ugroup_member'):
d2a170
-                    ninstalled.append(txmbr)
d2a170
-                    continue
d2a170
-                if txmbr._ugroup_member not in ginstalled:
d2a170
-                    ginstalled[txmbr._ugroup_member] = []
d2a170
-                ginstalled[txmbr._ugroup_member].append(txmbr)
d2a170
-
d2a170
-        for grp in sorted(ginstalled, key=lambda x: x.ui_name):
d2a170
-            action = _('Installing for group upgrade "%s"') % grp.ui_name
d2a170
-            pkglist = ginstalled[grp]
d2a170
-
d2a170
-            lines = []
d2a170
-            for txmbr in pkglist:
d2a170
-                a_wid = _add_line(lines, data, a_wid, txmbr.po, txmbr.obsoletes)
d2a170
-
d2a170
-            pkglist_lines.append((action, lines))        
d2a170
-
d2a170
-        # Iterate through the different groups of packages
d2a170
-        for (action, pkglist) in [(_('Installing'), ninstalled),
d2a170
-                            (_('Updating'), tsInfo.updated),
d2a170
-                            (_('Removing'), tsInfo.removed),
d2a170
-                            (_('Reinstalling'), tsInfo.reinstalled),
d2a170
-                            (_('Downgrading'), tsInfo.downgraded),
d2a170
-                            (_('Installing for dependencies'), tsInfo.depinstalled),
d2a170
-                            (_('Updating for dependencies'), tsInfo.depupdated),
d2a170
-                            (_('Removing for dependencies'), tsInfo.depremoved)]:
d2a170
-            # Create a list to hold the tuples of strings for each package
d2a170
-            lines = []
d2a170
-
d2a170
-            # Append the tuple for each package to lines, and update a_wid
d2a170
-            for txmbr in pkglist:
d2a170
-                a_wid = _add_line(lines, data, a_wid, txmbr.po, txmbr.obsoletes)
d2a170
-
d2a170
-            # Append the lines instance for this package list to pkglist_lines
d2a170
-            pkglist_lines.append((action, lines))
d2a170
-
d2a170
-        # # Iterate through other package lists
d2a170
-        # for (action, pkglist) in [(_('Skipped (dependency problems)'),
d2a170
-        #                            self.skipped_packages),
d2a170
-        #                           (_('Not installed'), self._not_found_i.values()),
d2a170
-        #                           (_('Not available'), self._not_found_a.values())]:
d2a170
-        #     lines = []
d2a170
-        #     for po in pkglist:
d2a170
-        #         a_wid = _add_line(lines, data, a_wid, po)
d2a170
-
d2a170
-        #     pkglist_lines.append((action, lines))
d2a170
-
d2a170
-        if not data['n']:
d2a170
-            return u''
d2a170
-        else:
d2a170
-            # Change data to a list with the correct number of
d2a170
-            # columns, in the correct order
d2a170
-            data    = [data['n'],    {}, data['v'], data['r'], {}]
d2a170
-
d2a170
-            
d2a170
-             
d2a170
-            # Calculate the space needed for each column
d2a170
-            columns = [1,         a_wid,         1,         1,  5]
d2a170
-
d2a170
-            columns = self._calcColumns(data, self.opts.output_width,
d2a170
-                                        columns, remainder_column = 2, indent="  ")
d2a170
-
d2a170
-            (n_wid, a_wid, v_wid, r_wid, s_wid) = columns
d2a170
-            assert s_wid == 5
d2a170
-
d2a170
-            # out will contain the output as a list of strings, that
d2a170
-            # can be later joined together
d2a170
-            out = [u"""
d2a170
-%s
d2a170
-%s
d2a170
-%s
d2a170
-""" % ('=' * self.opts.output_width,
d2a170
-       self._fmtColumns(((_('Package'), -n_wid), (_('Arch'), -a_wid),
d2a170
-                        (_('Version'), -v_wid), (_('Repository'), -r_wid),
d2a170
-                        (_('Size'), s_wid)), u" "),
d2a170
-       '=' * self.opts.output_width)]
d2a170
-
d2a170
-        # Add output for each package list in pkglist_lines
d2a170
-        for (action, lines) in pkglist_lines:
d2a170
-            #If the package list is empty, skip it
d2a170
-            if not lines:
d2a170
-                continue
d2a170
-
d2a170
-            # Add the name of the package list
d2a170
-            totalmsg = u"%s:\n" % action
d2a170
-            # Add a line of output about an individual package
d2a170
-            for (n, a, evr, repoid, size, obsoletes) in lines:
d2a170
-                columns = ((n,   -n_wid), (a,      -a_wid),
d2a170
-                           (evr, -v_wid), (repoid, -r_wid), (size, s_wid))
d2a170
-                msg = self._fmtColumns(columns, u" ", u"\n")
d2a170
-                for obspo in sorted(obsoletes):
d2a170
-                    appended = _('     replacing  %s.%s %s\n')
d2a170
-                    appended %= (obspo.name,
d2a170
-                                 obspo.arch, obspo.printVer())
d2a170
-                    msg = msg+appended
d2a170
-                totalmsg = totalmsg + msg
d2a170
-
d2a170
-            # Append the line about the individual package to out
d2a170
-            out.append(totalmsg)
d2a170
-
d2a170
-        # Add a summary of the transaction
d2a170
-        out.append(_("""
d2a170
-Transaction Summary
d2a170
-%s
d2a170
-""") % ('=' * self.opts.output_width))
d2a170
-        summary_data =  (
d2a170
-            (_('Install'), len(tsInfo.installed),
d2a170
-             len(tsInfo.depinstalled)),
d2a170
-            (_('Upgrade'), len(tsInfo.updated),
d2a170
-             len(tsInfo.depupdated)),
d2a170
-            (_('Remove'), len(tsInfo.removed),
d2a170
-             len(tsInfo.depremoved)),
d2a170
-            (_('Reinstall'), len(tsInfo.reinstalled), 0),
d2a170
-            (_('Downgrade'), len(tsInfo.downgraded), 0),
d2a170
-            # (_('Skipped (dependency problems)'), len(self.skipped_packages), 0),
d2a170
-            # (_('Not installed'), len(self._not_found_i.values()), 0),
d2a170
-            # (_('Not available'), len(self._not_found_a.values()), 0),
d2a170
-        )
d2a170
-        max_msg_action   = 0
d2a170
-        max_msg_count    = 0
d2a170
-        max_msg_pkgs     = 0
d2a170
-        max_msg_depcount = 0
d2a170
-        for action, count, depcount in summary_data:
d2a170
-            if not count and not depcount:
d2a170
-                continue
d2a170
-
d2a170
-            msg_pkgs = P_('Package', 'Packages', count)
d2a170
-            len_msg_action   = utf8_width(action)
d2a170
-            len_msg_count    = utf8_width(str(count))
d2a170
-            len_msg_pkgs     = utf8_width(msg_pkgs)
d2a170
-
d2a170
-            if depcount:
d2a170
-                len_msg_depcount = utf8_width(str(depcount))
d2a170
-            else:
d2a170
-                len_msg_depcount = 0
d2a170
-
d2a170
-            max_msg_action   = max(len_msg_action,   max_msg_action)
d2a170
-            max_msg_count    = max(len_msg_count,    max_msg_count)
d2a170
-            max_msg_pkgs     = max(len_msg_pkgs,     max_msg_pkgs)
d2a170
-            max_msg_depcount = max(len_msg_depcount, max_msg_depcount)
d2a170
-
d2a170
-        for action, count, depcount in summary_data:
d2a170
-            msg_pkgs = P_('Package', 'Packages', count)
d2a170
-            if depcount:
d2a170
-                msg_deppkgs = P_('Dependent package', 'Dependent packages',
d2a170
-                                 depcount)
d2a170
-                if count:
d2a170
-                    msg = '%s  %*d %s (+%*d %s)\n'
d2a170
-                    out.append(msg % (utf8_width_fill(action, max_msg_action),
d2a170
-                                      max_msg_count, count,
d2a170
-                                      utf8_width_fill(msg_pkgs, max_msg_pkgs),
d2a170
-                                      max_msg_depcount, depcount, msg_deppkgs))
d2a170
-                else:
d2a170
-                    msg = '%s  %*s %s ( %*d %s)\n'
d2a170
-                    out.append(msg % (utf8_width_fill(action, max_msg_action),
d2a170
-                                      max_msg_count, '',
d2a170
-                                      utf8_width_fill('', max_msg_pkgs),
d2a170
-                                      max_msg_depcount, depcount, msg_deppkgs))
d2a170
-            elif count:
d2a170
-                msg = '%s  %*d %s\n'
d2a170
-                out.append(msg % (utf8_width_fill(action, max_msg_action),
d2a170
-                                  max_msg_count, count, msg_pkgs))
d2a170
-
d2a170
-        return ''.join(out)
d2a170
+        assert self.opts._base.tsInfo == tsInfo
d2a170
+        return self.opts._base.listTransaction()
d2a170
 
d2a170
 
d2a170
 class EmailEmitter(UpdateEmitter):
d2a170
@@ -738,7 +301,7 @@ class YumCronConfig(BaseConfig):
d2a170
     group_package_types = ListOption(['mandatory', 'default'])
d2a170
 
d2a170
 
d2a170
-class YumCronBase(yum.YumBase):
d2a170
+class YumCronBase(yum.YumBase, YumOutput):
d2a170
     """Main class to check for and apply the updates."""
d2a170
 
d2a170
     def __init__(self, config_file_name = None):
d2a170
@@ -748,9 +311,13 @@ class YumCronBase(yum.YumBase):
d2a170
            config file to use.
d2a170
         """
d2a170
         yum.YumBase.__init__(self)
d2a170
+        YumOutput.__init__(self)
d2a170
 
d2a170
         # Read the config file
d2a170
         self.readConfigFile(config_file_name)
d2a170
+        self.term.reinit(color='never')
d2a170
+        self.term.columns = self.opts.output_width
d2a170
+        self.opts._base = self
d2a170
 
d2a170
 
d2a170
         # Create the emitters, and add them to the list
d2a170
commit 1f4b4a800516ec56215a4bed36293f62b77e1239
d2a170
Author: Zdenek Pavlas <zpavlas@redhat.com>
d2a170
Date:   Fri Dec 13 10:11:34 2013 +0100
d2a170
d2a170
    yum-cron: remove _formatTransaction()
d2a170
    
d2a170
    By moving the formatting out of emitters, we loose a bit of flexibility,
d2a170
    but at least run the formatting only once, and don't have to pass YumBase
d2a170
    references to emitters.
d2a170
d2a170
diff --git a/yum-cron/yum-cron.py b/yum-cron/yum-cron.py
d2a170
index 5661fbb..a1fd10b 100755
d2a170
--- a/yum-cron/yum-cron.py
d2a170
+++ b/yum-cron/yum-cron.py
d2a170
@@ -37,25 +37,23 @@ class UpdateEmitter(object):
d2a170
         self.opts  = opts
d2a170
         self.output = []
d2a170
 
d2a170
-    def updatesAvailable(self, tsInfo):
d2a170
+    def updatesAvailable(self, summary):
d2a170
         """Appends a message to the output list stating that there are
d2a170
         updates available.
d2a170
 
d2a170
-        :param tsInfo: A :class:`yum.transactioninfo.TransactionData`
d2a170
-           instance that contains information about the transaction.
d2a170
+        :param summary: A human-readable summary of the transaction.
d2a170
         """
d2a170
         self.output.append('The following updates are available on %s:' % self.opts.system_name)
d2a170
-        self.output.append(self._formatTransaction(tsInfo))
d2a170
+        self.output.append(summary)
d2a170
 
d2a170
-    def updatesDownloading(self, tsInfo):
d2a170
+    def updatesDownloading(self, summary):
d2a170
         """Append a message to the output list stating that
d2a170
         downloading updates has started.
d2a170
 
d2a170
-        :param tsInfo: A :class:`yum.transactioninfo.TransactionData`
d2a170
-           instance that contains information about the transaction.
d2a170
+        :param summary: A human-readable summary of the transaction.
d2a170
         """
d2a170
         self.output.append('The following updates will be downloaded on %s:' % self.opts.system_name)
d2a170
-        self.output.append(self._formatTransaction(tsInfo))
d2a170
+        self.output.append(summary)
d2a170
 
d2a170
     def updatesDownloaded(self):
d2a170
         """Append a message to the output list stating that updates
d2a170
@@ -63,15 +61,14 @@ class UpdateEmitter(object):
d2a170
         """
d2a170
         self.output.append("Updates downloaded successfully.")
d2a170
 
d2a170
-    def updatesInstalling(self, tsInfo):
d2a170
+    def updatesInstalling(self, summary):
d2a170
         """Append a message to the output list stating that
d2a170
         installing updates has started.
d2a170
 
d2a170
-        :param tsInfo: A :class:`yum.transactioninfo.TransactionData`
d2a170
-           instance that contains information about the transaction.
d2a170
+        :param summary: A human-readable summary of the transaction.
d2a170
         """
d2a170
         self.output.append('The following updates will be applied on %s:' % self.opts.system_name)
d2a170
-        self.output.append(self._formatTransaction(tsInfo))
d2a170
+        self.output.append(summary)
d2a170
 
d2a170
     def updatesInstalled(self):
d2a170
         """Append a message to the output list stating that updates
d2a170
@@ -156,10 +153,6 @@ class UpdateEmitter(object):
d2a170
         """
d2a170
         pass
d2a170
 
d2a170
-    def _formatTransaction(self, tsInfo):
d2a170
-        assert self.opts._base.tsInfo == tsInfo
d2a170
-        return self.opts._base.listTransaction()
d2a170
-
d2a170
 
d2a170
 class EmailEmitter(UpdateEmitter):
d2a170
     """Emitter class to send messages via email."""
d2a170
@@ -168,14 +161,13 @@ class EmailEmitter(UpdateEmitter):
d2a170
         super(EmailEmitter, self).__init__(opts)        
d2a170
         self.subject = ""
d2a170
 
d2a170
-    def updatesAvailable(self, tsInfo):
d2a170
+    def updatesAvailable(self, summary):
d2a170
         """Appends a message to the output list stating that there are
d2a170
         updates available, and set an appropriate subject line.
d2a170
 
d2a170
-        :param tsInfo: A :class:`yum.transactioninfo.TransactionData`
d2a170
-           instance that contains information about the transaction.
d2a170
+        :param summary: A human-readable summary of the transaction.
d2a170
         """
d2a170
-        super(EmailEmitter, self).updatesAvailable(tsInfo)
d2a170
+        super(EmailEmitter, self).updatesAvailable(summary)
d2a170
         self.subject = "Yum: Updates Available on %s" % self.opts.system_name
d2a170
 
d2a170
     def updatesDownloaded(self):
d2a170
@@ -317,7 +309,6 @@ class YumCronBase(yum.YumBase, YumOutput):
d2a170
         self.readConfigFile(config_file_name)
d2a170
         self.term.reinit(color='never')
d2a170
         self.term.columns = self.opts.output_width
d2a170
-        self.opts._base = self
d2a170
 
d2a170
 
d2a170
         # Create the emitters, and add them to the list
d2a170
@@ -655,11 +646,13 @@ class YumCronBase(yum.YumBase, YumOutput):
d2a170
 
d2a170
     def emitAvailable(self):
d2a170
         """Emit a notice stating whether updates are available."""
d2a170
-        map(lambda x: x.updatesAvailable(self.tsInfo), self.emitters)
d2a170
+        summary = self.listTransaction()
d2a170
+        map(lambda x: x.updatesAvailable(summary), self.emitters)
d2a170
 
d2a170
     def emitDownloading(self):
d2a170
         """Emit a notice stating that updates are downloading."""
d2a170
-        map(lambda x: x.updatesDownloading(self.tsInfo), self.emitters)
d2a170
+        summary = self.listTransaction()
d2a170
+        map(lambda x: x.updatesDownloading(summary), self.emitters)
d2a170
 
d2a170
     def emitDownloaded(self):
d2a170
         """Emit a notice stating that updates have downloaded."""
d2a170
@@ -669,7 +662,8 @@ class YumCronBase(yum.YumBase, YumOutput):
d2a170
         """Emit a notice stating that automatic updates are about to
d2a170
         be applied.
d2a170
         """
d2a170
-        map(lambda x: x.updatesInstalling(self.tsInfo), self.emitters)
d2a170
+        summary = self.listTransaction()
d2a170
+        map(lambda x: x.updatesInstalling(summary), self.emitters)
d2a170
 
d2a170
     def emitInstalled(self):
d2a170
         """Emit a notice stating that automatic updates have been applied."""
d2a170
commit f8579cb9c08f5ea962f555d1610bb58449139ed2
d2a170
Author: Zdenek Pavlas <zpavlas@redhat.com>
d2a170
Date:   Mon Dec 23 15:29:51 2013 +0100
d2a170
d2a170
    Skip unavailable repos. BZ 1046076
d2a170
    
d2a170
    By populating all repos at once we honor skip_if_unavailable,
d2a170
    and also download metadata in parallel (although this does not
d2a170
    matter that much since yum-cron is not interactive).
d2a170
d2a170
diff --git a/yum-cron/yum-cron.py b/yum-cron/yum-cron.py
d2a170
index 19436e5..b96dd13 100755
d2a170
--- a/yum-cron/yum-cron.py
d2a170
+++ b/yum-cron/yum-cron.py
d2a170
@@ -414,7 +414,9 @@ class YumCronBase(yum.YumBase, YumOutput):
d2a170
 
d2a170
         for repo in self.repos.sort():
d2a170
             repo.metadata_expire = 0
d2a170
+            repo.skip_if_unavailable = True
d2a170
 
d2a170
+        self.pkgSack # honor skip_if_unavailable
d2a170
         self.upinfo
d2a170
 
d2a170
     def refreshUpdates(self):
d2a170
commit a00fcf5e9ce765fd6aba2db327bfb072f23ac465
d2a170
Author: Jonathan Wakely <fedoration@kayari.org>
d2a170
Date:   Sun Dec 22 11:39:49 2013 +0000
d2a170
d2a170
    docs: yum.conf.5: Fix typo.
d2a170
d2a170
diff --git a/docs/yum.conf.5 b/docs/yum.conf.5
d2a170
index 48ced00..c66eba8 100644
d2a170
--- a/docs/yum.conf.5
d2a170
+++ b/docs/yum.conf.5
d2a170
@@ -148,7 +148,7 @@ Command-line option: \fB\-t\fP
d2a170
 .IP
d2a170
 \fBexclude\fR
d2a170
 List of packages to exclude from all repositories, so yum works
d2a170
-as if that package was never in the repositories.. This should be a space
d2a170
+as if that package was never in the repositories. This should be a space
d2a170
 separated list.
d2a170
 This is commonly used so a package isn't upgraded or installed accidentally, but
d2a170
 can be used to remove packages in any way that "yum list" will show packages.
d2a170
commit c26740594afdf86c503c3406f1370dbb6ad0608b
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Thu Jan 2 10:57:08 2014 -0500
d2a170
d2a170
    docs: Update --downloadonly section of man page.
d2a170
d2a170
diff --git a/docs/yum.8 b/docs/yum.8
d2a170
index 0e211eb..f7d6ec3 100644
d2a170
--- a/docs/yum.8
d2a170
+++ b/docs/yum.8
d2a170
@@ -871,7 +871,8 @@ This option makes yum go slower, checking for things that shouldn't be possible
d2a170
 making it more tolerant of external errors.
d2a170
 .br
d2a170
 .IP "\fB\-\-downloadonly\fP"
d2a170
-Don't update, just download.
d2a170
+Don't update, just download. This is done in the background, so the yum lock is released for other operations. This can also be chosen by typing 'd'ownloadonly
d2a170
+at the transaction confirmation prompt.
d2a170
 .br
d2a170
 .IP "\fB\-\-downloaddir=directory\fP"
d2a170
 Specifies an alternate directory to store packages.
d2a170
commit 6ddb350b207cfa54d96232c23606444cd0b79341
d2a170
Author: Zdenek Pavlas <zpavlas@redhat.com>
d2a170
Date:   Mon Jan 13 16:12:33 2014 +0100
d2a170
d2a170
    yum-cron: Enable random_sleep by default.
d2a170
d2a170
diff --git a/etc/yum-cron-hourly.conf b/etc/yum-cron-hourly.conf
d2a170
index 2d52349..7871a46 100644
d2a170
--- a/etc/yum-cron-hourly.conf
d2a170
+++ b/etc/yum-cron-hourly.conf
d2a170
@@ -25,7 +25,7 @@ apply_updates = no
d2a170
 # minutes before running.  This is useful for e.g. staggering the
d2a170
 # times that multiple systems will access update servers.  If
d2a170
 # random_sleep is 0 or negative, the program will run immediately.
d2a170
-random_sleep = 0
d2a170
+random_sleep = 15
d2a170
 
d2a170
 
d2a170
 [emitters]
d2a170
diff --git a/etc/yum-cron.conf b/etc/yum-cron.conf
d2a170
index a97d881..f8de068 100644
d2a170
--- a/etc/yum-cron.conf
d2a170
+++ b/etc/yum-cron.conf
d2a170
@@ -24,7 +24,7 @@ apply_updates = no
d2a170
 # minutes before running.  This is useful for e.g. staggering the
d2a170
 # times that multiple systems will access update servers.  If
d2a170
 # random_sleep is 0 or negative, the program will run immediately.
d2a170
-random_sleep = 0
d2a170
+random_sleep = 6*60
d2a170
 
d2a170
 
d2a170
 [emitters]
d2a170
commit 2715047a195b29d6ac7d985166b985954267a0bb
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Tue Jan 14 15:29:03 2014 -0500
d2a170
d2a170
    Fix yum-cron.conf default, as ini parser can't do Math.
d2a170
d2a170
diff --git a/etc/yum-cron.conf b/etc/yum-cron.conf
d2a170
index f8de068..b0f7839 100644
d2a170
--- a/etc/yum-cron.conf
d2a170
+++ b/etc/yum-cron.conf
d2a170
@@ -24,7 +24,8 @@ apply_updates = no
d2a170
 # minutes before running.  This is useful for e.g. staggering the
d2a170
 # times that multiple systems will access update servers.  If
d2a170
 # random_sleep is 0 or negative, the program will run immediately.
d2a170
-random_sleep = 6*60
d2a170
+# 6*60 = 360
d2a170
+random_sleep = 360
d2a170
 
d2a170
 
d2a170
 [emitters]