[yum] update to latest HEAD.
Zdeněk Pavlas
zpavlas at fedoraproject.org
Mon May 14 08:53:40 UTC 2012
commit 8820a2a76d63af8319c53eba6340acb3d4495e93
Author: Zdeněk Pavlas <zpavlas at redhat.com>
Date: Thu May 3 14:07:05 2012 +0200
update to latest HEAD.
yum-HEAD.patch | 482 +++++++++++++++++++++++++++++++++++++++++---------------
yum.spec | 7 +
2 files changed, 358 insertions(+), 131 deletions(-)
---
diff --git a/yum-HEAD.patch b/yum-HEAD.patch
index 6b22c85..b605f1f 100644
--- a/yum-HEAD.patch
+++ b/yum-HEAD.patch
@@ -96,7 +96,7 @@ index 2f6154e..2e5a052 100644
diff --git a/cli.py b/cli.py
old mode 100644
new mode 100755
-index 6056d38..a0d8886
+index 6056d38..597efd6
--- a/cli.py
+++ b/cli.py
@@ -25,7 +25,7 @@ import sys
@@ -846,9 +846,9 @@ index 6056d38..a0d8886
+ :param args: a list of names or wildcards specifying packages
+ that should have their dependenices printed
+ :return: (exit_code, [ errors ])
-
-+ exit_code is::
+
++ exit_code is::
+
+ 0 = we're done, exit
+ 1 = we've errored, exit with error string
+ 2 = we've got work yet to do, onto the next stage
@@ -880,7 +880,16 @@ index 6056d38..a0d8886
old_sdup = self.conf.showdupesfromrepos
# For output, as searchPackageProvides() is always in showdups mode
self.conf.showdupesfromrepos = True
-@@ -1163,20 +1419,77 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1147,6 +1403,8 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+ paths = set(sys.path + os.environ['PATH'].split(':'))
+ nargs = []
+ for arg in args:
++ if not arg:
++ continue
+ if yum.misc.re_filename(arg) or yum.misc.re_glob(arg):
+ continue
+ for path in paths:
+@@ -1163,20 +1421,77 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
return 0, []
def resolveDepCli(self, args):
@@ -963,7 +972,7 @@ index 6056d38..a0d8886
hdrcode = pkgcode = xmlcode = dbcode = expccode = 0
pkgresults = hdrresults = xmlresults = dbresults = expcresults = []
msg = self.fmtKeyValFill(_('Cleaning repos: '),
-@@ -1228,7 +1541,19 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1228,7 +1543,19 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
return code, []
def returnGroupLists(self, userlist):
@@ -983,7 +992,7 @@ index 6056d38..a0d8886
uservisible=1
if len(userlist) > 0:
-@@ -1254,7 +1579,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1254,7 +1581,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
msg += ' (%s)' % group.groupid
if group.langonly:
msg += ' [%s]' % group.langonly
@@ -992,7 +1001,7 @@ index 6056d38..a0d8886
done = False
for group in installed:
-@@ -1283,7 +1608,20 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1283,7 +1610,20 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
return 0, [_('Done')]
def returnGroupSummary(self, userlist):
@@ -1013,7 +1022,7 @@ index 6056d38..a0d8886
uservisible=1
if len(userlist) > 0:
-@@ -1327,7 +1665,19 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1327,7 +1667,19 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
return 0, [_('Done')]
def returnGroupInfo(self, userlist):
@@ -1034,7 +1043,7 @@ index 6056d38..a0d8886
for strng in userlist:
group_matched = False
for group in self.comps.return_groups(strng):
-@@ -1339,9 +1689,19 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1339,9 +1691,19 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
return 0, []
@@ -1057,7 +1066,7 @@ index 6056d38..a0d8886
pkgs_used = []
for group_string in grouplist:
-@@ -1351,7 +1711,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1351,7 +1713,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
try:
@@ -1066,7 +1075,7 @@ index 6056d38..a0d8886
except yum.Errors.GroupsError:
self.logger.critical(_('Warning: Group %s does not exist.'), group_string)
continue
-@@ -1368,8 +1728,18 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1368,8 +1730,18 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
return 2, [P_('%d package to Install', '%d packages to Install', len(pkgs_used)) % len(pkgs_used)]
def removeGroups(self, grouplist):
@@ -1086,7 +1095,7 @@ index 6056d38..a0d8886
pkgs_used = []
for group_string in grouplist:
try:
-@@ -1389,7 +1759,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1389,7 +1761,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
def _promptWanted(self):
# shortcut for the always-off/always-on options
@@ -1095,7 +1104,7 @@ index 6056d38..a0d8886
return False
if self.conf.alwaysprompt:
return True
-@@ -1400,7 +1770,6 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1400,7 +1772,6 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
# package wasn't explictly given on the command line
for txmbr in self.tsInfo.getMembers():
if txmbr.isDep or \
@@ -1103,7 +1112,7 @@ index 6056d38..a0d8886
txmbr.name not in self.extcmds:
return True
-@@ -1408,11 +1777,11 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1408,11 +1779,11 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
return False
def usage(self):
@@ -1117,7 +1126,7 @@ index 6056d38..a0d8886
sys.stdout.write(self.optparser.get_usage())
def _installable(self, pkg, ematch=False):
-@@ -1468,9 +1837,9 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1468,9 +1839,9 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
return False
class YumOptionParser(OptionParser):
@@ -1129,7 +1138,7 @@ index 6056d38..a0d8886
def __init__(self,base, **kwargs):
# check if this is called with a utils=True/False parameter
-@@ -1488,13 +1857,23 @@ class YumOptionParser(OptionParser):
+@@ -1488,13 +1859,23 @@ class YumOptionParser(OptionParser):
self._addYumBasicOptions()
def error(self, msg):
@@ -1155,7 +1164,7 @@ index 6056d38..a0d8886
try:
args = _filtercmdline(
('--noplugins','--version','-q', '-v', "--quiet", "--verbose"),
-@@ -1521,7 +1900,15 @@ class YumOptionParser(OptionParser):
+@@ -1521,7 +1902,15 @@ class YumOptionParser(OptionParser):
return ret
def setupYumConfig(self, args=None):
@@ -1172,7 +1181,7 @@ index 6056d38..a0d8886
if not args:
(opts, cmds) = self.parse_args()
else:
-@@ -1536,13 +1923,14 @@ class YumOptionParser(OptionParser):
+@@ -1536,13 +1925,14 @@ class YumOptionParser(OptionParser):
# Handle remaining options
if opts.assumeyes:
@@ -1192,7 +1201,7 @@ index 6056d38..a0d8886
self.base.conf.cache = 1
if opts.obsoletes:
-@@ -1610,10 +1998,6 @@ class YumOptionParser(OptionParser):
+@@ -1610,10 +2000,6 @@ class YumOptionParser(OptionParser):
self.base.usage()
sys.exit(1)
@@ -1203,7 +1212,7 @@ index 6056d38..a0d8886
# Disable all gpg key checking, if requested.
if opts.nogpgcheck:
# Altering the normal configs. doesn't work too well, esp. with
-@@ -1640,6 +2024,14 @@ class YumOptionParser(OptionParser):
+@@ -1640,6 +2026,14 @@ class YumOptionParser(OptionParser):
sys.exit(1)
def getRoot(self,opts):
@@ -1218,7 +1227,7 @@ index 6056d38..a0d8886
self._checkAbsInstallRoot(opts)
# If the conf file is inside the installroot - use that.
# otherwise look for it in the normal root
-@@ -1713,6 +2105,10 @@ class YumOptionParser(OptionParser):
+@@ -1713,6 +2107,10 @@ class YumOptionParser(OptionParser):
help=_("verbose operation"))
group.add_option("-y", "--assumeyes", dest="assumeyes",
action="store_true", help=_("answer yes for all questions"))
@@ -1231,10 +1240,10 @@ index 6056d38..a0d8886
group.add_option("--installroot", help=_("set install root"),
diff --git a/completion-helper.py b/completion-helper.py
new file mode 100755
-index 0000000..405ceab
+index 0000000..0e4b96b
--- /dev/null
+++ b/completion-helper.py
-@@ -0,0 +1,89 @@
+@@ -0,0 +1,90 @@
+#!/usr/bin/python -t
+# -*- coding: utf-8 -*-
+#
@@ -1301,7 +1310,8 @@ index 0000000..405ceab
+
+def get_pattern(extcmds):
+ if len(extcmds) > 1 and extcmds[-1]:
-+ return shlex.split(extcmds[-1])[0] + "*"
++ try: return shlex.split(extcmds[-1])[0] + "*"
++ except ValueError: pass
+ return "*"
+
+def main(args):
@@ -2697,7 +2707,7 @@ index c60fa08..0000000
-ts run
-exit
diff --git a/etc/yum.bash b/etc/yum.bash
-index f1e06e8..16b011a 100644
+index f1e06e8..b21c594 100644
--- a/etc/yum.bash
+++ b/etc/yum.bash
@@ -1,53 +1,17 @@
@@ -2707,7 +2717,8 @@ index f1e06e8..16b011a 100644
-# 1 = argument to "yum list" (all, available, updates etc)
-# 2 = current word to be completed
-_yum_list()
--{
++_yum_helper()
+ {
- # Fail fast for things that look like paths.
- [[ $2 == */* || $2 == [.~]* ]] && return
-
@@ -2730,8 +2741,7 @@ index f1e06e8..16b011a 100644
-# 1 = argument to "yum repolist" (enabled, disabled etc)
-# 2 = current word to be completed
-_yum_repolist()
-+_yum_helper()
- {
+-{
- # TODO: add -d 0 when http://yum.baseurl.org/ticket/29 is fixed
- # (for now --noplugins is used to get rid of "Loaded plugins: ...")
- # Drop first ("repo id repo name") and last ("repolist: ...") rows -
@@ -2756,8 +2766,8 @@ index f1e06e8..16b011a 100644
- COMPREPLY=( $( compgen -W "$( ${yum:-yum} -C grouplist $1 "$2*" \
- 2>/dev/null | sed -ne 's/^[[:space:]]\{1,\}\(.\{1,\}\)/\1/p' )" \
- -- "$2" ) )
-+ # Fail fast for things that look like paths.
-+ [[ $2 == */* || $2 == [.~]* ]] && return
++ # Fail fast for things that look like paths or options.
++ [[ $2 == */* || $2 == [.~-]* ]] && return
+ _yum_helper list "$@"
}
@@ -150638,7 +150648,7 @@ index abd203f..65c62a9 100644
- 3.4.1
- umask bug fix.
diff --git a/yum/__init__.py b/yum/__init__.py
-index 99039e0..7e67d20 100644
+index 99039e0..5be32e9 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -46,8 +46,13 @@ import operator
@@ -151950,7 +151960,7 @@ index 99039e0..7e67d20 100644
warnings.warn(_('searchPackages() will go away in a future version of Yum.\
Use searchGenerator() instead. \n'),
Errors.YumFutureDeprecationWarning, stacklevel=2)
-@@ -2700,6 +3035,19 @@ class YumBase(depsolve.Depsolve):
+@@ -2700,13 +3035,23 @@ class YumBase(depsolve.Depsolve):
def searchPackageProvides(self, args, callback=None,
callback_has_matchfor=False):
@@ -151970,7 +151980,15 @@ index 99039e0..7e67d20 100644
def _arg_data(arg):
if not misc.re_glob(arg):
isglob = False
-@@ -2723,7 +3071,7 @@ class YumBase(depsolve.Depsolve):
+- if arg[0] != '/':
+- canBeFile = False
+- else:
+- canBeFile = True
++ canBeFile = arg.startswith('/')
+ else:
+ isglob = True
+ canBeFile = misc.re_filename(arg)
+@@ -2723,7 +3068,7 @@ class YumBase(depsolve.Depsolve):
where = self.returnPackagesByDep(arg)
else:
usedDepString = False
@@ -151979,7 +151997,7 @@ index 99039e0..7e67d20 100644
self.verbose_logger.log(logginglevels.DEBUG_1,
P_('Searching %d package', 'Searching %d packages', len(where)), len(where))
-@@ -2817,25 +3165,93 @@ class YumBase(depsolve.Depsolve):
+@@ -2817,25 +3162,93 @@ class YumBase(depsolve.Depsolve):
return matches
@@ -152084,7 +152102,7 @@ index 99039e0..7e67d20 100644
if uservisible:
if grp.user_visible:
installed.append(grp)
-@@ -2848,12 +3264,29 @@ class YumBase(depsolve.Depsolve):
+@@ -2848,12 +3261,29 @@ class YumBase(depsolve.Depsolve):
else:
available.append(grp)
@@ -152117,7 +152135,7 @@ index 99039e0..7e67d20 100644
txmbrs_used = []
thesegroups = self.comps.return_groups(grpid)
-@@ -2861,20 +3294,28 @@ class YumBase(depsolve.Depsolve):
+@@ -2861,20 +3291,28 @@ class YumBase(depsolve.Depsolve):
raise Errors.GroupsError, _("No Group named %s exists") % to_unicode(grpid)
for thisgroup in thesegroups:
@@ -152148,7 +152166,7 @@ index 99039e0..7e67d20 100644
thesegroups = self.comps.return_groups(grpid)
if not thesegroups:
raise Errors.GroupsError, _("No Group named %s exists") % to_unicode(grpid)
-@@ -2898,13 +3339,18 @@ class YumBase(depsolve.Depsolve):
+@@ -2898,13 +3336,18 @@ class YumBase(depsolve.Depsolve):
self.tsInfo.remove(txmbr.po.pkgtup)
@@ -152174,7 +152192,7 @@ index 99039e0..7e67d20 100644
"""
if not self.comps.has_group(grpid):
-@@ -2934,12 +3380,47 @@ class YumBase(depsolve.Depsolve):
+@@ -2934,12 +3377,47 @@ class YumBase(depsolve.Depsolve):
if 'optional' in package_types:
pkgs.extend(thisgroup.optional_packages)
@@ -152223,7 +152241,7 @@ index 99039e0..7e67d20 100644
except Errors.InstallError, e:
self.verbose_logger.debug(_('No package named %s available to be installed'),
pkg)
-@@ -2953,6 +3434,7 @@ class YumBase(depsolve.Depsolve):
+@@ -2953,6 +3431,7 @@ class YumBase(depsolve.Depsolve):
group_conditionals = enable_group_conditionals
count_cond_test = 0
@@ -152231,7 +152249,7 @@ index 99039e0..7e67d20 100644
if group_conditionals:
for condreq, cond in thisgroup.conditional_packages.iteritems():
if self.isPackageInstalled(cond):
-@@ -2997,10 +3479,14 @@ class YumBase(depsolve.Depsolve):
+@@ -2997,10 +3476,14 @@ class YumBase(depsolve.Depsolve):
return txmbrs_used
def deselectGroup(self, grpid, force=False):
@@ -152250,7 +152268,7 @@ index 99039e0..7e67d20 100644
if not self.comps.has_group(grpid):
raise Errors.GroupsError, _("No Group named %s exists") % to_unicode(grpid)
-@@ -3035,12 +3521,21 @@ class YumBase(depsolve.Depsolve):
+@@ -3035,12 +3518,21 @@ class YumBase(depsolve.Depsolve):
self.tsInfo.remove(pkg.pkgtup)
def getPackageObject(self, pkgtup, allow_missing=False):
@@ -152278,7 +152296,7 @@ index 99039e0..7e67d20 100644
# look it up in the self.localPackages first:
for po in self.localPackages:
if po.pkgtup == pkgtup:
-@@ -3049,7 +3544,7 @@ class YumBase(depsolve.Depsolve):
+@@ -3049,7 +3541,7 @@ class YumBase(depsolve.Depsolve):
pkgs = self.pkgSack.searchPkgTuple(pkgtup)
if len(pkgs) == 0:
@@ -152287,7 +152305,7 @@ index 99039e0..7e67d20 100644
if allow_missing: # This can happen due to excludes after .up has
return None # happened.
raise Errors.DepError, _('Package tuple %s could not be found in packagesack') % str(pkgtup)
-@@ -3065,13 +3560,21 @@ class YumBase(depsolve.Depsolve):
+@@ -3065,13 +3557,21 @@ class YumBase(depsolve.Depsolve):
return result
def getInstalledPackageObject(self, pkgtup):
@@ -152314,7 +152332,7 @@ index 99039e0..7e67d20 100644
raise Errors.RpmDBError, _('Package tuple %s could not be found in rpmdb') % str(pkgtup)
# Dito. FIXME from getPackageObject() for len() > 1 ... :)
-@@ -3079,9 +3582,11 @@ class YumBase(depsolve.Depsolve):
+@@ -3079,9 +3579,11 @@ class YumBase(depsolve.Depsolve):
return po
def gpgKeyCheck(self):
@@ -152328,7 +152346,7 @@ index 99039e0..7e67d20 100644
gpgkeyschecked = self.conf.cachedir + '/.gpgkeyschecked.yum'
if os.path.exists(gpgkeyschecked):
return 1
-@@ -3106,9 +3611,13 @@ class YumBase(depsolve.Depsolve):
+@@ -3106,9 +3608,13 @@ class YumBase(depsolve.Depsolve):
return 1
def returnPackagesByDep(self, depstring):
@@ -152344,7 +152362,7 @@ index 99039e0..7e67d20 100644
if not depstring:
return []
-@@ -3135,9 +3644,16 @@ class YumBase(depsolve.Depsolve):
+@@ -3135,9 +3641,16 @@ class YumBase(depsolve.Depsolve):
return self.pkgSack.getProvides(depname, depflags, depver).keys()
def returnPackageByDep(self, depstring):
@@ -152364,7 +152382,7 @@ index 99039e0..7e67d20 100644
# we get all sorts of randomness here
errstring = depstring
if type(depstring) not in types.StringTypes:
-@@ -3149,16 +3665,22 @@ class YumBase(depsolve.Depsolve):
+@@ -3149,16 +3662,22 @@ class YumBase(depsolve.Depsolve):
raise Errors.YumBaseError, _('No Package found for %s') % errstring
ps = ListPackageSack(pkglist)
@@ -152391,7 +152409,7 @@ index 99039e0..7e67d20 100644
if not depstring:
return []
-@@ -3184,12 +3706,47 @@ class YumBase(depsolve.Depsolve):
+@@ -3184,12 +3703,47 @@ class YumBase(depsolve.Depsolve):
return self.rpmdb.getProvides(depname, depflags, depver).keys()
@@ -152441,7 +152459,7 @@ index 99039e0..7e67d20 100644
if len(pkglist) == 0:
-@@ -3198,14 +3755,23 @@ class YumBase(depsolve.Depsolve):
+@@ -3198,14 +3752,23 @@ class YumBase(depsolve.Depsolve):
if len(pkglist) == 1:
return pkglist[0]
@@ -152471,7 +152489,7 @@ index 99039e0..7e67d20 100644
returnlist = []
compatArchList = self.arch.get_arch_list(arch)
multiLib = []
-@@ -3222,9 +3788,9 @@ class YumBase(depsolve.Depsolve):
+@@ -3222,9 +3785,9 @@ class YumBase(depsolve.Depsolve):
singleLib.append(po)
# we now have three lists. find the best package(s) of each
@@ -152484,7 +152502,7 @@ index 99039e0..7e67d20 100644
if single_name and multi and single and multi.name != single.name:
# Sinlge _must_ match multi, if we want a single package name
-@@ -3238,7 +3804,7 @@ class YumBase(depsolve.Depsolve):
+@@ -3238,7 +3801,7 @@ class YumBase(depsolve.Depsolve):
# if there's a noarch and it's newer than the multilib, we want
# just the noarch. otherwise, we want multi + single
elif multi:
@@ -152493,7 +152511,7 @@ index 99039e0..7e67d20 100644
if best.arch == "noarch":
returnlist.append(no)
else:
-@@ -3246,7 +3812,7 @@ class YumBase(depsolve.Depsolve):
+@@ -3246,7 +3809,7 @@ class YumBase(depsolve.Depsolve):
if single: returnlist.append(single)
# similar for the non-multilib case
elif single:
@@ -152502,7 +152520,7 @@ index 99039e0..7e67d20 100644
if best.arch == "noarch":
returnlist.append(no)
else:
-@@ -3350,23 +3916,27 @@ class YumBase(depsolve.Depsolve):
+@@ -3350,23 +3913,27 @@ class YumBase(depsolve.Depsolve):
done = True
slow = next_func(slow)
@@ -152535,7 +152553,7 @@ index 99039e0..7e67d20 100644
def _at_groupremove(self, pattern):
" Do groupremove via. leading @ on the cmd line, for remove."
assert pattern[0] == '@'
-@@ -3398,7 +3968,7 @@ class YumBase(depsolve.Depsolve):
+@@ -3398,7 +3965,7 @@ class YumBase(depsolve.Depsolve):
def _minus_deselect(self, pattern):
""" Remove things from the transaction, like kickstart. """
assert pattern[0] == '-'
@@ -152544,7 +152562,7 @@ index 99039e0..7e67d20 100644
if pat and pat[0] == '@':
pat = pat[1:]
-@@ -3437,14 +4007,61 @@ class YumBase(depsolve.Depsolve):
+@@ -3437,14 +4004,61 @@ class YumBase(depsolve.Depsolve):
if flag not in self.tsInfo.probFilterFlags:
self.tsInfo.probFilterFlags.append(flag)
@@ -152612,7 +152630,7 @@ index 99039e0..7e67d20 100644
pkgs = []
was_pattern = False
if po:
-@@ -3477,20 +4094,12 @@ class YumBase(depsolve.Depsolve):
+@@ -3477,20 +4091,12 @@ class YumBase(depsolve.Depsolve):
self.verbose_logger.debug(_('Checking for virtual provide or file-provide for %s'),
arg)
@@ -152639,7 +152657,7 @@ index 99039e0..7e67d20 100644
else:
nevra_dict = self._nevra_kwarg_parse(kwargs)
-@@ -3577,8 +4186,8 @@ class YumBase(depsolve.Depsolve):
+@@ -3577,8 +4183,8 @@ class YumBase(depsolve.Depsolve):
continue
# make sure this shouldn't be passed to update:
@@ -152650,7 +152668,7 @@ index 99039e0..7e67d20 100644
txmbrs = self.update(po=po)
tx_return.extend(txmbrs)
continue
-@@ -3587,7 +4196,7 @@ class YumBase(depsolve.Depsolve):
+@@ -3587,7 +4193,7 @@ class YumBase(depsolve.Depsolve):
# something else in the repo. Unless there is a obsoletion loop,
# at which point ignore everything.
obsoleting_pkg = None
@@ -152659,7 +152677,7 @@ index 99039e0..7e67d20 100644
obsoleting_pkg = self._test_loop(po, self._pkg2obspkg)
if obsoleting_pkg is not None:
# this is not a definitive check but it'll make sure we don't
-@@ -3600,23 +4209,23 @@ class YumBase(depsolve.Depsolve):
+@@ -3600,23 +4206,23 @@ class YumBase(depsolve.Depsolve):
already_obs = pkgs[0]
if already_obs:
@@ -152690,7 +152708,7 @@ index 99039e0..7e67d20 100644
continue
# make sure we don't have a name.arch of this already installed
-@@ -3630,7 +4239,7 @@ class YumBase(depsolve.Depsolve):
+@@ -3630,7 +4236,7 @@ class YumBase(depsolve.Depsolve):
found = True
break
if not found:
@@ -152699,7 +152717,7 @@ index 99039e0..7e67d20 100644
txmbrs = self.update(po=po)
tx_return.extend(txmbrs)
continue
-@@ -3719,14 +4328,33 @@ class YumBase(depsolve.Depsolve):
+@@ -3719,14 +4325,33 @@ class YumBase(depsolve.Depsolve):
return txmbr
def update(self, po=None, requiringPo=None, update_to=False, **kwargs):
@@ -152740,7 +152758,7 @@ index 99039e0..7e67d20 100644
# check for args - if no po nor kwargs, do them all
# if po, do it, ignore all else
# if no po do kwargs
-@@ -3765,7 +4393,12 @@ class YumBase(depsolve.Depsolve):
+@@ -3765,7 +4390,12 @@ class YumBase(depsolve.Depsolve):
if new is None:
continue
tx_return.extend(self.update(po=new))
@@ -152754,7 +152772,7 @@ index 99039e0..7e67d20 100644
return tx_return
# complications
-@@ -3787,7 +4420,7 @@ class YumBase(depsolve.Depsolve):
+@@ -3787,7 +4417,7 @@ class YumBase(depsolve.Depsolve):
return self._minus_deselect(kwargs['pattern'])
if kwargs['pattern'] and kwargs['pattern'][0] == '@':
@@ -152763,7 +152781,7 @@ index 99039e0..7e67d20 100644
arg = kwargs['pattern']
if not update_to:
-@@ -3920,6 +4553,18 @@ class YumBase(depsolve.Depsolve):
+@@ -3920,6 +4550,18 @@ class YumBase(depsolve.Depsolve):
tx_return.append(txmbr)
for available_pkg in availpkgs:
@@ -152782,7 +152800,7 @@ index 99039e0..7e67d20 100644
# Make sure we're not installing a package which is obsoleted by
# something else in the repo. Unless there is a obsoletion loop,
# at which point ignore everything.
-@@ -3985,11 +4630,18 @@ class YumBase(depsolve.Depsolve):
+@@ -3985,11 +4627,18 @@ class YumBase(depsolve.Depsolve):
return tx_return
def remove(self, po=None, **kwargs):
@@ -152806,7 +152824,7 @@ index 99039e0..7e67d20 100644
if not po and not kwargs:
raise Errors.RemoveError, 'Nothing specified to remove'
-@@ -4055,17 +4707,19 @@ class YumBase(depsolve.Depsolve):
+@@ -4055,17 +4704,19 @@ class YumBase(depsolve.Depsolve):
return tx_return
def installLocal(self, pkg, po=None, updateonly=False):
@@ -152836,7 +152854,7 @@ index 99039e0..7e67d20 100644
# read in the package into a YumLocalPackage Object
# append it to self.localPackages
# check if it can be installed or updated based on nevra versus rpmdb
-@@ -4183,16 +4837,15 @@ class YumBase(depsolve.Depsolve):
+@@ -4183,16 +4834,15 @@ class YumBase(depsolve.Depsolve):
return tx_return
def reinstallLocal(self, pkg, po=None):
@@ -152861,7 +152879,7 @@ index 99039e0..7e67d20 100644
if not po:
try:
po = YumUrlPackage(self, ts=self.rpmdb.readOnlyTS(), url=pkg,
-@@ -4215,9 +4868,19 @@ class YumBase(depsolve.Depsolve):
+@@ -4215,9 +4865,19 @@ class YumBase(depsolve.Depsolve):
return self.reinstall(po=po)
def reinstall(self, po=None, **kwargs):
@@ -152884,7 +152902,7 @@ index 99039e0..7e67d20 100644
self._add_prob_flags(rpm.RPMPROB_FILTER_REPLACEPKG,
rpm.RPMPROB_FILTER_REPLACENEWFILES,
rpm.RPMPROB_FILTER_REPLACEOLDFILES)
-@@ -4259,16 +4922,15 @@ class YumBase(depsolve.Depsolve):
+@@ -4259,16 +4919,15 @@ class YumBase(depsolve.Depsolve):
return tx_mbrs
def downgradeLocal(self, pkg, po=None):
@@ -152909,7 +152927,7 @@ index 99039e0..7e67d20 100644
if not po:
try:
po = YumUrlPackage(self, ts=self.rpmdb.readOnlyTS(), url=pkg,
-@@ -4309,13 +4971,19 @@ class YumBase(depsolve.Depsolve):
+@@ -4309,13 +4968,19 @@ class YumBase(depsolve.Depsolve):
return False
def downgrade(self, po=None, **kwargs):
@@ -152936,7 +152954,7 @@ index 99039e0..7e67d20 100644
if not po and not kwargs:
raise Errors.DowngradeError, 'Nothing specified to downgrade'
-@@ -4421,6 +5089,9 @@ class YumBase(depsolve.Depsolve):
+@@ -4421,6 +5086,9 @@ class YumBase(depsolve.Depsolve):
warned_nas.add(na)
continue
@@ -152946,7 +152964,7 @@ index 99039e0..7e67d20 100644
if pkg.verGE(lipkg):
if na not in warned_nas:
msg = _('Only Upgrade available on package: %s') % pkg
-@@ -4457,7 +5128,7 @@ class YumBase(depsolve.Depsolve):
+@@ -4457,7 +5125,7 @@ class YumBase(depsolve.Depsolve):
if e and v and r:
evr = '%s:%s-%s' % (e, v, r)
elif v and r:
@@ -152955,7 +152973,7 @@ index 99039e0..7e67d20 100644
elif e and v:
evr = '%s:%s' % (e, v)
elif v: # e and r etc. is just too weird to print
-@@ -4500,12 +5171,24 @@ class YumBase(depsolve.Depsolve):
+@@ -4500,12 +5168,24 @@ class YumBase(depsolve.Depsolve):
return returndict
@@ -152983,7 +153001,7 @@ index 99039e0..7e67d20 100644
old_conf_obs = self.conf.obsoletes
self.conf.obsoletes = False
done = False
-@@ -4515,19 +5198,46 @@ class YumBase(depsolve.Depsolve):
+@@ -4515,19 +5195,46 @@ class YumBase(depsolve.Depsolve):
done = True
for pkg in transaction.trans_data:
if pkg.state == 'Downgrade':
@@ -153030,7 +153048,7 @@ index 99039e0..7e67d20 100644
if self.install(pkgtup=pkg.pkgtup):
done = True
for pkg in transaction.trans_data:
-@@ -4538,8 +5248,14 @@ class YumBase(depsolve.Depsolve):
+@@ -4538,8 +5245,14 @@ class YumBase(depsolve.Depsolve):
return done
def history_undo(self, transaction):
@@ -153047,7 +153065,7 @@ index 99039e0..7e67d20 100644
# NOTE: This is somewhat basic atm. ... for instance we don't check
# that we are going from the old new version. However it's still
# better than the RHN rollback code, and people pay for that :).
-@@ -4616,7 +5332,7 @@ class YumBase(depsolve.Depsolve):
+@@ -4616,7 +5329,7 @@ class YumBase(depsolve.Depsolve):
except urlgrabber.grabber.URLGrabError, e:
raise Errors.YumBaseError(_('GPG key retrieval failed: ') +
@@ -153056,7 +153074,7 @@ index 99039e0..7e67d20 100644
# check for a .asc file accompanying it - that's our gpg sig on the key
# suck it down and do the check
-@@ -4649,7 +5365,7 @@ class YumBase(depsolve.Depsolve):
+@@ -4649,7 +5362,7 @@ class YumBase(depsolve.Depsolve):
keys_info = misc.getgpgkeyinfo(rawkey, multiple=True)
except ValueError, e:
raise Errors.YumBaseError(_('Invalid GPG Key from %s: %s') %
@@ -153065,7 +153083,7 @@ index 99039e0..7e67d20 100644
keys = []
for keyinfo in keys_info:
thiskey = {}
-@@ -4674,39 +5390,49 @@ class YumBase(depsolve.Depsolve):
+@@ -4674,39 +5387,49 @@ class YumBase(depsolve.Depsolve):
if pkgs:
pkgs = sorted(pkgs)[-1]
msg = (_('Importing %s key 0x%s:\n'
@@ -153133,7 +153151,7 @@ index 99039e0..7e67d20 100644
user_cb_fail = False
for keyurl in keyurls:
keys = self._retrievePublicKey(keyurl, repo)
-@@ -4725,7 +5451,9 @@ class YumBase(depsolve.Depsolve):
+@@ -4725,7 +5448,9 @@ class YumBase(depsolve.Depsolve):
# Try installing/updating GPG key
self._getKeyImportMessage(info, keyurl)
rc = False
@@ -153144,7 +153162,7 @@ index 99039e0..7e67d20 100644
rc = True
# grab the .sig/.asc for the keyurl, if it exists
-@@ -4751,8 +5479,8 @@ class YumBase(depsolve.Depsolve):
+@@ -4751,8 +5476,8 @@ class YumBase(depsolve.Depsolve):
ts = self.rpmdb.readOnlyTS()
result = ts.pgpImportPubkey(misc.procgpgkey(info['raw_key']))
if result != 0:
@@ -153155,7 +153173,7 @@ index 99039e0..7e67d20 100644
self.logger.info(_('Key imported successfully'))
key_installed = True
-@@ -4760,18 +5488,20 @@ class YumBase(depsolve.Depsolve):
+@@ -4760,18 +5485,20 @@ class YumBase(depsolve.Depsolve):
raise Errors.YumBaseError, _("Didn't install any keys")
if not key_installed:
@@ -153181,7 +153199,7 @@ index 99039e0..7e67d20 100644
def _getAnyKeyForRepo(self, repo, destdir, keyurl_list, is_cakey=False, callback=None):
"""
-@@ -4788,6 +5518,18 @@ class YumBase(depsolve.Depsolve):
+@@ -4788,6 +5515,18 @@ class YumBase(depsolve.Depsolve):
"""
key_installed = False
@@ -153200,7 +153218,7 @@ index 99039e0..7e67d20 100644
user_cb_fail = False
for keyurl in keyurl_list:
keys = self._retrievePublicKey(keyurl, repo, getSig=not is_cakey)
-@@ -4819,8 +5561,11 @@ class YumBase(depsolve.Depsolve):
+@@ -4819,8 +5558,11 @@ class YumBase(depsolve.Depsolve):
if not key_installed:
self._getKeyImportMessage(info, keyurl, keytype)
rc = False
@@ -153213,7 +153231,7 @@ index 99039e0..7e67d20 100644
elif callback:
rc = callback({"repo": repo, "userid": info['userid'],
"hexkeyid": info['hexkeyid'], "keyurl": keyurl,
-@@ -4835,7 +5580,8 @@ class YumBase(depsolve.Depsolve):
+@@ -4835,7 +5577,8 @@ class YumBase(depsolve.Depsolve):
# Import the key
result = misc.import_key_to_pubring(info['raw_key'], info['hexkeyid'], gpgdir=destdir)
if not result:
@@ -153223,7 +153241,7 @@ index 99039e0..7e67d20 100644
self.logger.info(_('Key imported successfully'))
key_installed = True
# write out the key id to imported_cakeys in the repos basedir
-@@ -4851,36 +5597,35 @@ class YumBase(depsolve.Depsolve):
+@@ -4851,36 +5594,35 @@ class YumBase(depsolve.Depsolve):
pass
if not key_installed and user_cb_fail:
@@ -153276,7 +153294,41 @@ index 99039e0..7e67d20 100644
self._getAnyKeyForRepo(repo, repo.gpgcadir, repo.gpgcakey, is_cakey=True, callback=callback)
def _limit_installonly_pkgs(self):
-@@ -4959,19 +5704,22 @@ class YumBase(depsolve.Depsolve):
+@@ -4927,6 +5669,7 @@ class YumBase(depsolve.Depsolve):
+ ts = self.rpmdb.readOnlyTS()
+ (cur_kernel_v, cur_kernel_r) = misc.get_running_kernel_version_release(ts)
+ install_only_names = set(self.conf.installonlypkgs)
++ found = {}
+ for m in self.tsInfo.getMembers():
+ if m.ts_state not in ('i', 'u'):
+ continue
+@@ -4937,12 +5680,21 @@ class YumBase(depsolve.Depsolve):
+ if not po_names.intersection(install_only_names):
+ continue
+
+- installed = self.rpmdb.searchNevra(name=m.name)
++ if m.name not in found:
++ found[m.name] = 1
++ else:
++ found[m.name] += 1
++
++ for name in found:
++ installed = self.rpmdb.searchNevra(name=name)
+ installed = _sort_and_filter_installonly(installed)
+- if len(installed) < self.conf.installonly_limit - 1:
+- continue # we're adding one
+
+- numleft = len(installed) - self.conf.installonly_limit + 1
++ total = len(installed) + found[name]
++ if total <= self.conf.installonly_limit:
++ continue # Not adding enough to trigger.
++
++ # Number left to try and remove...
++ numleft = total - self.conf.installonly_limit
+ for po in installed:
+ if (po.version, po.release) == (cur_kernel_v, cur_kernel_r):
+ # don't remove running
+@@ -4959,19 +5711,22 @@ class YumBase(depsolve.Depsolve):
txmbr.depends_on.append(rel)
def processTransaction(self, callback=None,rpmTestDisplay=None, rpmDisplay=None):
@@ -153312,7 +153364,7 @@ index 99039e0..7e67d20 100644
if not callback:
callback = callbacks.ProcessTransNoOutputCallback()
-@@ -5114,13 +5862,19 @@ class YumBase(depsolve.Depsolve):
+@@ -5114,13 +5869,19 @@ class YumBase(depsolve.Depsolve):
return results
def add_enable_repo(self, repoid, baseurls=[], mirrorlist=None, **kwargs):
@@ -153339,7 +153391,7 @@ index 99039e0..7e67d20 100644
# out of place fixme - maybe we should make this the default repo addition
# routine and use it from getReposFromConfigFile(), etc.
newrepo = yumRepo.YumRepository(repoid)
-@@ -5167,9 +5921,15 @@ class YumBase(depsolve.Depsolve):
+@@ -5167,9 +5928,15 @@ class YumBase(depsolve.Depsolve):
def setCacheDir(self, force=False, tmpdir=None, reuse=True,
suffix='/$basearch/$releasever'):
@@ -153358,7 +153410,7 @@ index 99039e0..7e67d20 100644
if not force and os.geteuid() == 0:
return True # We are root, not forced, so happy with the global dir.
if tmpdir is None:
-@@ -5179,7 +5939,7 @@ class YumBase(depsolve.Depsolve):
+@@ -5179,7 +5946,7 @@ class YumBase(depsolve.Depsolve):
try:
cachedir = misc.getCacheDir(tmpdir, reuse)
except (IOError, OSError), e:
@@ -153367,7 +153419,7 @@ index 99039e0..7e67d20 100644
cachedir = None
if cachedir is None:
-@@ -5220,13 +5980,24 @@ class YumBase(depsolve.Depsolve):
+@@ -5220,13 +5987,24 @@ class YumBase(depsolve.Depsolve):
self.history.write_addon_data('config-repos', myrepos)
def verify_plugins_cb(self, verify_package):
@@ -153395,7 +153447,7 @@ index 99039e0..7e67d20 100644
if self.tsInfo._unresolvedMembers:
if auto:
self.logger.critical(_("Dependencies not solved. Will not save unresolved transaction."))
-@@ -5234,7 +6005,7 @@ class YumBase(depsolve.Depsolve):
+@@ -5234,7 +6012,7 @@ class YumBase(depsolve.Depsolve):
raise Errors.YumBaseError(_("Dependencies not solved. Will not save unresolved transaction."))
if not filename:
@@ -153404,7 +153456,7 @@ index 99039e0..7e67d20 100644
fd,filename = tempfile.mkstemp(suffix='.yumtx', prefix=prefix)
f = os.fdopen(fd, 'w')
else:
-@@ -5244,13 +6015,17 @@ class YumBase(depsolve.Depsolve):
+@@ -5244,13 +6022,17 @@ class YumBase(depsolve.Depsolve):
msg = "%s\n" % self.rpmdb.simpleVersion(main_only=True)[0]
msg += "%s\n" % self.ts.getTsFlags()
@@ -153425,7 +153477,7 @@ index 99039e0..7e67d20 100644
msg += "%s\n" % len(self.tsInfo.getMembers())
for txmbr in self.tsInfo.getMembers():
msg += txmbr._dump()
-@@ -5260,13 +6035,25 @@ class YumBase(depsolve.Depsolve):
+@@ -5260,13 +6042,25 @@ class YumBase(depsolve.Depsolve):
except (IOError, OSError), e:
self._ts_save_file = None
if auto:
@@ -153457,7 +153509,7 @@ index 99039e0..7e67d20 100644
# check rpmversion - if not match throw a fit
# check repoversions (and repos)- if not match throw a fit
# load each txmbr - if pkgs being updated don't exist, bail w/error
-@@ -5276,26 +6063,45 @@ class YumBase(depsolve.Depsolve):
+@@ -5276,26 +6070,45 @@ class YumBase(depsolve.Depsolve):
try:
data = open(filename, 'r').readlines()
except (IOError, OSError), e:
@@ -153505,7 +153557,7 @@ index 99039e0..7e67d20 100644
if ignorerpm:
msg += _(" ignoring, as requested.")
self.logger.critical(_(msg))
-@@ -5318,8 +6124,17 @@ class YumBase(depsolve.Depsolve):
+@@ -5318,8 +6131,17 @@ class YumBase(depsolve.Depsolve):
numrepos = int(data[2].strip())
repos = []
rindex=3+numrepos
@@ -153524,7 +153576,7 @@ index 99039e0..7e67d20 100644
# pkgs/txmbrs
numpkgs = int(data[rindex].strip())
-@@ -5329,6 +6144,7 @@ class YumBase(depsolve.Depsolve):
+@@ -5329,6 +6151,7 @@ class YumBase(depsolve.Depsolve):
pkgcount = 0
pkgprob = False
curpkg = None
@@ -153532,7 +153584,7 @@ index 99039e0..7e67d20 100644
for l in data[pkgstart:]:
l = l.rstrip()
# our main txmbrs
-@@ -5438,6 +6254,11 @@ class YumBase(depsolve.Depsolve):
+@@ -5438,6 +6261,11 @@ class YumBase(depsolve.Depsolve):
msg += _(" aborting.")
raise Errors.YumBaseError(msg)
@@ -155967,7 +156019,7 @@ index aaa4f25..51895fd 100755
continue
diff --git a/yum/misc.py b/yum/misc.py
-index 2f6ddfe..e3952b5 100644
+index 2f6ddfe..55c433a 100644
--- a/yum/misc.py
+++ b/yum/misc.py
@@ -8,6 +8,7 @@ import os
@@ -155996,7 +156048,16 @@ index 2f6ddfe..e3952b5 100644
def getgpgkeyinfo(rawkey, multiple=False):
'''Return a dict of info for the given ASCII armoured key text
-@@ -940,14 +952,16 @@ def unlink_f(filename):
+@@ -746,6 +758,8 @@ def _decompress_chunked(source, dest, ztype):
+ data = s_fn.read(1024000)
+ except IOError:
+ break
++ except EOFError:
++ break
+
+ if not data: break
+
+@@ -940,14 +954,16 @@ def unlink_f(filename):
if e.errno != errno.ENOENT:
raise
@@ -156017,7 +156078,7 @@ index 2f6ddfe..e3952b5 100644
def _getloginuid():
""" Get the audit-uid/login-uid, if available. None is returned if there
-@@ -992,9 +1006,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:
@@ -156038,7 +156099,7 @@ index 2f6ddfe..e3952b5 100644
def get_my_lang_code():
-@@ -1112,10 +1134,12 @@ def decompress(filename, dest=None, fn_only=False, check_timestamps=False):
+@@ -1112,10 +1136,12 @@ def decompress(filename, dest=None, fn_only=False, check_timestamps=False):
if check_timestamps:
fi = stat_f(filename)
fo = stat_f(out)
@@ -156348,6 +156409,23 @@ index 5ef9951..da31971 100644
def _is_pre_req(self, flag):
"""check the flags for a requirement, return 1 or 0 whether or not requires
+diff --git a/yum/parser.py b/yum/parser.py
+index fccf528..f443ce7 100644
+--- a/yum/parser.py
++++ b/yum/parser.py
+@@ -73,7 +73,11 @@ class ConfigPreProcessor:
+ if scheme == '':
+ # check it to make sure it's not a relative file url
+ if configfile[0] != '/':
+- configfile = os.getcwd() + '/' + configfile
++ try:
++ rootdir = os.getcwd() + "/"
++ except:
++ rootdir = "/"
++ configfile = rootdir + configfile
+ url = 'file://' + configfile
+ else:
+ url = configfile
diff --git a/yum/pgpmsg.py b/yum/pgpmsg.py
index ee825c6..dae60c9 100644
--- a/yum/pgpmsg.py
@@ -157293,7 +157371,7 @@ index 2cb1acb..7da6a08 100644
self._md[item] = val
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
-index e5e9ece..76e05d2 100644
+index e5e9ece..a739a55 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -20,10 +20,12 @@ import time
@@ -157343,7 +157421,90 @@ index e5e9ece..76e05d2 100644
def populate(self, repo, mdtype='metadata', callback=None, cacheonly=0):
if mdtype == 'all':
data = ['metadata', 'filelists', 'otherdata']
-@@ -285,6 +307,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -162,6 +184,25 @@ class YumPackageSack(packageSack.PackageSack):
+ continue
+
+ if self._check_db_version(repo, mydbtype):
++ # Use gen decompression on DB files. Keeps exactly what we
++ # downloaded in the download dir.
++
++ # Backwards compat. ... try the old uncompressed version first.
++ db_un_fn = self._check_uncompressed_db(repo, mydbtype)
++ if not db_un_fn:
++ db_un_fn = self._check_uncompressed_db_gen(repo, mydbtype)
++
++ if not db_un_fn:
++ db_fn = repo._retrieveMD(mydbtype)
++ if db_fn:
++ db_un_fn = self._check_uncompressed_db_gen(repo,
++ mydbtype)
++ if not db_un_fn: # Shouldn't happen?
++ raise URLGrabError(-1, 'Check uncompressed DB failed')
++
++ dobj = repo.cacheHandler.open_database(db_un_fn)
++
++ elif self._check_db_version(repo, mydbtype):
+ # see if we have the uncompressed db and check it's checksum vs the openchecksum
+ # if not download the compressed file
+ # decompress it
+@@ -180,7 +221,17 @@ class YumPackageSack(packageSack.PackageSack):
+
+ else:
+ repo._xml2sqlite_local = True
++ # Download...
+ xml = repo_get_function()
++
++ # Use generated dir. and handle compression types metadata
++ # parser doesn't understand.
++ gen = mymdtype + '.xml'
++ ret = misc.repo_gen_decompress(xml, gen, cached=repo.cache)
++ if not ret:
++ raise URLGrabError(-1, 'Decompress DB failed')
++ xml = ret
++ # Convert XML => .sqlite
+ xmldata = repo.repoXML.getData(mymdtype)
+ (ctype, csum) = xmldata.checksum
+ dobj = repo_cache_function(xml, csum)
+@@ -193,6 +244,25 @@ class YumPackageSack(packageSack.PackageSack):
+ # get rid of all this stuff we don't need now
+ del repo.cacheHandler
+
++ def _check_uncompressed_db_gen(self, repo, mdtype, fast=True):
++ """return file name of db in gen/ dir if good, None if not"""
++
++ mydbdata = repo.repoXML.getData(mdtype)
++ (r_base, remote) = mydbdata.location
++ fname = os.path.basename(remote)
++ compressed_fn = repo.cachedir + '/' + fname
++ db_un_fn = mdtype + '.sqlite'
++
++ if not repo._checkMD(compressed_fn, mdtype, data=mydbdata,
++ check_can_fail=fast, fast=fast):
++ return None
++
++ ret = misc.repo_gen_decompress(compressed_fn, db_un_fn,
++ cached=repo.cache)
++ if ret:
++ return self._check_uncompressed_db_fn(repo, mdtype, ret)
++ return None
++
+ def _check_uncompressed_db(self, repo, mdtype):
+ """return file name of uncompressed db is good, None if not"""
+ mydbdata = repo.repoXML.getData(mdtype)
+@@ -201,9 +271,11 @@ class YumPackageSack(packageSack.PackageSack):
+ compressed_fn = repo.cachedir + '/' + fname
+ db_un_fn = misc.decompress(compressed_fn, fn_only=True)
+
++ return self._check_uncompressed_db_fn(repo, mdtype, db_un_fn)
++
++ def _check_uncompressed_db_fn(self, repo, mdtype, db_un_fn):
+ result = None
+
+- repo._preload_md_from_system_cache(os.path.basename(db_un_fn))
+ if os.path.exists(db_un_fn):
+ if skip_old_DBMD_check and repo._using_old_MD:
+ return db_un_fn
+@@ -285,6 +357,7 @@ class YumRepository(Repository, config.RepoConf):
self._grabfunc = None
self._grab = None
@@ -157351,7 +157512,7 @@ index e5e9ece..76e05d2 100644
def __cmp__(self, other):
""" Sort yum repos. by cost, and then by alphanumeric on their id. """
-@@ -431,25 +454,18 @@ class YumRepository(Repository, config.RepoConf):
+@@ -431,25 +504,18 @@ class YumRepository(Repository, config.RepoConf):
self._proxy_dict = {} # zap it
proxy_string = None
empty = (None, '_none_', '')
@@ -157385,7 +157546,7 @@ index e5e9ece..76e05d2 100644
if proxy_string is not None:
self._proxy_dict['http'] = proxy_string
-@@ -488,8 +504,20 @@ class YumRepository(Repository, config.RepoConf):
+@@ -488,8 +554,20 @@ class YumRepository(Repository, config.RepoConf):
copy_local=self.copy_local,
reget='simple',
**ugopts)
@@ -157407,7 +157568,7 @@ index e5e9ece..76e05d2 100644
failure_callback=self.mirror_failure_obj)
def _default_grabopts(self, cache=True):
-@@ -499,6 +527,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -499,6 +577,7 @@ class YumRepository(Repository, config.RepoConf):
'throttle': self.throttle,
'proxies': self.proxy_dict,
'timeout': self.timeout,
@@ -157415,7 +157576,7 @@ index e5e9ece..76e05d2 100644
'http_headers': tuple(self.__headersListFromDict(cache=cache)),
'ssl_verify_peer': self.sslverify,
'ssl_verify_host': self.sslverify,
-@@ -751,7 +780,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -751,7 +830,7 @@ class YumRepository(Repository, config.RepoConf):
def _getFile(self, url=None, relative=None, local=None, start=None, end=None,
copy_local=None, checkfunc=None, text=None, reget='simple',
@@ -157424,7 +157585,7 @@ index e5e9ece..76e05d2 100644
"""retrieve file from the mirrorgroup for the repo
relative to local, optionally get range from
start to end, also optionally retrieve from a specific baseurl"""
-@@ -796,6 +825,16 @@ class YumRepository(Repository, config.RepoConf):
+@@ -796,6 +875,16 @@ class YumRepository(Repository, config.RepoConf):
except Errors.MediaError, e:
verbose_logger.log(logginglevels.DEBUG_2, "Error getting package from media; falling back to url %s" %(e,))
@@ -157441,7 +157602,7 @@ index e5e9ece..76e05d2 100644
if url and scheme != "media":
ugopts = self._default_grabopts(cache=cache)
ug = URLGrabber(progress_obj = self.callback,
-@@ -835,7 +874,8 @@ class YumRepository(Repository, config.RepoConf):
+@@ -835,7 +924,8 @@ class YumRepository(Repository, config.RepoConf):
reget = reget,
checkfunc=checkfunc,
http_headers=headers,
@@ -157451,7 +157612,7 @@ index e5e9ece..76e05d2 100644
)
except URLGrabError, e:
errstr = "failure: %s from %s: %s" % (relative, self.id, e)
-@@ -847,7 +887,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -847,7 +937,7 @@ class YumRepository(Repository, config.RepoConf):
return result
__get = _getFile
@@ -157460,7 +157621,7 @@ index e5e9ece..76e05d2 100644
remote = package.relativepath
local = package.localPkg()
basepath = package.basepath
-@@ -864,6 +904,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -864,6 +954,7 @@ class YumRepository(Repository, config.RepoConf):
text=text,
cache=cache,
size=package.size,
@@ -157468,7 +157629,15 @@ index e5e9ece..76e05d2 100644
)
def getHeader(self, package, checkfunc = None, reget = 'simple',
-@@ -1020,7 +1061,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -998,6 +1089,7 @@ class YumRepository(Repository, config.RepoConf):
+
+ def _getFileRepoXML(self, local, text=None, grab_can_fail=None):
+ """ Call _getFile() for the repomd.xml file. """
++ import traceback; traceback.print_stack()
+ checkfunc = (self._checkRepoXML, (), {})
+ if grab_can_fail is None:
+ grab_can_fail = 'old_repo_XML' in self._oldRepoMDData
+@@ -1020,7 +1112,7 @@ class YumRepository(Repository, config.RepoConf):
if grab_can_fail:
return None
raise Errors.RepoError, 'Error downloading file %s: %s' % (local, e)
@@ -157477,7 +157646,7 @@ index e5e9ece..76e05d2 100644
misc.unlink_f(tfname)
if grab_can_fail:
return None
-@@ -1260,6 +1301,9 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1260,6 +1352,9 @@ class YumRepository(Repository, config.RepoConf):
return True
def _check_db_version(self, mdtype, repoXML=None):
@@ -157487,7 +157656,22 @@ index e5e9ece..76e05d2 100644
if repoXML is None:
repoXML = self.repoXML
if mdtype in repoXML.repoData:
-@@ -1302,6 +1346,17 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1277,11 +1372,11 @@ class YumRepository(Repository, config.RepoConf):
+ return None
+
+ if not file_check:
+- compressed = dbmdtype.endswith("_db")
+- local = self._get_mdtype_fname(data, compressed)
++ compressed = False
++ local = self._get_mdtype_fname(data)
+ else:
+ compressed = False
+- local = self._get_mdtype_fname(data, False)
++ local = self._get_mdtype_fname(data)
+ if not os.path.exists(local):
+ local = misc.decompress(local, fn_only=True)
+ compressed = True
+@@ -1302,6 +1397,17 @@ class YumRepository(Repository, config.RepoConf):
into the delete list, this means metadata can change filename
without us leaking it. """
@@ -157505,7 +157689,7 @@ index e5e9ece..76e05d2 100644
def _mdtype_eq(omdtype, odata, nmdtype, ndata):
""" Check if two returns from _get_mdtype_data() are equal. """
if ndata is None:
-@@ -1333,8 +1388,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1333,8 +1439,7 @@ class YumRepository(Repository, config.RepoConf):
# Inited twice atm. ... sue me
self._oldRepoMDData['new_MD_files'] = []
@@ -157515,7 +157699,7 @@ index e5e9ece..76e05d2 100644
for mdtype in all_mdtypes:
(nmdtype, ndata) = self._get_mdtype_data(mdtype)
-@@ -1371,43 +1425,20 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1371,43 +1476,16 @@ class YumRepository(Repository, config.RepoConf):
# No old repomd data, but we might still have uncompressed MD
if self._groupCheckDataMDValid(ndata, nmdtype, mdtype):
continue
@@ -157526,9 +157710,7 @@ index e5e9ece..76e05d2 100644
- downloading_no_size.append((ndata, nmdtype))
- else:
- downloading_with_size.append((ndata, nmdtype))
-+ def _commonRetrieveDataMD_done(self, downloading):
-+ """ Uncompress the downloaded metadata """
-
+-
- if len(downloading_with_size) == 1:
- downloading_no_size.extend(downloading_with_size)
- downloading_with_size = []
@@ -157549,14 +157731,16 @@ index e5e9ece..76e05d2 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)
- if nmdtype.endswith("_db"): # Uncompress any compressed files
- dl_local = local
- local = misc.decompress(dl_local)
- misc.unlink_f(dl_local)
+- if nmdtype.endswith("_db"): # Uncompress any compressed files
+- dl_local = local
+- local = misc.decompress(dl_local)
+- misc.unlink_f(dl_local)
self._oldRepoMDData['new_MD_files'].append(local)
-
self._doneOldRepoXML()
@@ -157564,7 +157748,7 @@ index e5e9ece..76e05d2 100644
def _groupLoadRepoXML(self, text=None, mdtypes=None):
""" Retrieve the new repomd.xml from the repository, then check it
-@@ -1421,7 +1452,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1421,7 +1499,7 @@ class YumRepository(Repository, config.RepoConf):
self._commonRetrieveDataMD(mdtypes)
def _mdpolicy2mdtypes(self):
@@ -157573,7 +157757,7 @@ index e5e9ece..76e05d2 100644
'group:primary' : ['primary'],
'group:small' : ["primary", "updateinfo"],
'group:main' : ["primary", "group", "filelists",
-@@ -1436,6 +1467,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1436,6 +1514,7 @@ class YumRepository(Repository, config.RepoConf):
if not mdtypes or 'group:all' in mdtypes:
mdtypes = None
else:
@@ -157581,7 +157765,7 @@ index e5e9ece..76e05d2 100644
mdtypes = sorted(list(mdtypes))
return mdtypes
-@@ -1451,12 +1483,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1451,12 +1530,7 @@ class YumRepository(Repository, config.RepoConf):
def _getRepoXML(self):
if self._repoXML:
return self._repoXML
@@ -157595,7 +157779,43 @@ index e5e9ece..76e05d2 100644
return self._repoXML
-@@ -1559,7 +1586,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1514,7 +1588,7 @@ class YumRepository(Repository, config.RepoConf):
+ return self._checkMD(fn, mdtype, openchecksum)
+
+ def _checkMD(self, fn, mdtype, openchecksum=False,
+- data=None, check_can_fail=False):
++ data=None, check_can_fail=False, fast=False):
+ """ Internal function, use .checkMD() from outside yum. """
+
+ thisdata = data # So the argument name is nicer
+@@ -1537,6 +1611,18 @@ class YumRepository(Repository, config.RepoConf):
+ if size is not None:
+ size = int(size)
+
++ if fast:
++ fsize = misc.stat_f(file)
++ if fsize is None: # File doesn't exist...
++ return None
++ if size is None:
++ return 1
++ if size == fsize.st_size:
++ return 1
++ if check_can_fail:
++ return None
++ raise URLGrabError(-1, 'Metadata file does not match size')
++
+ try: # get the local checksum
+ l_csum = self._checksum(r_ctype, file, datasize=size)
+ except Errors.RepoError, e:
+@@ -1551,15 +1637,13 @@ class YumRepository(Repository, config.RepoConf):
+ return None
+ raise URLGrabError(-1, 'Metadata file does not match checksum')
+
+-
+-
+ def retrieveMD(self, mdtype):
+ """base function to retrieve metadata files from the remote url
+ returns the path to the local metadata file of a 'mdtype'
mdtype can be 'primary', 'filelists', 'other' or 'group'."""
return self._retrieveMD(mdtype)
@@ -157604,7 +157824,7 @@ index e5e9ece..76e05d2 100644
""" Internal function, use .retrieveMD() from outside yum. """
# Note that this can raise Errors.RepoMDError if mdtype doesn't exist
# for this repo.
-@@ -1597,7 +1624,9 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1597,7 +1681,9 @@ class YumRepository(Repository, config.RepoConf):
return local # it's the same return the local one
try:
@@ -157615,7 +157835,7 @@ index e5e9ece..76e05d2 100644
text = "%s/%s" % (self.id, mdtype)
if thisdata.size is None:
reget = None
-@@ -1613,8 +1642,9 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1613,8 +1699,9 @@ class YumRepository(Repository, config.RepoConf):
checkfunc=checkfunc,
text=text,
cache=self.http_caching == 'all',
@@ -157627,7 +157847,7 @@ index e5e9ece..76e05d2 100644
if retrieve_can_fail:
return None
raise
-@@ -1624,7 +1654,6 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1624,7 +1711,6 @@ class YumRepository(Repository, config.RepoConf):
raise Errors.RepoError, \
"Could not retrieve %s matching remote checksum from %s" % (local, self)
else:
diff --git a/yum.spec b/yum.spec
index 98d3484..9a97104 100644
--- a/yum.spec
+++ b/yum.spec
@@ -313,6 +313,13 @@ exit 0
%endif
%changelog
+* Mon May 14 2012 Zdenek Pavlas <zpavlas at redhat.com> - 3.4.3-25
+- update to latest HEAD.
+- merged multi-downloader code
+- rebased yum-ppc64-preferred.patch
+- dropped arm-arch-detection.patch (moved to HEAD)
+- renamed yum-update.cron to 0yum-update.cron
+
* Fri Apr 27 2012 James Antill <james at fedoraproject.org> - 3.4.3-24
- Add code for arm detection.
More information about the scm-commits
mailing list