[yum] docs only: group_command=objects is the distro default.
Zdeněk Pavlas
zpavlas at fedoraproject.org
Wed Dec 4 15:52:03 UTC 2013
commit ff8cbe8888dc5199b566a664bdd93e0105820e25
Author: Zdenek Pavlas <zpavlas at redhat.com>
Date: Wed Dec 4 16:51:52 2013 +0100
docs only: group_command=objects is the distro default.
- Parse float timestamps as valid, for global timestamp.
- Add check_config_file_age, so we can turn that off for rhsm repos. BZ 103544
- Better doc. comment for re_primary_filename().
yum-HEAD.patch | 236 ++++++++++++++++++++++++++++++++++---------------------
yum.spec | 7 +-
2 files changed, 151 insertions(+), 92 deletions(-)
---
diff --git a/yum-HEAD.patch b/yum-HEAD.patch
index 83b6f86..93e91b1 100644
--- a/yum-HEAD.patch
+++ b/yum-HEAD.patch
@@ -3477,7 +3477,7 @@ index 1a8202a..0914765 100644
http://yum.baseurl.org/wiki/Faq
yum search yum
diff --git a/docs/yum.conf.5 b/docs/yum.conf.5
-index 515aa73..4e79298 100644
+index 515aa73..da13dc8 100644
--- a/docs/yum.conf.5
+++ b/docs/yum.conf.5
@@ -64,7 +64,7 @@ options are: 'critical', 'emergency', 'error', 'warn' and 'debug'.
@@ -3638,9 +3638,22 @@ index 515aa73..4e79298 100644
\fBinstallroot \fR
Specifies an alternative installroot, relative to which all packages will be
installed.
-@@ -223,14 +291,21 @@ Command-line option: \fB\-\-installroot\fP
+@@ -222,15 +290,34 @@ installed.
+ Command-line option: \fB\-\-installroot\fP
.IP
++\fBconfig_file_path \fR
++Specifies the path to main the configuration file.
++Default is /etc/yum/yum.conf.
++
++.IP
++\fBcheck_config_file_age \fR
++Either `0' or `1'. Specifies whether yum should auto metadata expire repos.
++that are older than any of the configuration files that led to them (usually
++the yum.conf file and the foo.repo file).
++Default is `1' (perform the check).
++
++.IP
\fBdistroverpkg\fR
-The package used by yum to determine the "version" of the distribution. This
-can be any installed package. Default is `redhat-release'. You can see what
@@ -3664,7 +3677,7 @@ index 515aa73..4e79298 100644
.IP
\fBtsflags\fR
-@@ -291,6 +366,16 @@ the maximum available bandwidth.
+@@ -291,6 +378,16 @@ the maximum available bandwidth.
Set to `0' to disable bandwidth throttling. This is the default.
@@ -3681,7 +3694,7 @@ index 515aa73..4e79298 100644
.IP
\fBbandwidth \fR
Use to specify the maximum available network bandwidth in bytes/second. Used
-@@ -300,6 +385,50 @@ with the \fBthrottle\fR option (above). If \fBthrottle\fR is a percentage and
+@@ -300,6 +397,50 @@ with the \fBthrottle\fR option (above). If \fBthrottle\fR is a percentage and
ignored. Default is `0' (no bandwidth throttling).
.IP
@@ -3732,7 +3745,7 @@ index 515aa73..4e79298 100644
\fBsslcacert \fR
Path to the directory containing the databases of the certificate authorities
yum should use to verify SSL certificates. Defaults to none - uses system
-@@ -331,6 +460,15 @@ Path to the SSL client key yum should use to connect to repos/remote sites
+@@ -331,6 +472,15 @@ Path to the SSL client key yum should use to connect to repos/remote sites
Defaults to none.
.IP
@@ -3748,7 +3761,7 @@ index 515aa73..4e79298 100644
\fBhistory_record \fR
Boolean - should yum record history entries for transactions. This takes some
disk space, and some extra time in the transactions. But it allows how to know a
-@@ -391,7 +529,9 @@ syslog logging is disabled. Default is `/dev/log'.
+@@ -391,7 +541,9 @@ syslog logging is disabled. Default is `/dev/log'.
.IP
\fBproxy \fR
@@ -3759,7 +3772,7 @@ index 515aa73..4e79298 100644
.IP
\fBproxy_username \fR
-@@ -438,6 +578,31 @@ It's also possible to use the word "never", meaning that the metadata will
+@@ -438,6 +590,31 @@ It's also possible to use the word "never", meaning that the metadata will
never expire. Note that when using a metalink file the metalink must always
be newer than the metadata for the repository, due to the validation, so this
timeout also applies to the metalink file.
@@ -3791,7 +3804,7 @@ index 515aa73..4e79298 100644
.IP
\fBmirrorlist_expire \fR
-@@ -462,12 +627,12 @@ always did, however it now does some checking on the index and reverts if
+@@ -462,12 +639,12 @@ always did, however it now does some checking on the index and reverts if
it classifies it as bad.
`group:primary' - Download the primary metadata with the index. This contains
@@ -3809,7 +3822,7 @@ index 515aa73..4e79298 100644
`group:main' - With the primary and updateinfo download the filelists metadata
and the group metadata. The filelists data is required for operations like
-@@ -480,6 +645,19 @@ not listed above is the other metadata, which contains the changelog information
+@@ -480,6 +657,19 @@ not listed above is the other metadata, which contains the changelog information
which is used by yum-changelog. This is what "yum makecache" uses.
.IP
@@ -3829,7 +3842,7 @@ index 515aa73..4e79298 100644
\fBmultilib_policy \fR
Can be set to 'all' or 'best'. All means install all possible arches for any package you
want to install. Therefore yum install foo will install foo.i386 and foo.x86_64 on x86_64,
-@@ -523,6 +701,13 @@ Default is `normal'.
+@@ -523,6 +713,13 @@ Default is `normal'.
See color_list_installed_older for possible values.
.IP
@@ -3843,7 +3856,7 @@ index 515aa73..4e79298 100644
\fBcolor_list_installed_extra \fR
The colorization/highlighting for packages in list/info installed which has
no available package with the same name and arch.
-@@ -558,6 +743,13 @@ Default is `bold,underline,green.
+@@ -558,6 +755,13 @@ Default is `bold,underline,green.
See color_list_installed_older for possible values.
.IP
@@ -3857,7 +3870,7 @@ index 515aa73..4e79298 100644
\fBcolor_search_match \fR
The colorization/highlighting for text matches in search.
Default is `bold'.
-@@ -587,14 +779,98 @@ be downloaded. The updates list is what is printed when you run "yum update",
+@@ -587,14 +791,98 @@ be downloaded. The updates list is what is printed when you run "yum update",
Default is `normal'.
See color_list_installed_older for possible values.
@@ -3879,15 +3892,15 @@ index 515aa73..4e79298 100644
+\fBupgrade_requirements_on_install \fR
+When installing/reinstalling/upgrading packages go through each package's
+installed dependencies and check for an update.
-+Boolean (1, 0, True, False, yes,no) Defaults to False
-+
+ Boolean (1, 0, True, False, yes,no) Defaults to False
+
+.IP
+\fBrecheck_installed_requires \fR
+When upgrading a package do we recheck any requirements that existed in the old
+package. Turning this on shouldn't do anything but slow yum depsolving down,
+however using rpm --nodeps etc. can break the rpmdb and then this will help.
- Boolean (1, 0, True, False, yes,no) Defaults to False
-
++Boolean (1, 0, True, False, yes,no) Defaults to False
++
+.IP
+\fBreset_nice \fR
+If set to true then yum will try to reset the nice value to zero, before
@@ -3956,7 +3969,7 @@ index 515aa73..4e79298 100644
.SH "[repository] OPTIONS"
-@@ -668,6 +944,10 @@ value of mirrorlist is copied to metalink (if metalink is not set).
+@@ -668,6 +956,10 @@ value of mirrorlist is copied to metalink (if metalink is not set).
Either `1' or `0'. This tells yum whether or not use this repository.
.IP
@@ -3967,7 +3980,7 @@ index 515aa73..4e79298 100644
\fBgpgcheck\fR
Either `1' or `0'. This tells yum whether or not it should perform a GPG
signature check on the packages gotten from this repository.
-@@ -702,12 +982,18 @@ key will be automatically imported without user confirmation.
+@@ -702,12 +994,18 @@ key will be automatically imported without user confirmation.
Same as the [main] \fBexclude\fR option but only for this repository.
Substitution variables, described below, are honored here.
@@ -3990,7 +4003,7 @@ index 515aa73..4e79298 100644
.IP
\fBenablegroups\fR
-@@ -755,6 +1041,20 @@ repository.
+@@ -755,6 +1053,20 @@ repository.
Overrides the \fBbandwidth\fR option from the [main] section for this
repository.
@@ -4011,7 +4024,7 @@ index 515aa73..4e79298 100644
.IP
\fBsslcacert \fR
-@@ -776,6 +1076,10 @@ repository.
+@@ -776,6 +1088,10 @@ repository.
Overrides the \fBsslclientkey\fR option from the [main] section for this
repository.
@@ -4022,7 +4035,7 @@ index 515aa73..4e79298 100644
.IP
\fBmetadata_expire \fR
-@@ -783,6 +1087,11 @@ Overrides the \fBmetadata_expire\fR option from the [main] section for this
+@@ -783,6 +1099,11 @@ Overrides the \fBmetadata_expire\fR option from the [main] section for this
repository.
.IP
@@ -4034,7 +4047,7 @@ index 515aa73..4e79298 100644
\fBmirrorlist_expire \fR
Overrides the \fBmirrorlist_expire\fR option from the [main] section for this
repository.
-@@ -824,7 +1133,16 @@ as greater/less than any other. defaults to 1000
+@@ -824,7 +1145,16 @@ as greater/less than any other. defaults to 1000
If set to True yum will continue running if this repository cannot be
contacted for any reason. This should be set carefully as all repos are consulted
for any given command. Defaults to False.
@@ -4051,7 +4064,7 @@ index 515aa73..4e79298 100644
.SH "URL INCLUDE SYNTAX"
.LP
-@@ -861,8 +1179,8 @@ package.
+@@ -861,8 +1191,8 @@ package.
.IP
\fB$arch\fR
@@ -191891,7 +191904,7 @@ index 65f6d5e..706e2a4 100755
print >> sys.stderr, "newcomps.py: No such file:\'%s\'" % sys.argv[1]
sys.exit(1)
diff --git a/yum/config.py b/yum/config.py
-index d09511f..ea6c1ac 100644
+index d09511f..c38d574 100644
--- a/yum/config.py
+++ b/yum/config.py
@@ -38,6 +38,7 @@ if not _use_iniparse:
@@ -192375,11 +192388,11 @@ index d09511f..ea6c1ac 100644
- Invalid inputs: -10, -0.1, 45.6L, 123Mb
-
- Return value will always be an integer
+-
+- 1k = 1024 bytes.
+ Valid inputs: 100, 123M, 45.6k, 12.4G, 100K, 786.3, 0.
+ Invalid inputs: -10, -0.1, 45.6L, 123Mb.
-- 1k = 1024 bytes.
--
- ValueError will be raised if the option couldn't be parsed.
+ :param s: the string to parse
+ :return: the number of bytes represented by *s*
@@ -192733,7 +192746,7 @@ index d09511f..ea6c1ac 100644
history_record = BoolOption(True)
history_record_packages = ListOption(['yum', 'rpm'])
-@@ -744,18 +875,41 @@ class YumConf(StartupConf):
+@@ -744,18 +875,43 @@ class YumConf(StartupConf):
loadts_ignoremissing = BoolOption(False)
loadts_ignorerpm = BoolOption(False)
@@ -192763,6 +192776,8 @@ index d09511f..ea6c1ac 100644
+
+ autocheck_running_kernel = BoolOption(True)
+
++ check_config_file_age = BoolOption(True)
++
_reposlist = []
def dump(self):
@@ -192775,7 +192790,7 @@ index d09511f..ea6c1ac 100644
output = '[main]\n'
# we exclude all vars which start with _ or are in this list:
excluded_vars = ('cfg', 'uid', 'yumvar', 'progress_obj', 'failure_obj',
-@@ -778,14 +932,12 @@ class YumConf(StartupConf):
+@@ -778,14 +934,12 @@ class YumConf(StartupConf):
return output
class RepoConf(BaseConfig):
@@ -192793,7 +192808,7 @@ index d09511f..ea6c1ac 100644
ck = self.__cached_keys
if not isinstance(self, RepoConf):
ck = set()
-@@ -797,6 +949,7 @@ class RepoConf(BaseConfig):
+@@ -797,6 +951,7 @@ class RepoConf(BaseConfig):
name = Option()
enabled = Inherit(YumConf.enabled)
@@ -192801,7 +192816,7 @@ index d09511f..ea6c1ac 100644
baseurl = UrlListOption()
mirrorlist = UrlOption()
metalink = UrlOption()
-@@ -820,42 +973,57 @@ class RepoConf(BaseConfig):
+@@ -820,42 +975,60 @@ class RepoConf(BaseConfig):
keepalive = Inherit(YumConf.keepalive)
enablegroups = Inherit(YumConf.enablegroups)
@@ -192837,6 +192852,9 @@ index d09511f..ea6c1ac 100644
+ async = BoolOption(True)
+
+ ui_repoid_vars = Inherit(YumConf.ui_repoid_vars)
++
++ check_config_file_age = Inherit(YumConf.check_config_file_age)
++
class VersionGroupConf(BaseConfig):
+ """Option definitions for version groups."""
@@ -192870,7 +192888,7 @@ index d09511f..ea6c1ac 100644
# ' xemacs syntax hack
-@@ -876,20 +1044,24 @@ def readStartupConfig(configfile, root):
+@@ -876,20 +1049,24 @@ def readStartupConfig(configfile, root):
raise Errors.ConfigError("All plugin search paths must be absolute")
# Stuff this here to avoid later re-parsing
startupconf._parser = parser
@@ -192901,7 +192919,7 @@ index d09511f..ea6c1ac 100644
# ' xemacs syntax hack
-@@ -956,6 +1128,12 @@ def readMainConfig(startupconf):
+@@ -956,6 +1133,12 @@ def readMainConfig(startupconf):
return yumconf
def readVersionGroupsConfig(configfile="/etc/yum/version-groups.conf"):
@@ -192914,7 +192932,7 @@ index d09511f..ea6c1ac 100644
parser = ConfigParser()
confpp_obj = ConfigPreProcessor(configfile)
try:
-@@ -970,17 +1148,16 @@ def readVersionGroupsConfig(configfile="/etc/yum/version-groups.conf"):
+@@ -970,17 +1153,16 @@ def readVersionGroupsConfig(configfile="/etc/yum/version-groups.conf"):
def getOption(conf, section, name, option):
@@ -192942,7 +192960,7 @@ index d09511f..ea6c1ac 100644
try:
val = conf.get(section, name)
except (NoSectionError, NoOptionError):
-@@ -1010,7 +1187,10 @@ def _getsysver(installroot, distroverpkg):
+@@ -1010,7 +1192,10 @@ def _getsysver(installroot, distroverpkg):
ts = rpmUtils.transaction.initReadOnlyTransaction(root=installroot)
ts.pushVSFlags(~(rpm._RPMVSF_NOSIGNATURES|rpm._RPMVSF_NODIGESTS))
try:
@@ -192954,7 +192972,7 @@ index d09511f..ea6c1ac 100644
except TypeError, e:
# This is code for "cannot open rpmdb"
# this is for pep 352 compliance on python 2.6 and above :(
-@@ -1028,25 +1208,44 @@ def _getsysver(installroot, distroverpkg):
+@@ -1028,25 +1213,44 @@ def _getsysver(installroot, distroverpkg):
if idx.count() == 0:
releasever = '$releasever'
else:
@@ -193010,7 +193028,7 @@ index d09511f..ea6c1ac 100644
# b/c repoids can have $values in them we need to map both ways to figure
# out which one is which
section_id = repo.id
-@@ -1054,6 +1253,22 @@ def writeRawRepoFile(repo,only=None):
+@@ -1054,6 +1258,22 @@ def writeRawRepoFile(repo,only=None):
for sect in ini._sections.keys():
if varReplace(sect, repo.yumvar) == repo.id:
section_id = sect
@@ -193033,7 +193051,7 @@ index d09511f..ea6c1ac 100644
# Updated the ConfigParser with the changed values
cfgOptions = repo.cfg.options(repo.id)
-@@ -1069,7 +1284,7 @@ def writeRawRepoFile(repo,only=None):
+@@ -1069,7 +1289,7 @@ def writeRawRepoFile(repo,only=None):
# If the value is the same, but just interpreted ... when we don't want
# to keep the interpreted values.
if (name in ini[section_id] and
@@ -195431,7 +195449,7 @@ index aaa4f25..a2c5135 100755
continue
diff --git a/yum/misc.py b/yum/misc.py
-index 2f6ddfe..b817cc0 100644
+index 2f6ddfe..f551102 100644
--- a/yum/misc.py
+++ b/yum/misc.py
@@ -5,9 +5,11 @@ Assorted utility functions for yum.
@@ -195509,7 +195527,19 @@ index 2f6ddfe..b817cc0 100644
_re_compiled_filename_match = None
def re_filename(s):
""" Tests if a string could be a filename. We still get negated character
-@@ -410,6 +438,17 @@ def procgpgkey(rawkey):
+@@ -106,8 +134,9 @@ def re_filename(s):
+
+ def re_primary_filename(filename):
+ """ Tests if a filename string, can be matched against just primary.
+- Note that this can produce false negatives (but not false
+- positives). Note that this is a superset of re_primary_dirname(). """
++ Note that this can produce false negatives (Eg. /b?n/zsh) but not false
++ positives (because the former is a perf hit, and the later is a
++ failure). Note that this is a superset of re_primary_dirname(). """
+ if re_primary_dirname(filename):
+ return True
+ if filename == '/usr/lib/sendmail':
+@@ -410,6 +439,17 @@ def procgpgkey(rawkey):
# Decode and return
return base64.decodestring(block.getvalue())
@@ -195527,7 +195557,7 @@ index 2f6ddfe..b817cc0 100644
def getgpgkeyinfo(rawkey, multiple=False):
'''Return a dict of info for the given ASCII armoured key text
-@@ -611,6 +650,8 @@ def getCacheDir(tmpdir='/var/tmp', reuse=True, prefix='yum-'):
+@@ -611,6 +651,8 @@ def getCacheDir(tmpdir='/var/tmp', reuse=True, prefix='yum-'):
try:
usertup = pwd.getpwuid(uid)
username = usertup[0]
@@ -195536,7 +195566,7 @@ index 2f6ddfe..b817cc0 100644
except KeyError:
return None # if it returns None then, well, it's bollocksed
-@@ -744,8 +785,9 @@ def _decompress_chunked(source, dest, ztype):
+@@ -744,8 +786,9 @@ def _decompress_chunked(source, dest, ztype):
while True:
try:
data = s_fn.read(1024000)
@@ -195548,7 +195578,7 @@ index 2f6ddfe..b817cc0 100644
if not data: break
-@@ -868,67 +910,39 @@ def seq_max_split(seq, max_entries):
+@@ -868,67 +911,39 @@ def seq_max_split(seq, max_entries):
ret.append(seq[beg:])
return ret
@@ -195644,7 +195674,7 @@ index 2f6ddfe..b817cc0 100644
return item
def unlink_f(filename):
-@@ -937,17 +951,19 @@ def unlink_f(filename):
+@@ -937,17 +952,19 @@ def unlink_f(filename):
try:
os.unlink(filename)
except OSError, e:
@@ -195669,7 +195699,7 @@ index 2f6ddfe..b817cc0 100644
def _getloginuid():
""" Get the audit-uid/login-uid, if available. None is returned if there
-@@ -976,7 +992,6 @@ def getloginuid():
+@@ -976,7 +993,6 @@ def getloginuid():
# ---------- i18n ----------
import locale
@@ -195677,7 +195707,7 @@ index 2f6ddfe..b817cc0 100644
def setup_locale(override_codecs=True, override_time=False):
# This test needs to be before locale.getpreferredencoding() as that
# does setlocale(LC_CTYPE, "")
-@@ -992,9 +1007,17 @@ def setup_locale(override_codecs=True, override_time=False):
+@@ -992,9 +1008,17 @@ def setup_locale(override_codecs=True, override_time=False):
locale.setlocale(locale.LC_ALL, 'C')
if override_codecs:
@@ -195698,7 +195728,7 @@ index 2f6ddfe..b817cc0 100644
def get_my_lang_code():
-@@ -1105,17 +1128,28 @@ def decompress(filename, dest=None, fn_only=False, check_timestamps=False):
+@@ -1105,17 +1129,28 @@ def decompress(filename, dest=None, fn_only=False, check_timestamps=False):
out = filename.replace('.xz', '')
else:
@@ -195735,7 +195765,7 @@ index 2f6ddfe..b817cc0 100644
return out
-@@ -1123,13 +1157,14 @@ def repo_gen_decompress(filename, generated_name, cached=False):
+@@ -1123,13 +1158,14 @@ def repo_gen_decompress(filename, generated_name, cached=False):
""" This is a wrapper around decompress, where we work out a cached
generated name, and use check_timestamps. filename _must_ be from
a repo. and generated_name is the type of the file. """
@@ -195757,7 +195787,7 @@ index 2f6ddfe..b817cc0 100644
def read_in_items_from_dot_dir(thisglob, line_as_list=True):
"""takes a glob of a dir (like /etc/foo.d/*.foo)
returns a list of all the lines in all the files matching
-@@ -1175,3 +1210,22 @@ def cElementTree_xmlparse(filename):
+@@ -1175,3 +1211,22 @@ def cElementTree_xmlparse(filename):
""" Lazily load/run: cElementTree.parse """
_cElementTree_import()
return __cached_cElementTree.parse(filename)
@@ -196965,7 +196995,7 @@ index bfc49b7..f34ea19 100644
b = parsever(b)
diff --git a/yum/repoMDObject.py b/yum/repoMDObject.py
-index 31b1080..97e6797 100755
+index 31b1080..23fc067 100755
--- a/yum/repoMDObject.py
+++ b/yum/repoMDObject.py
@@ -15,6 +15,7 @@
@@ -196976,7 +197006,19 @@ index 31b1080..97e6797 100755
from Errors import RepoMDError
import sys
-@@ -38,6 +39,7 @@ class RepoData:
+@@ -25,6 +26,11 @@ def ns_cleanup(qn):
+ if qn.find('}') == -1: return qn
+ return qn.split('}')[1]
+
++def _ts_int(timestamp):
++ """ Timestamps are floats in the wild, and int("1.1") is a failure state in
++ python. So this hack ... """
++ return int(timestamp.split('.', 1)[0])
++
+ class RepoData:
+ """represents anything beneath a <data> tag"""
+ def __init__(self, elem=None):
+@@ -38,6 +44,7 @@ class RepoData:
self.dbversion = None
self.size = None
self.opensize = None
@@ -196984,7 +197026,7 @@ index 31b1080..97e6797 100755
if elem:
self.parse(elem)
-@@ -69,6 +71,10 @@ class RepoData:
+@@ -69,6 +76,10 @@ class RepoData:
self.size = child.text
elif child_name == 'open-size':
self.opensize = child.text
@@ -196995,7 +197037,7 @@ index 31b1080..97e6797 100755
def dump_xml(self):
msg = ""
-@@ -102,10 +108,21 @@ class RepoData:
+@@ -102,10 +113,21 @@ class RepoData:
xmlname)
msg += d_xml
@@ -197009,15 +197051,15 @@ index 31b1080..97e6797 100755
return msg
+ def getDelta(self, old_timestamp):
-+ old_timestamp = int(old_timestamp)
++ old_timestamp = _ts_int(old_timestamp)
+ for deltamd in self.deltas:
-+ if int(deltamd.timestamp) <= old_timestamp:
++ if _ts_int(deltamd.timestamp) <= old_timestamp:
+ return deltamd
+
class RepoMD:
"""represents the repomd xml file"""
-@@ -133,6 +150,7 @@ class RepoMD:
+@@ -133,6 +155,7 @@ class RepoMD:
else:
# srcfile is a file object
infile = srcfile
@@ -197025,7 +197067,7 @@ index 31b1080..97e6797 100755
# We trust any of these to mean the repomd.xml is valid.
infile = AutoFileChecksums(infile, ['sha256', 'sha512'],
-@@ -145,6 +163,13 @@ class RepoMD:
+@@ -145,9 +168,16 @@ class RepoMD:
if elem_name == "data":
thisdata = RepoData(elem=elem)
@@ -197038,8 +197080,12 @@ index 31b1080..97e6797 100755
+ thisdata = old
self.repoData[thisdata.type] = thisdata
try:
- nts = int(thisdata.timestamp)
-@@ -225,13 +250,19 @@ class RepoMD:
+- nts = int(thisdata.timestamp)
++ nts = _ts_int(thisdata.timestamp)
+ if nts > self.timestamp: # max() not in old python
+ self.timestamp = nts
+ except:
+@@ -225,13 +255,19 @@ class RepoMD:
for item in self.tags['repo']:
tag = """ <repo>%s</repo>\n""" % (to_xml(item))
tags += tag
@@ -198938,7 +198984,7 @@ index 0000000..1cc207f
+ return txmbrs
+
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
-index e5e9ece..67bb7c9 100644
+index e5e9ece..35359e2 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -20,10 +20,12 @@ import time
@@ -199604,7 +199650,17 @@ index e5e9ece..67bb7c9 100644
# -1 is special and should never get refreshed
if expiration_time == -1 and os.path.exists(myfile):
return True
-@@ -991,7 +1206,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -955,6 +1170,9 @@ class YumRepository(Repository, config.RepoConf):
+ elif cookie_info[8] > time.time():
+ val = False
+
++ if not self.check_config_file_age:
++ return val
++
+ # make sure none of our config files for this repo are newer than
+ # us
+ if cookie_info[8] < int(self.repo_config_age):
+@@ -991,7 +1209,7 @@ class YumRepository(Repository, config.RepoConf):
def _cachingRepoXML(self, local):
""" Should we cache the current repomd.xml """
if self.cache and not os.path.exists(local):
@@ -199613,7 +199669,7 @@ index e5e9ece..67bb7c9 100644
if self.cache or self.metadataCurrent():
return True
return False
-@@ -1020,7 +1235,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1020,7 +1238,7 @@ class YumRepository(Repository, config.RepoConf):
if grab_can_fail:
return None
raise Errors.RepoError, 'Error downloading file %s: %s' % (local, e)
@@ -199622,7 +199678,7 @@ index e5e9ece..67bb7c9 100644
misc.unlink_f(tfname)
if grab_can_fail:
return None
-@@ -1047,7 +1262,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1047,7 +1265,7 @@ class YumRepository(Repository, config.RepoConf):
parse_can_fail = 'old_repo_XML' in self._oldRepoMDData
if parse_can_fail:
return None
@@ -199631,7 +199687,7 @@ index e5e9ece..67bb7c9 100644
def _saveOldRepoXML(self, local):
""" If we have an older repomd.xml file available, save it out. """
-@@ -1074,7 +1289,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1074,7 +1292,7 @@ class YumRepository(Repository, config.RepoConf):
# We still want the old data, so we don't download twice. So we
# pretend everything is good until the revert.
if not self.timestamp_check:
@@ -199640,7 +199696,7 @@ index e5e9ece..67bb7c9 100644
if 'old_repo_XML' not in self._oldRepoMDData:
self._oldRepoMDData = {}
-@@ -1250,7 +1465,6 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1250,7 +1468,6 @@ class YumRepository(Repository, config.RepoConf):
self._revertOldRepoXML()
return False
@@ -199648,7 +199704,7 @@ index e5e9ece..67bb7c9 100644
if caching:
return False # Skip any work.
-@@ -1260,6 +1474,9 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1260,6 +1477,9 @@ class YumRepository(Repository, config.RepoConf):
return True
def _check_db_version(self, mdtype, repoXML=None):
@@ -199658,7 +199714,7 @@ index e5e9ece..67bb7c9 100644
if repoXML is None:
repoXML = self.repoXML
if mdtype in repoXML.repoData:
-@@ -1277,11 +1494,11 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1277,11 +1497,11 @@ class YumRepository(Repository, config.RepoConf):
return None
if not file_check:
@@ -199673,7 +199729,7 @@ index e5e9ece..67bb7c9 100644
if not os.path.exists(local):
local = misc.decompress(local, fn_only=True)
compressed = True
-@@ -1302,6 +1519,17 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1302,6 +1522,17 @@ class YumRepository(Repository, config.RepoConf):
into the delete list, this means metadata can change filename
without us leaking it. """
@@ -199691,7 +199747,7 @@ index e5e9ece..67bb7c9 100644
def _mdtype_eq(omdtype, odata, nmdtype, ndata):
""" Check if two returns from _get_mdtype_data() are equal. """
if ndata is None:
-@@ -1321,6 +1549,14 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1321,6 +1552,14 @@ class YumRepository(Repository, config.RepoConf):
return True
all_mdtypes = self.retrieved.keys()
@@ -199706,7 +199762,7 @@ index e5e9ece..67bb7c9 100644
if mdtypes is None:
mdtypes = all_mdtypes
-@@ -1332,9 +1568,8 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1332,9 +1571,8 @@ class YumRepository(Repository, config.RepoConf):
self._oldRepoMDData['old_MD_files'] = reverts
# Inited twice atm. ... sue me
@@ -199718,7 +199774,7 @@ index e5e9ece..67bb7c9 100644
for mdtype in all_mdtypes:
(nmdtype, ndata) = self._get_mdtype_data(mdtype)
-@@ -1371,43 +1606,16 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1371,43 +1609,16 @@ class YumRepository(Repository, config.RepoConf):
# No old repomd data, but we might still have uncompressed MD
if self._groupCheckDataMDValid(ndata, nmdtype, mdtype):
continue
@@ -199734,7 +199790,9 @@ index e5e9ece..67bb7c9 100644
- if len(downloading_with_size) == 1:
- downloading_no_size.extend(downloading_with_size)
- downloading_with_size = []
--
++ def _commonRetrieveDataMD_done(self, downloading):
++ """ Uncompress the downloaded metadata """
+
- remote_size = 0
- local_size = 0
- for (ndata, nmdtype) in downloading_with_size: # Get total size...
@@ -199751,9 +199809,7 @@ index e5e9ece..67bb7c9 100644
- if not self._retrieveMD(nmdtype, retrieve_can_fail=True):
- self._revertOldRepoXML()
- return False
-+ def _commonRetrieveDataMD_done(self, downloading):
-+ """ Uncompress the downloaded metadata """
-
+-
- for (ndata, nmdtype) in downloading_with_size + downloading_no_size:
+ for (ndata, nmdtype) in downloading:
local = self._get_mdtype_fname(ndata, False)
@@ -199768,7 +199824,7 @@ index e5e9ece..67bb7c9 100644
def _groupLoadRepoXML(self, text=None, mdtypes=None):
""" Retrieve the new repomd.xml from the repository, then check it
-@@ -1421,11 +1629,11 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1421,11 +1632,11 @@ class YumRepository(Repository, config.RepoConf):
self._commonRetrieveDataMD(mdtypes)
def _mdpolicy2mdtypes(self):
@@ -199784,7 +199840,7 @@ index e5e9ece..67bb7c9 100644
mdtypes = set()
if type(self.mdpolicy) in types.StringTypes:
mdtypes.update(md_groups.get(self.mdpolicy, [self.mdpolicy]))
-@@ -1436,6 +1644,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1436,6 +1647,7 @@ class YumRepository(Repository, config.RepoConf):
if not mdtypes or 'group:all' in mdtypes:
mdtypes = None
else:
@@ -199792,7 +199848,7 @@ index e5e9ece..67bb7c9 100644
mdtypes = sorted(list(mdtypes))
return mdtypes
-@@ -1446,17 +1655,12 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1446,17 +1658,12 @@ class YumRepository(Repository, config.RepoConf):
except KeyboardInterrupt:
self._revertOldRepoXML() # Undo metadata cookie?
raise
@@ -199812,7 +199868,7 @@ index e5e9ece..67bb7c9 100644
return self._repoXML
-@@ -1480,7 +1684,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1480,7 +1687,7 @@ class YumRepository(Repository, config.RepoConf):
result = self._getFile(relative='repodata/repomd.xml.asc',
copy_local=1,
local = sigfile,
@@ -199821,7 +199877,7 @@ index e5e9ece..67bb7c9 100644
reget=None,
checkfunc=None,
cache=self.http_caching == 'all',
-@@ -1508,6 +1712,18 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1508,6 +1715,18 @@ class YumRepository(Repository, config.RepoConf):
raise URLGrabError(-1, 'repomd.xml does not match metalink for %s' %
self)
@@ -199840,7 +199896,7 @@ index e5e9ece..67bb7c9 100644
def checkMD(self, fn, mdtype, openchecksum=False):
"""check the metadata type against its checksum"""
-@@ -1537,6 +1753,16 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1537,6 +1756,16 @@ class YumRepository(Repository, config.RepoConf):
if size is not None:
size = int(size)
@@ -199857,7 +199913,7 @@ index e5e9ece..67bb7c9 100644
try: # get the local checksum
l_csum = self._checksum(r_ctype, file, datasize=size)
except Errors.RepoError, e:
-@@ -1545,21 +1771,20 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1545,21 +1774,20 @@ class YumRepository(Repository, config.RepoConf):
raise URLGrabError(-3, 'Error performing checksum')
if l_csum == r_csum:
@@ -199881,7 +199937,7 @@ index e5e9ece..67bb7c9 100644
""" Internal function, use .retrieveMD() from outside yum. """
# Note that this can raise Errors.RepoMDError if mdtype doesn't exist
# for this repo.
-@@ -1575,37 +1800,38 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1575,37 +1803,38 @@ class YumRepository(Repository, config.RepoConf):
# got it, move along
return local
@@ -199940,7 +199996,7 @@ index e5e9ece..67bb7c9 100644
local = self._getFile(relative=remote,
local=local,
copy_local=1,
-@@ -1613,8 +1839,9 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1613,8 +1842,9 @@ class YumRepository(Repository, config.RepoConf):
checkfunc=checkfunc,
text=text,
cache=self.http_caching == 'all',
@@ -199952,7 +200008,7 @@ index e5e9ece..67bb7c9 100644
if retrieve_can_fail:
return None
raise
-@@ -1622,9 +1849,8 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1622,9 +1852,8 @@ class YumRepository(Repository, config.RepoConf):
if retrieve_can_fail:
return None
raise Errors.RepoError, \
@@ -199963,7 +200019,7 @@ index e5e9ece..67bb7c9 100644
return local
-@@ -1646,13 +1872,21 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1646,13 +1875,21 @@ class YumRepository(Repository, config.RepoConf):
def getGroups(self):
"""gets groups and returns group file path for the repository, if there
@@ -199988,7 +200044,7 @@ index e5e9ece..67bb7c9 100644
self._callbacks_changed = True
def setFailureObj(self, failure_obj):
-@@ -1681,7 +1915,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1681,7 +1918,7 @@ class YumRepository(Repository, config.RepoConf):
print "Could not read mirrorlist %s, error was \n%s" %(url, e)
content = []
for line in content:
@@ -199997,7 +200053,7 @@ index e5e9ece..67bb7c9 100644
continue
mirror = line.rstrip() # no more trailing \n's
mirror = mirror.replace('$ARCH', '$BASEARCH')
-@@ -1701,7 +1935,8 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1701,7 +1938,8 @@ class YumRepository(Repository, config.RepoConf):
fo = None
cacheok = False
@@ -200007,7 +200063,7 @@ index e5e9ece..67bb7c9 100644
cacheok = True
fo = open(self.mirrorlist_file, 'r')
url = 'file://' + self.mirrorlist_file # just to keep self._readMirrorList(fo,url) happy
-@@ -1713,7 +1948,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1713,7 +1951,7 @@ class YumRepository(Repository, config.RepoConf):
ugopts = self._default_grabopts()
try:
fo = urlgrabber.grabber.urlopen(url, **ugopts)
@@ -200016,7 +200072,7 @@ index e5e9ece..67bb7c9 100644
print "Could not retrieve mirrorlist %s error was\n%s: %s" % (url, e.args[0], misc.to_unicode(e.args[1]))
fo = None
-@@ -1740,7 +1975,11 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1740,7 +1978,11 @@ class YumRepository(Repository, config.RepoConf):
if os.path.exists(destfn):
if os.stat(fn)[stat.ST_CTIME] <= os.stat(destfn)[stat.ST_CTIME]:
return False
@@ -200029,7 +200085,7 @@ index e5e9ece..67bb7c9 100644
return True
def _preload_file_from_system_cache(self, filename, subdir='',
-@@ -1877,7 +2116,7 @@ def getMirrorList(mirrorlist, pdict = None):
+@@ -1877,7 +2119,7 @@ def getMirrorList(mirrorlist, pdict = None):
try:
fo = urlresolver.urlopen(url, proxies=pdict)
diff --git a/yum.spec b/yum.spec
index f6c954e..434191b 100644
--- a/yum.spec
+++ b/yum.spec
@@ -60,7 +60,7 @@ BuildRequires: bash-completion
Summary: RPM package installer/updater/manager
Name: yum
Version: 3.4.3
-Release: 118%{?dist}
+Release: 119%{?dist}
License: GPLv2+
Group: System Environment/Base
Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz
@@ -444,8 +444,11 @@ exit 0
%endif
%changelog
-* Mon Dec 2 2013 Zdenek Pavlas <zpavlas at redhat.com> - 3.4.3-119
+* Wed Dec 4 2013 Zdenek Pavlas <zpavlas at redhat.com> - 3.4.3-119
- docs only: group_command=objects is the distro default.
+- Parse float timestamps as valid, for global timestamp.
+- Add check_config_file_age, so we can turn that off for rhsm repos. BZ 103544
+- Better doc. comment for re_primary_filename().
* Thu Nov 21 2013 James Antill <james at fedoraproject.org> - 3.4.3-118
- Update to latest HEAD.
More information about the scm-commits
mailing list