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