From d5b7fb97da76801ee636c7a37302b858cb98619b Mon Sep 17 00:00:00 2001 From: James Antill Date: Fri, 10 Aug 2012 16:10:38 -0400 Subject: [PATCH 01/24] update to latest HEAD. - Big update, mostly for "environment groups". --- yum-HEAD.patch | 2414 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 1990 insertions(+), 424 deletions(-) diff --git a/yum-HEAD.patch b/yum-HEAD.patch index e1b3d73..5eda0fc 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..597efd6 +index 6056d38..8f8fdf9 --- a/cli.py +++ b/cli.py @@ -25,7 +25,7 @@ import sys @@ -253,6 +253,18 @@ index 6056d38..597efd6 except ValueError, e: self.logger.critical(_('Options Error: %s'), e) sys.exit(1) +@@ -290,9 +324,9 @@ class YumBaseCli(yum.YumBase, output.YumOutput): + self.term.MODE['normal']) + print _(" Installed: %s-%s at %s") %(name, ver, + sm_ui_time(pkg.installtime)) +- print _(" Built : %s at %s") % (pkg.packager, ++ print _(" Built : %s at %s") % (to_unicode(pkg.packager), + sm_ui_time(pkg.buildtime)) +- print _(" Committed: %s at %s") % (pkg.committer, ++ print _(" Committed: %s at %s") % (to_unicode(pkg.committer), + sm_ui_date(pkg.committime)) + sys.exit(0) + @@ -318,9 +352,11 @@ class YumBaseCli(yum.YumBase, output.YumOutput): time.sleep(sleeptime) @@ -494,7 +506,7 @@ index 6056d38..597efd6 # get the list of available packages # iterate over the user's list # add packages to Transaction holding class if they match. -@@ -710,11 +822,26 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -710,11 +822,36 @@ class YumBaseCli(yum.YumBase, output.YumOutput): for arg in userlist: if (arg.endswith('.rpm') and (yum.misc.re_remote_url(arg) or os.path.exists(arg))): @@ -509,12 +521,22 @@ index 6056d38..597efd6 + elif basecmd == 'install-n': + txmbrs = self.install(name=arg) + elif basecmd == 'install-na': -+ n,a = arg.split('.') ++ try: ++ n,a = arg.rsplit('.', 1) ++ except: ++ self.verbose_logger.warning(_('Bad %s argument %s.'), ++ basecmd, arg) ++ continue + txmbrs = self.install(name=n, arch=a) + elif basecmd == 'install-nevra': -+ nevr,a = arg.rsplit('.', 2) -+ n,ev,r = nevr.rsplit('-', 3) -+ e,v = ev.split(':', 2) ++ try: ++ nevr,a = arg.rsplit('.', 1) ++ n,ev,r = nevr.rsplit('-', 2) ++ e,v = ev.split(':', 1) ++ except: ++ self.verbose_logger.warning(_('Bad %s argument %s.'), ++ basecmd, arg) ++ continue + txmbrs = self.install(name=n, + epoch=e, version=v, release=r, arch=a) + else: @@ -523,7 +545,7 @@ index 6056d38..597efd6 except yum.Errors.InstallError: self.verbose_logger.log(yum.logginglevels.INFO_2, _('No package %s%s%s available.'), -@@ -723,6 +850,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -723,6 +860,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput): self._maybeYouMeant(arg) else: done = True @@ -531,7 +553,7 @@ index 6056d38..597efd6 if len(self.tsInfo) > oldcount: change = len(self.tsInfo) - oldcount return 2, [P_('%d package to install', '%d packages to install', change) % change] -@@ -732,9 +860,27 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -732,9 +870,27 @@ class YumBaseCli(yum.YumBase, output.YumOutput): return 0, [_('Nothing to do')] def updatePkgs(self, userlist, quiet=0, update_to=False): @@ -562,7 +584,7 @@ index 6056d38..597efd6 # if there is no userlist, then do global update below # this is probably 90% of the calls # if there is a userlist then it's for updating pkgs, not obsoleting -@@ -745,21 +891,18 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -745,21 +901,18 @@ class YumBaseCli(yum.YumBase, output.YumOutput): else: # go through the userlist - look for items that are local rpms. If we find them @@ -593,7 +615,7 @@ index 6056d38..597efd6 if len(self.tsInfo) > oldcount: change = len(self.tsInfo) - oldcount -@@ -770,9 +913,24 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -770,9 +923,24 @@ class YumBaseCli(yum.YumBase, output.YumOutput): # Note that we aren't in __init__ yet for a couple of reasons, but we # probably will get there for 3.2.28. def distroSyncPkgs(self, userlist): @@ -621,7 +643,7 @@ index 6056d38..597efd6 level = 'diff' if userlist and userlist[0] in ('full', 'diff', 'different'): -@@ -831,6 +989,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -831,6 +999,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput): continue nayi = napkg.yumdb_info @@ -629,14 +651,16 @@ index 6056d38..597efd6 for apkg in self.pkgSack.searchPkgTuple(napkg.pkgtup): if ('checksum_type' in nayi and 'checksum_data' in nayi and -@@ -866,10 +1025,19 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -865,15 +1034,54 @@ class YumBaseCli(yum.YumBase, output.YumOutput): + else: return 0, [_('No Packages marked for Distribution Synchronization')] - def erasePkgs(self, userlist): +- def erasePkgs(self, userlist): - """take user commands and populate a transaction wrapper with packages - to be erased/removed""" - - oldcount = len(self.tsInfo) ++ def erasePkgs(self, userlist, pos=False, basecmd='remove'): + """Take user commands and populate a transaction wrapper with + packages to be erased. + @@ -653,7 +677,42 @@ index 6056d38..597efd6 all_rms = [] for arg in userlist: -@@ -884,12 +1052,24 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +- rms = self.remove(pattern=arg) ++ if pos: ++ rms = self.remove(po=arg) ++ if rms: ++ all_rms.extend(rms) ++ continue ++ ++ if False: pass ++ elif basecmd in ('erase-n', 'remove-n'): ++ rms = self.remove(name=arg) ++ elif basecmd in ('erase-na', 'remove-na'): ++ try: ++ n,a = arg.rsplit('.', 1) ++ except: ++ self.verbose_logger.warning(_('Bad %s argument %s.'), ++ basecmd, arg) ++ continue ++ rms = self.remove(name=n, arch=a) ++ elif basecmd in ('erase-nevra', 'remove-nevra'): ++ try: ++ nevr,a = arg.rsplit('.', 1) ++ n,ev,r = nevr.rsplit('-', 2) ++ e,v = ev.split(':', 1) ++ except: ++ self.verbose_logger.warning(_('Bad %s argument %s.'), ++ basecmd, arg) ++ continue ++ rms = self.remove(name=n, epoch=e, version=v, release=r, arch=a) ++ else: ++ assert basecmd in ('erase', 'remove'), basecmd ++ rms = self.remove(pattern=arg) ++ + if not rms: + self._checkMaybeYouMeant(arg, always_output=False, rpmdb_only=True) + all_rms.extend(rms) +@@ -884,12 +1092,24 @@ class YumBaseCli(yum.YumBase, output.YumOutput): return 0, [_('No Packages marked for removal')] def downgradePkgs(self, userlist): @@ -681,7 +740,7 @@ index 6056d38..597efd6 for arg in userlist: if (arg.endswith('.rpm') and (yum.misc.re_remote_url(arg) or os.path.exists(arg))): -@@ -905,26 +1085,44 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -905,26 +1125,44 @@ class YumBaseCli(yum.YumBase, output.YumOutput): self.term.MODE['bold'], arg, self.term.MODE['normal']) self._maybeYouMeant(arg) @@ -730,7 +789,7 @@ index 6056d38..597efd6 except yum.Errors.ReinstallRemoveError: self._checkMaybeYouMeant(arg, always_output=False) except yum.Errors.ReinstallInstallError, e: -@@ -940,15 +1138,31 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -940,15 +1178,31 @@ class YumBaseCli(yum.YumBase, output.YumOutput): except yum.Errors.ReinstallError, e: assert False, "Shouldn't happen, but just in case" self.verbose_logger.log(yum.logginglevels.INFO_2, e) @@ -765,7 +824,7 @@ index 6056d38..597efd6 # read in each package into a YumLocalPackage Object # append it to self.localPackages # check if it can be installed or updated based on nevra versus rpmdb -@@ -972,20 +1186,25 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -972,20 +1226,25 @@ class YumBaseCli(yum.YumBase, output.YumOutput): return 0, [_('Nothing to do')] def returnPkgLists(self, extcmds, installed_available=False): @@ -805,7 +864,7 @@ index 6056d38..597efd6 special = ['available', 'installed', 'all', 'extras', 'updates', 'recent', 'obsoletes'] -@@ -1017,8 +1236,25 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -1017,8 +1276,25 @@ class YumBaseCli(yum.YumBase, output.YumOutput): return ypl def search(self, args): @@ -833,7 +892,7 @@ index 6056d38..597efd6 # call the yum module search function with lists of tags to search # and what to search for -@@ -1108,9 +1344,20 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -1108,9 +1384,20 @@ class YumBaseCli(yum.YumBase, output.YumOutput): return 0, matching def deplist(self, args): @@ -842,13 +901,13 @@ index 6056d38..597efd6 + """Print out a formatted list of dependencies for a list of + packages. This is a cli wrapper method for + :class:`yum.YumBase.findDeps`. -+ + + :param args: a list of names or wildcards specifying packages + that should have their dependenices printed + :return: (exit_code, [ errors ]) + + 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 @@ -856,7 +915,7 @@ index 6056d38..597efd6 pkgs = [] for arg in args: if (arg.endswith('.rpm') and (yum.misc.re_remote_url(arg) or -@@ -1131,10 +1378,19 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -1131,10 +1418,19 @@ class YumBaseCli(yum.YumBase, output.YumOutput): return 0, [] def provides(self, args): @@ -880,7 +939,7 @@ index 6056d38..597efd6 old_sdup = self.conf.showdupesfromrepos # For output, as searchPackageProvides() is always in showdups mode self.conf.showdupesfromrepos = True -@@ -1147,6 +1403,8 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -1147,6 +1443,8 @@ class YumBaseCli(yum.YumBase, output.YumOutput): paths = set(sys.path + os.environ['PATH'].split(':')) nargs = [] for arg in args: @@ -889,7 +948,7 @@ index 6056d38..597efd6 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): +@@ -1163,20 +1461,77 @@ class YumBaseCli(yum.YumBase, output.YumOutput): return 0, [] def resolveDepCli(self, args): @@ -972,13 +1031,14 @@ index 6056d38..597efd6 hdrcode = pkgcode = xmlcode = dbcode = expccode = 0 pkgresults = hdrresults = xmlresults = dbresults = expcresults = [] msg = self.fmtKeyValFill(_('Cleaning repos: '), -@@ -1228,7 +1543,19 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -1228,130 +1583,248 @@ class YumBaseCli(yum.YumBase, output.YumOutput): return code, [] def returnGroupLists(self, userlist): + """Print out a list of groups that match the given names or + wildcards. +- uservisible=1 + :param extcmds: a list of names or wildcards specifying + groups to list + :return: (exit_code, [ errors ]) @@ -989,61 +1049,256 @@ index 6056d38..597efd6 + 1 = we've errored, exit with error string + 2 = we've got work yet to do, onto the next stage + """ - uservisible=1 ++ return self._returnGroupLists(userlist) ++ ++ def _returnGroupLists(self, userlist, summary=False): ++ # What data are we showing... ++ wts_map = {'hidden' : 'hidden', ++ 'language' : 'lang', ++ 'languages' : 'lang', ++ 'lang' : 'lang', ++ 'langs' : 'lang', ++ 'environment' : 'env', ++ 'environments' : 'env', ++ 'env' : 'env', ++ 'envs' : 'env', ++ 'package' : 'pkg', ++ 'packages' : 'pkg', ++ 'pkg' : 'pkg', ++ 'pkgs' : 'pkg', ++ 'available' : 'avail', ++ 'avail' : 'avail', ++ 'installed' : 'inst', ++ 'inst' : 'inst', ++ 'id' : 'id', ++ 'ids' : 'id', ++ } ++ verb = self.verbose_logger.isEnabledFor(yum.logginglevels.DEBUG_3) ++ wts = {'hidden' : False, ++ 'lang' : False, ++ 'env' : True, ++ 'pkg' : True, ++ 'inst' : True, ++ 'avail' : True, ++ 'id' : verb} - if len(userlist) > 0: -@@ -1254,7 +1581,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput): - msg += ' (%s)' % group.groupid - if group.langonly: - msg += ' [%s]' % group.langonly -- self.verbose_logger.log(yum.logginglevels.INFO_2, '%s', msg) -+ self.verbose_logger.info('%s', msg) +- if len(userlist) > 0: +- if userlist[0] == 'hidden': +- uservisible=0 +- userlist.pop(0) ++ while userlist: ++ arg = userlist[0] ++ val = True ++ if arg.startswith('no'): ++ arg = arg[2:] ++ val = False ++ if arg not in wts_map: ++ break ++ wts[wts_map[arg]] = val ++ userlist.pop(0) + if not userlist: + userlist = None # Match everything... - done = False +- installed, available = self.doGroupLists(uservisible=uservisible, +- patterns=userlist) ++ uv = not wts['hidden'] ++ dGL = self.doGroupLists(patterns=userlist, ++ uservisible=uv, return_evgrps=True) ++ ++ installed, available, ievgrps, evgrps = dGL ++ ++ if not wts['env']: ++ ievgrps = [] ++ evgrps = [] ++ ++ if not wts['inst']: ++ installed = [] ++ ievgrps = [] ++ if not wts['avail']: ++ available = [] ++ evgrps = [] + +- if not installed and not available: +- self.logger.error(_('Warning: No groups match: %s'), +- ", ".join(userlist)) +- return 0, [] ++ done = [] ++ def _out_grp(sect, groups): ++ if not groups: ++ return + +- def _out_grp(sect, group): +- if not done: +- self.verbose_logger.log(yum.logginglevels.INFO_2, sect) +- msg = ' %s' % group.ui_name +- if self.verbose_logger.isEnabledFor(yum.logginglevels.DEBUG_3): +- msg += ' (%s)' % group.groupid +- if group.langonly: +- msg += ' [%s]' % group.langonly +- self.verbose_logger.log(yum.logginglevels.INFO_2, '%s', msg) ++ done.append(sect) ++ if summary: ++ self.verbose_logger.log(yum.logginglevels.INFO_2, ++ "%s %u", sect, len(groups)) ++ return + +- done = False ++ self.verbose_logger.log(yum.logginglevels.INFO_2, sect) ++ ++ for group in groups: ++ msg = ' %s' % group.ui_name ++ if wts['id']: ++ msg += ' (%s)' % group.compsid ++ if group.langonly: ++ msg += ' [%s]' % group.langonly ++ self.verbose_logger.info('%s', msg) ++ ++ _out_grp(_('Installed Environment Groups:'), ievgrps) ++ _out_grp(_('Available Environment Groups:'), evgrps) ++ ++ groups = [] for group in installed: -@@ -1283,7 +1610,20 @@ class YumBaseCli(yum.YumBase, output.YumOutput): + if group.langonly: continue +- _out_grp(_('Installed Groups:'), group) +- done = True ++ if not wts['pkg']: continue ++ groups.append(group) ++ _out_grp(_('Installed Groups:'), groups) + +- done = False ++ groups = [] + for group in installed: + if not group.langonly: continue +- _out_grp(_('Installed Language Groups:'), group) +- done = True ++ if not wts['lang']: continue ++ groups.append(group) ++ _out_grp(_('Installed Language Groups:'), groups) + +- done = False ++ groups = [] + for group in available: + if group.langonly: continue +- _out_grp(_('Available Groups:'), group) +- done = True ++ if not wts['pkg']: continue ++ groups.append(group) ++ _out_grp(_('Available Groups:'), groups) + +- done = False ++ groups = [] + for group in available: + if not group.langonly: continue +- _out_grp(_('Available Language Groups:'), group) +- done = True ++ if not wts['lang']: continue ++ groups.append(group) ++ _out_grp(_('Available Language Groups:'), groups) ++ ++ if not done: ++ self.logger.error(_('Warning: No Environments/Groups match: %s'), ++ ", ".join(userlist)) ++ return 0, [] + return 0, [_('Done')] def returnGroupSummary(self, userlist): + """Print a summary of the groups that match the given names or + wildcards. -+ + +- uservisible=1 +- +- if len(userlist) > 0: +- if userlist[0] == 'hidden': +- uservisible=0 +- userlist.pop(0) +- if not userlist: +- userlist = None # Match everything... + :param userlist: a list of names or wildcards specifying the + groups to summarise. If *userlist* is an empty list, all + installed and available packages will be summarised + :return: (exit_code, [ errors ]) +- installed, available = self.doGroupLists(uservisible=uservisible, +- patterns=userlist) +- +- def _out_grp(sect, num): +- if not num: +- return +- self.verbose_logger.log(yum.logginglevels.INFO_2, '%s %u', sect,num) +- done = 0 +- for group in installed: +- if group.langonly: continue +- done += 1 +- _out_grp(_('Installed Groups:'), done) + exit_code is:: -+ + +- done = 0 +- for group in installed: +- if not group.langonly: continue +- done += 1 +- _out_grp(_('Installed Language Groups:'), done) + 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 + """ - uservisible=1 - - if len(userlist) > 0: -@@ -1327,7 +1667,19 @@ class YumBaseCli(yum.YumBase, output.YumOutput): - return 0, [_('Done')] - - def returnGroupInfo(self, userlist): -- """returns complete information on a list of groups""" ++ return self._returnGroupLists(userlist, summary=True) ++ ++ def returnGroupInfo(self, userlist): + """Print complete information about the groups that match the + given names or wildcards. -+ + +- done = False +- for group in available: +- if group.langonly: continue +- done += 1 +- _out_grp(_('Available Groups:'), done) + :param userlist: a list of names or wildcards specifying the + groups to print information about + :return: (exit_code, [ errors ]) -+ + +- done = False +- for group in available: +- if not group.langonly: continue +- done += 1 +- _out_grp(_('Available Language Groups:'), done) + exit_code is:: -+ + +- return 0, [_('Done')] +- +- def returnGroupInfo(self, userlist): +- """returns complete information on a list of groups""" + 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 + """ for strng in userlist: group_matched = False - for group in self.comps.return_groups(strng): -@@ -1339,9 +1691,19 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +- for group in self.comps.return_groups(strng): +- self.displayPkgsInGroups(group) +- group_matched = True ++ ++ pkg_grp = True ++ grp_grp = True ++ if strng.startswith('@^'): ++ strng = strng[2:] ++ pkg_grp = False ++ elif strng.startswith('@'): ++ strng = strng[1:] ++ grp_grp = False ++ ++ if grp_grp: ++ for evgroup in self.comps.return_environments(strng): ++ self.displayGrpsInEnvironments(evgroup) ++ group_matched = True ++ if pkg_grp: ++ for group in self.comps.return_groups(strng): ++ self.displayPkgsInGroups(group) ++ group_matched = True + + if not group_matched: +- self.logger.error(_('Warning: Group %s does not exist.'), strng) ++ self.logger.error(_('Warning: Group/Environment %s does not exist.'), strng) return 0, [] @@ -1066,8 +1321,38 @@ index 6056d38..597efd6 pkgs_used = [] for group_string in grouplist: -@@ -1351,7 +1713,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput): ++ ++ grp_grp = True ++ pkg_grp = True ++ if group_string.startswith('@^'): ++ pkg_grp = False ++ group_string = group_string[2:] ++ elif group_string.startswith('@'): ++ grp_grp = False ++ group_string = group_string[1:] ++ + group_matched = False +- for group in self.comps.return_groups(group_string): ++ groups = [] ++ if grp_grp: ++ groups = self.comps.return_environments(group_string) ++ for group in groups: + group_matched = True ++ try: ++ txmbrs = self.selectEnvironment(group.environmentid, ++ upgrade=upgrade) ++ except yum.Errors.GroupsError: ++ self.logger.critical(_('Warning: Environment %s does not exist.'), group_string) ++ continue ++ else: ++ pkgs_used.extend(txmbrs) ++ ++ groups = [] ++ if pkg_grp: ++ groups = self.comps.return_groups(group_string) ++ for group in groups: ++ group_matched = True try: - txmbrs = self.selectGroup(group.groupid) @@ -1075,7 +1360,7 @@ index 6056d38..597efd6 except yum.Errors.GroupsError: self.logger.critical(_('Warning: Group %s does not exist.'), group_string) continue -@@ -1368,8 +1730,18 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -1368,17 +1841,61 @@ 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): @@ -1094,8 +1379,58 @@ index 6056d38..597efd6 + """ pkgs_used = [] for group_string in grouplist: - try: -@@ -1389,7 +1761,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +- try: +- txmbrs = self.groupRemove(group_string) +- except yum.Errors.GroupsError: +- self.logger.critical(_('No group named %s exists'), group_string) +- continue +- else: +- pkgs_used.extend(txmbrs) ++ ++ grp_grp = True ++ pkg_grp = True ++ if group_string.startswith('@^'): ++ pkg_grp = False ++ group_string = group_string[2:] ++ elif group_string.startswith('@'): ++ grp_grp = False ++ group_string = group_string[1:] ++ ++ groups = [] ++ if grp_grp: ++ if self.conf.group_command == 'objects': ++ groups = self.igroups.return_environments(group_string) ++ else: ++ groups = self.comps.return_environments(group_string) ++ if not groups: ++ self.logger.critical(_('No Environment named %s exists'), group_string) ++ for group in groups: ++ try: ++ txmbrs = self.environmentRemove(group.environmentid) ++ except yum.Errors.GroupsError: ++ continue ++ else: ++ pkgs_used.extend(txmbrs) ++ ++ groups = [] ++ if pkg_grp: ++ if self.conf.group_command == 'objects': ++ groups = self.igroups.return_groups(group_string) ++ else: ++ groups = self.comps.return_groups(group_string) ++ if not groups: ++ self.logger.critical(_('No group named %s exists'), group_string) ++ for group in groups: ++ try: ++ txmbrs = self.groupRemove(group.groupid) ++ except yum.Errors.GroupsError: ++ continue ++ else: ++ pkgs_used.extend(txmbrs) + + if not pkgs_used: + return 0, [_('No packages to remove from groups')] +@@ -1389,7 +1906,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput): def _promptWanted(self): # shortcut for the always-off/always-on options @@ -1104,7 +1439,7 @@ index 6056d38..597efd6 return False if self.conf.alwaysprompt: return True -@@ -1400,7 +1772,6 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -1400,7 +1917,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 \ @@ -1112,7 +1447,7 @@ index 6056d38..597efd6 txmbr.name not in self.extcmds: return True -@@ -1408,11 +1779,11 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -1408,11 +1924,11 @@ class YumBaseCli(yum.YumBase, output.YumOutput): return False def usage(self): @@ -1126,7 +1461,7 @@ index 6056d38..597efd6 sys.stdout.write(self.optparser.get_usage()) def _installable(self, pkg, ematch=False): -@@ -1468,9 +1839,9 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -1468,9 +1984,9 @@ class YumBaseCli(yum.YumBase, output.YumOutput): return False class YumOptionParser(OptionParser): @@ -1138,7 +1473,7 @@ index 6056d38..597efd6 def __init__(self,base, **kwargs): # check if this is called with a utils=True/False parameter -@@ -1488,13 +1859,23 @@ class YumOptionParser(OptionParser): +@@ -1488,13 +2004,23 @@ class YumOptionParser(OptionParser): self._addYumBasicOptions() def error(self, msg): @@ -1164,7 +1499,7 @@ index 6056d38..597efd6 try: args = _filtercmdline( ('--noplugins','--version','-q', '-v', "--quiet", "--verbose"), -@@ -1521,7 +1902,15 @@ class YumOptionParser(OptionParser): +@@ -1521,7 +2047,15 @@ class YumOptionParser(OptionParser): return ret def setupYumConfig(self, args=None): @@ -1181,7 +1516,13 @@ index 6056d38..597efd6 if not args: (opts, cmds) = self.parse_args() else: -@@ -1536,13 +1925,14 @@ class YumOptionParser(OptionParser): +@@ -1533,16 +2067,20 @@ class YumOptionParser(OptionParser): + try: + # config file is parsed and moving us forward + # set some things in it. ++ ++ if opts.tolerant or self.base.conf.tolerant: # Make it slower capt. ++ self.base.conf.recheck_installed_requires = True # Handle remaining options if opts.assumeyes: @@ -1201,7 +1542,7 @@ index 6056d38..597efd6 self.base.conf.cache = 1 if opts.obsoletes: -@@ -1610,10 +2000,6 @@ class YumOptionParser(OptionParser): +@@ -1610,10 +2148,6 @@ class YumOptionParser(OptionParser): self.base.usage() sys.exit(1) @@ -1212,7 +1553,7 @@ index 6056d38..597efd6 # Disable all gpg key checking, if requested. if opts.nogpgcheck: # Altering the normal configs. doesn't work too well, esp. with -@@ -1640,6 +2026,14 @@ class YumOptionParser(OptionParser): +@@ -1640,6 +2174,14 @@ class YumOptionParser(OptionParser): sys.exit(1) def getRoot(self,opts): @@ -1227,7 +1568,7 @@ index 6056d38..597efd6 self._checkAbsInstallRoot(opts) # If the conf file is inside the installroot - use that. # otherwise look for it in the normal root -@@ -1713,6 +2107,10 @@ class YumOptionParser(OptionParser): +@@ -1713,6 +2255,10 @@ class YumOptionParser(OptionParser): help=_("verbose operation")) group.add_option("-y", "--assumeyes", dest="assumeyes", action="store_true", help=_("answer yes for all questions")) @@ -1933,7 +2274,7 @@ index 0000000..d2a0ed1 +if __name__ == "__main__": + generateAll(os.getcwd(), os.getcwd()) diff --git a/docs/yum.8 b/docs/yum.8 -index 1a8202a..604377b 100644 +index 1a8202a..188cd3e 100644 --- a/docs/yum.8 +++ b/docs/yum.8 @@ -52,6 +52,7 @@ gnome\-packagekit application\&. @@ -1980,7 +2321,19 @@ index 1a8202a..604377b 100644 "\fBupdate\fP foo" if foo-1-2 is installed. You can use the "\fBupdate-to\fP" if you'd prefer that nothing happen in the above case. .IP -@@ -224,10 +232,37 @@ to only remove packages which aren't required by something else. +@@ -158,6 +166,11 @@ the "install" command\&.(See \fBSpecifying package names\fP for more information + + Note that "yum" is included in the protected_packages configuration, by default. + So you can't accidentally remove yum itself. ++ ++Because remove does a lot of work to make it as easy as possible to use, there ++are also a few specific remove commands "\fBremove-n\fP", "\fBremove-na\fP" ++and "\fBremove-nevra\fP". These only work on package names, and do not process ++wildcards etc. + .IP + .IP "\fBlist\fP" + Is used to list various information about available +@@ -224,10 +237,37 @@ to only remove packages which aren't required by something else. "\fBgroup info\fP" is used to give the description and package list of a group (and which type those packages are marked as). Note that you can use the yum-filter-data and @@ -2019,7 +2372,7 @@ index 1a8202a..604377b 100644 .IP .IP "\fBshell\fP" Is used to enter the 'yum shell', when a filename is specified the contents of -@@ -235,12 +270,13 @@ that file is executed in yum shell mode. See \fIyum-shell(8)\fP for more info +@@ -235,12 +275,13 @@ that file is executed in yum shell mode. See \fIyum-shell(8)\fP for more info .IP .IP "\fBresolvedep\fP" Is used to list packages providing the specified dependencies, at most one @@ -2035,7 +2388,7 @@ index 1a8202a..604377b 100644 reasons only. .IP .IP "\fBlocalupdate\fP" -@@ -248,7 +284,7 @@ Is used to update the system by specifying local rpm files. Only the specified +@@ -248,7 +289,7 @@ Is used to update the system by specifying local rpm files. Only the specified rpm files of which an older version is already installed will be installed, the remaining specified packages will be ignored. If required the enabled repositories will be used to resolve dependencies. Note @@ -2044,7 +2397,7 @@ index 1a8202a..604377b 100644 legacy reasons only. .IP .IP "\fBreinstall\fP" -@@ -260,7 +296,7 @@ on groups, files, provides and filelists just like the "install" command\&. +@@ -260,7 +301,7 @@ on groups, files, provides and filelists just like the "install" command\&. Will try and downgrade a package from the version currently installed to the previously highest version (or the specified version). The depsolver will not necessarily work, but if you specify all the packages it @@ -2053,7 +2406,7 @@ index 1a8202a..604377b 100644 work for "installonly" packages, like Kernels. downgrade operates on groups, files, provides, filelists and rpm files just like the "install" command\&. .IP -@@ -294,8 +330,8 @@ package counts/etc. will be zeroed out). +@@ -294,8 +335,8 @@ package counts/etc. will be zeroed out). .IP "\fBversion\fP" Produces a "version" of the rpmdb, and of the enabled repositories if "all" is given as the first argument. You can also specify version groups in the @@ -2064,7 +2417,7 @@ index 1a8202a..604377b 100644 packages (in sorted order), and the checksum_type/checksum_data entries from the yumdb. Note that this rpmdb version is now also used significantly within yum (esp. in yum history). -@@ -321,26 +357,33 @@ and so takes sub-commands: +@@ -321,26 +362,33 @@ and so takes sub-commands: .IP "\fBhistory\fP" The history command allows the user to view what has happened in past transactions (assuming the history_record config. option is set). You can use @@ -2104,7 +2457,7 @@ index 1a8202a..604377b 100644 A (if it is not still installed), and "rollback 1" will try to remove packages B and C. Note that after a "rollback 1" you will have a fourth transaction, although the ending rpmdb version (see: yum version) should be the same in -@@ -349,6 +392,12 @@ transactions 1 and 4. +@@ -349,6 +397,12 @@ transactions 1 and 4. The addon-info command takes a transaction ID, and the packages-list command takes a package (with wildcards). @@ -2117,7 +2470,7 @@ index 1a8202a..604377b 100644 In "history list" you can change the behaviour of the 2nd column via. the configuration option history_list_view. -@@ -371,6 +420,15 @@ end of the package column in the packages-list command). +@@ -371,6 +425,15 @@ end of the package column in the packages-list command). .I \fBs\fR - The transaction completed fine, but --skip-broken was enabled and had to skip some packages. .br @@ -2133,7 +2486,7 @@ index 1a8202a..604377b 100644 .IP .IP "\fBcheck\fP" Checks the local rpmdb and produces information on any problems it finds. You -@@ -401,6 +459,11 @@ Assume yes; assume that the answer to any question which would be asked +@@ -401,6 +464,11 @@ Assume yes; assume that the answer to any question which would be asked is yes\&. .br Configuration Option: \fBassumeyes\fP @@ -2145,7 +2498,7 @@ index 1a8202a..604377b 100644 .IP "\fB\-c, \-\-config=[config file]\fP" Specifies the config file location - can take HTTP and FTP URLs and local file paths\&. -@@ -420,7 +483,7 @@ Sets the error level to [number] Practical range 0 \- 10. 0 means print only cri +@@ -420,7 +488,7 @@ Sets the error level to [number] Practical range 0 \- 10. 0 means print only cri .br Configuration Option: \fBerrorlevel\fP .IP "\fB\-\-rpmverbosity=[name]\fP" @@ -2154,6 +2507,16 @@ index 1a8202a..604377b 100644 options are: 'critical', 'emergency', 'error', 'warn' and 'debug'. .br Configuration Option: \fBrpmverbosity\fP +@@ -506,7 +574,8 @@ option will corrupt your cache (and you can use $releasever in your cachedir + configuration to stop this). + .PP + .IP "\fB\-t, \-\-tolerant\fP" +-This option currently does nothing. ++This option makes yum go slower, checking for things that shouldn't be possible ++making it more tolerant of external errors. + .br + .IP "\fB\-\-setopt=option=value\fP" + Set any config option in yum config or repo files. For options in the global diff --git a/docs/yum.conf.5 b/docs/yum.conf.5 index 515aa73..b456074 100644 --- a/docs/yum.conf.5 @@ -3043,7 +3406,7 @@ index f1e06e8..b21c594 100644 complete -F _yum -o filenames yum yummain.py diff --git a/output.py b/output.py -index b6aa277..b3f2c75 100755 +index b6aa277..d29eba8 100755 --- a/output.py +++ b/output.py @@ -1,6 +1,6 @@ @@ -3639,8 +4002,10 @@ index b6aa277..b3f2c75 100755 print _('\nGroup: %s') % group.ui_name verb = self.verbose_logger.isEnabledFor(logginglevels.DEBUG_3) - if verb: - print _(' Group-Id: %s') % to_unicode(group.groupid) +- if verb: +- print _(' Group-Id: %s') % to_unicode(group.groupid) ++ if True: ++ print _(' Group-Id: %s') % to_unicode(group.compsid) + + igroup_data = self._groupInstalledData(group) + igrp_only = set() @@ -3674,7 +4039,7 @@ index b6aa277..b3f2c75 100755 data = [data['envra'], data['rid']] columns = self.calcColumns(data) columns = (-columns[0], -columns[1]) -@@ -804,11 +1136,20 @@ class YumOutput: +@@ -804,11 +1136,77 @@ class YumOutput: if len(pkg_names) > 0: print section_name self._displayPkgsFromNames(pkg_names, verb, pkg_names2pkgs, @@ -3686,6 +4051,63 @@ index b6aa277..b3f2c75 100755 + self._displayPkgsFromNames(igrp_only, verb, pkg_names2pkgs, + columns=columns, + igroup_data=igroup_data) ++ ++ def displayGrpsInEnvironments(self, evgroup): ++ """Output information about the groups in a given evgroup ++ ++ :param group: an Environment object to output information about ++ """ ++ print _('\nEnvironment Group: %s') % evgroup.ui_name ++ print _(' Environment-Id: %s') % to_unicode(evgroup.compsid) ++ ++ igroup_data = self._groupInstalledEnvData(evgroup) ++ igrp_only = set() ++ for grp_name in igroup_data: ++ if igroup_data[grp_name] == 'installed': ++ igrp_only.add(grp_name) ++ igrp_only.difference_update(evgroup.allgroups) ++ all_grps = evgroup.allgroups + list(igrp_only) ++ ++ if evgroup.ui_description: ++ print _(' Description: %s') % to_unicode(evgroup.ui_description) ++ ++ def _get_igrp_data(item, indent): ++ if not igroup_data: ++ return indent ++ ++ assert item in igroup_data ++ if item not in igroup_data or igroup_data[item] == 'available': ++ indent += '+' # Group up/in will install i ++ elif igroup_data[item] == 'installed': ++ indent += '=' # Installed via. group ++ elif igroup_data[item] == 'blacklisted-installed': ++ if False: # Not sure it's worth listing these... ++ return None # On the other hand, there's mark-packages ++ indent += ' ' # Installed, not via. group ++ else: ++ assert igroup_data[item] == 'blacklisted-available' ++ if False: # Not sure it's worth listing these... ++ return None ++ indent += '-' # Not installed, and won't be ++ return indent ++ ++ sections = ((_(' Mandatory Groups:'), evgroup.groups), ++ (_(' Optional Groups:'), evgroup.options)) ++ ++ for (section_name, grp_names) in sections: ++ if len(grp_names) > 0: ++ print section_name ++ for grp_name in sorted(grp_names): ++ pindent = _get_igrp_data(grp_name, " ") ++ if pindent is None: ++ continue ++ ++ print "%s%s" % (pindent, grp_name) ++ ++ if igrp_only: ++ print _(' Installed Groups:') ++ for grp_name in sorted(igrp_only): ++ print "%s%s", " ", grp_name def depListOutput(self, results): - """take a list of findDeps results and 'pretty print' the output""" @@ -3698,7 +4120,7 @@ index b6aa277..b3f2c75 100755 verb = self.verbose_logger.isEnabledFor(logginglevels.DEBUG_3) for pkg in sorted(results): print _("package: %s") % pkg.compactPrint() -@@ -832,7 +1173,18 @@ class YumOutput: +@@ -832,7 +1230,18 @@ class YumOutput: print " provider: %s" % po.compactPrint() def format_number(self, number, SI=0, space=' '): @@ -3718,7 +4140,7 @@ index b6aa277..b3f2c75 100755 symbols = [ ' ', # (none) 'k', # kilo 'M', # mega -@@ -870,16 +1222,31 @@ class YumOutput: +@@ -870,16 +1279,31 @@ class YumOutput: @staticmethod def format_time(seconds, use_hours=0): @@ -3756,7 +4178,7 @@ index b6aa277..b3f2c75 100755 if self.conf.showdupesfromrepos: msg = '%s : ' % po else: -@@ -923,7 +1290,15 @@ class YumOutput: +@@ -923,7 +1347,15 @@ class YumOutput: item = self._enc(item) can_overflow = False else: @@ -3773,7 +4195,7 @@ index b6aa277..b3f2c75 100755 if matchfor: item = self._sub_highlight(item, highlight, matchfor, -@@ -935,14 +1310,34 @@ class YumOutput: +@@ -935,14 +1367,34 @@ class YumOutput: print '\n\n' def matchcallback_verbose(self, po, values, matchfor=None): @@ -3809,7 +4231,7 @@ index b6aa277..b3f2c75 100755 for pkg in packages: # Just to be on the safe side, if for some reason getting # the package size fails, log the error and don't report download -@@ -971,18 +1366,18 @@ class YumOutput: +@@ -971,18 +1423,18 @@ class YumOutput: if (not error): if locsize: @@ -3836,7 +4258,7 @@ index b6aa277..b3f2c75 100755 totsize = 0 error = False for pkg in packages: -@@ -997,13 +1392,19 @@ class YumOutput: +@@ -997,13 +1449,19 @@ class YumOutput: self.logger.error(_('There was an error calculating installed size')) break if (not error): @@ -3861,7 +4283,7 @@ index b6aa277..b3f2c75 100755 self.tsInfo.makelists(True, True) pkglist_lines = [] data = {'n' : {}, 'v' : {}, 'r' : {}} -@@ -1032,8 +1433,7 @@ class YumOutput: +@@ -1032,8 +1490,7 @@ class YumOutput: for (d, v) in (("n",len(n)), ("v",len(evr)), ("r",len(repoid))): data[d].setdefault(v, 0) data[d][v] += 1 @@ -3871,7 +4293,7 @@ index b6aa277..b3f2c75 100755 return a_wid for (action, pkglist) in [(_('Installing'), self.tsInfo.installed), -@@ -1102,19 +1502,72 @@ class YumOutput: +@@ -1102,19 +1559,72 @@ class YumOutput: Transaction Summary %s """) % ('=' * self.term.columns)) @@ -3954,7 +4376,7 @@ index b6aa277..b3f2c75 100755 out = '' self.tsInfo.makelists() -@@ -1179,9 +1632,9 @@ Transaction Summary +@@ -1179,9 +1689,9 @@ Transaction Summary return out def setupProgressCallbacks(self): @@ -3967,7 +4389,7 @@ index b6aa277..b3f2c75 100755 # if we're below 2 on the debug level we don't need to be outputting # progress bars - this is hacky - I'm open to other options # One of these is a download -@@ -1216,10 +1669,12 @@ Transaction Summary +@@ -1216,10 +1726,12 @@ Transaction Summary self.dsCallback = dscb def setupProgessCallbacks(self): @@ -3981,27 +4403,27 @@ index b6aa277..b3f2c75 100755 confirm_func = self._cli_confirm_gpg_key_import gpg_import_func = self.getKeyForRepo gpgca_import_func = self.getCAKeyForRepo -@@ -1233,14 +1688,12 @@ Transaction Summary +@@ -1233,14 +1745,12 @@ Transaction Summary self.repos.gpgca_import_func = gpgca_import_func def interrupt_callback(self, cbobj): - '''Handle CTRL-C's during downloads +- +- If a CTRL-C occurs a URLGrabError will be raised to push the download +- onto the next mirror. +- +- If two CTRL-C's occur in quick succession then yum will exit. + '''Handle CTRL-C's during downloads. If a CTRL-C occurs a + URLGrabError will be raised to push the download onto the next + mirror. If two CTRL-C's occur in quick succession then yum + will exit. -- If a CTRL-C occurs a URLGrabError will be raised to push the download -- onto the next mirror. -- -- If two CTRL-C's occur in quick succession then yum will exit. -- - @param cbobj: urlgrabber callback obj + :param cbobj: :class:`urlgrabber.grabber.CallbackObject` ''' delta_exit_chk = 2.0 # Delta between C-c's so we treat as exit delta_exit_str = _("two") # Human readable version of above -@@ -1269,6 +1722,14 @@ to exit. +@@ -1269,6 +1779,14 @@ to exit. def download_callback_total_cb(self, remote_pkgs, remote_size, download_start_timestamp): @@ -4016,17 +4438,17 @@ index b6aa277..b3f2c75 100755 if len(remote_pkgs) <= 1: return if not hasattr(urlgrabber.progress, 'TerminalLine'): -@@ -1434,8 +1895,17 @@ to exit. +@@ -1434,8 +1952,17 @@ to exit. return tids, printall def historyListCmd(self, extcmds): - """ Shows the user a list of data about the history. """ + """Output a list of information about the history of yum + transactions. -+ + + :param extcmds: list of extra command line arguments + :return: (exit_code, [errors]) - ++ + exit_code is:: + + 0 = we're done, exit @@ -4035,7 +4457,7 @@ index b6aa277..b3f2c75 100755 tids, printall = self._history_list_transactions(extcmds) if tids is None: return 1, ['Failed history list'] -@@ -1564,6 +2034,16 @@ to exit. +@@ -1564,6 +2091,16 @@ to exit. return old[0] def historyInfoCmd(self, extcmds): @@ -4052,7 +4474,7 @@ index b6aa277..b3f2c75 100755 def str2int(x): try: return int(x) -@@ -1656,6 +2136,9 @@ to exit. +@@ -1656,6 +2193,9 @@ to exit. def _hpkg2from_repo(self, hpkg): """ Given a pkg, find the ipkg.ui_from_repo ... if none, then get an apkg. ... and put a ? in there. """ @@ -4062,7 +4484,7 @@ index b6aa277..b3f2c75 100755 ipkgs = self.rpmdb.searchPkgTuple(hpkg.pkgtup) if not ipkgs: apkgs = self.pkgSack.searchPkgTuple(hpkg.pkgtup) -@@ -1672,13 +2155,12 @@ to exit. +@@ -1672,13 +2212,12 @@ to exit. 'o' : _('Updated'), 'n' : _('Downgraded')} _pkg_states_available = {'i' : _('Installed'), 'e' : _('Not installed'), 'o' : _('Older'), 'n' : _('Newer')} @@ -4079,7 +4501,7 @@ index b6aa277..b3f2c75 100755 prefix = " " * prefix_len if was_installed: _pkg_states = _pkg_states_installed -@@ -1702,9 +2184,11 @@ to exit. +@@ -1702,9 +2241,11 @@ to exit. else: (hibeg, hiend) = self._highlight('normal') state = utf8_width_fill(state, _pkg_states['maxlen']) @@ -4093,7 +4515,7 @@ index b6aa277..b3f2c75 100755 if type(old.tid) == type([]): print _("Transaction ID :"), "%u..%u" % (old.tid[0], old.tid[-1]) -@@ -1778,8 +2262,8 @@ to exit. +@@ -1778,8 +2319,8 @@ to exit. default_addons = set(['config-main', 'config-repos', 'saved_tx']) non_default = set(addon_info).difference(default_addons) if len(non_default) > 0: @@ -4104,7 +4526,7 @@ index b6aa277..b3f2c75 100755 if old.trans_with: # This is _possible_, but not common -@@ -1794,7 +2278,9 @@ to exit. +@@ -1794,7 +2335,9 @@ to exit. print _("Packages Skipped:") pkg_max_len = max((len(str(hpkg)) for hpkg in old.trans_skip)) for hpkg in old.trans_skip: @@ -4115,7 +4537,7 @@ index b6aa277..b3f2c75 100755 if old.rpmdb_problems: print _("Rpmdb Problems:") -@@ -1833,6 +2319,13 @@ to exit. +@@ -1833,6 +2376,13 @@ to exit. 'Updated' : _('Updated'), } def historyInfoCmdPkgsAltered(self, old, pats=[]): @@ -4129,7 +4551,7 @@ index b6aa277..b3f2c75 100755 last = None # Note that these don't use _simple_pkg() because we are showing what # happened to them in the transaction ... not the difference between the -@@ -1886,6 +2379,10 @@ to exit. +@@ -1886,6 +2436,10 @@ to exit. self._hpkg2from_repo(hpkg)) def historySummaryCmd(self, extcmds): @@ -4140,7 +4562,7 @@ index b6aa277..b3f2c75 100755 tids, printall = self._history_list_transactions(extcmds) if tids is None: return 1, ['Failed history info'] -@@ -1946,6 +2443,10 @@ to exit. +@@ -1946,6 +2500,10 @@ to exit. utf8_width_fill(uiacts, 16, 16), count) def historyAddonInfoCmd(self, extcmds): @@ -4151,7 +4573,7 @@ index b6aa277..b3f2c75 100755 tid = None if len(extcmds) > 1: tid = extcmds[1] -@@ -1983,16 +2484,19 @@ to exit. +@@ -1983,16 +2541,19 @@ to exit. for item in extcmds[2:]: if item in addon_info: @@ -4177,7 +4599,7 @@ index b6aa277..b3f2c75 100755 tids = self.history.search(extcmds) limit = None if extcmds and not tids: -@@ -2078,9 +2582,94 @@ to exit. +@@ -2078,9 +2639,94 @@ to exit. if lastdbv.end_rpmdbversion != rpmdbv: self._rpmdb_warn_checks() @@ -4273,7 +4695,7 @@ index b6aa277..b3f2c75 100755 def __init__(self, ayum=None): """requires yum-cli log and errorlog functions as arguments""" -@@ -2089,6 +2678,25 @@ class DepSolveProgressCallBack: +@@ -2089,6 +2735,25 @@ class DepSolveProgressCallBack: self.ayum = ayum def pkgAdded(self, pkgtup, mode): @@ -4299,7 +4721,7 @@ index b6aa277..b3f2c75 100755 modedict = { 'i': _('installed'), 'u': _('an update'), 'e': _('erased'), -@@ -2104,43 +2712,85 @@ class DepSolveProgressCallBack: +@@ -2104,43 +2769,85 @@ class DepSolveProgressCallBack: modeterm) def start(self): @@ -4387,7 +4809,7 @@ index b6aa277..b3f2c75 100755 needname, needflags, needversion = reqTup yb = self.ayum -@@ -2225,46 +2875,106 @@ class DepSolveProgressCallBack: +@@ -2225,46 +2932,106 @@ class DepSolveProgressCallBack: return msg def procConflict(self, name, confname): @@ -4499,7 +4921,7 @@ index b6aa277..b3f2c75 100755 def _pkgname_ui(ayum, pkgname, ts_states=None): """ Get more information on a simple pkgname, if we can. We need to search -@@ -2316,10 +3026,7 @@ def _pkgname_ui(ayum, pkgname, ts_states=None): +@@ -2316,10 +3083,7 @@ def _pkgname_ui(ayum, pkgname, ts_states=None): return pkgname class YumCliRPMCallBack(RPMBaseCallback): @@ -4511,7 +4933,7 @@ index b6aa277..b3f2c75 100755 width = property(lambda x: _term_width()) -@@ -2337,21 +3044,34 @@ class YumCliRPMCallBack(RPMBaseCallback): +@@ -2337,21 +3101,34 @@ class YumCliRPMCallBack(RPMBaseCallback): # Installing things have pkg objects passed to the events, so only need to # lookup for erased/obsoleted. def pkgname_ui(self, pkgname, ts_states=('e', 'od', 'ud', None)): @@ -4556,7 +4978,7 @@ index b6aa277..b3f2c75 100755 if type(package) not in types.StringTypes: pkgname = str(package) -@@ -2363,9 +3083,25 @@ class YumCliRPMCallBack(RPMBaseCallback): +@@ -2363,9 +3140,25 @@ class YumCliRPMCallBack(RPMBaseCallback): percent = 0 else: percent = (te_current*100L)/te_total @@ -4583,7 +5005,7 @@ index b6aa277..b3f2c75 100755 pkgname=pkgname, wid1=wid1) msg = fmt % (utf8_width_fill(process, wid1, wid1), utf8_width_fill(pkgname, wid2, wid2)) -@@ -2377,6 +3113,11 @@ class YumCliRPMCallBack(RPMBaseCallback): +@@ -2377,6 +3170,11 @@ class YumCliRPMCallBack(RPMBaseCallback): print " " def scriptout(self, package, msgs): @@ -4595,7 +5017,7 @@ index b6aa277..b3f2c75 100755 if msgs: sys.stdout.write(to_unicode(msgs)) sys.stdout.flush() -@@ -2429,8 +3170,30 @@ class YumCliRPMCallBack(RPMBaseCallback): +@@ -2429,8 +3227,30 @@ class YumCliRPMCallBack(RPMBaseCallback): wid2 = pnl return fmt, wid1, wid2 @@ -148560,7 +148982,7 @@ index 0000000..a98341d + self.assertResult( (p.installed_1, p.update_4) ) + diff --git a/test/simpleobsoletestests.py b/test/simpleobsoletestests.py -index 97a9923..70dde98 100644 +index 97a9923..55e6f14 100644 --- a/test/simpleobsoletestests.py +++ b/test/simpleobsoletestests.py @@ -244,6 +244,42 @@ class SimpleObsoletesTests(OperationsTests): @@ -148606,11 +149028,40 @@ index 97a9923..70dde98 100644 def _MultiObsHelper(self): ret = {'zsh' : FakePackage('zsh', '1', '1', '0', 'noarch'), 'ksh' : FakePackage('ksh', '1', '1', '0', 'noarch'), +@@ -588,6 +624,28 @@ class SimpleObsoletesTests(OperationsTests): + # self.assert_(res=='err', msg) + self.assertResult([]) + ++ def testRLOpenSSLMess1(self): ++ osl1 = FakePackage('openssl', '1.0.0', '1', arch='i386') ++ osl1.addProvides('libssl.1', 'EQ', ('0', '1', '1')) ++ osl2 = FakePackage('openssl', '1.0.1', '1', arch='i386') ++ osll2 = FakePackage('openssl-libs', '1.0.1', '1', arch='i386') ++ osll2.addProvides('libssl.2', 'EQ', ('0', '2', '1')) ++ osll2.addObsoletes('openssl', 'LT', (None, '1.0.1', None)) ++ ++ oc1 = FakePackage('openconnect', '2.0.1', '1', arch='i386') ++ oc1.addRequires('openssl', 'GE', ('0', '0.9.9', '1')) ++ oc2 = FakePackage('openconnect', '2.0.2', '1', arch='i386') ++ oc2.addRequires('openssl', 'GE', ('0', '0.9.9', '1')) ++ ++ res, msg = self.runOperation(['upgrade', 'openssl'], ++ [oc1, osl1], ++ [oc1, oc2, osl1, osl2, osll2]) ++ ++ # In theory don't need to upgrade oc1 => oc2 ++ self.assertResult((oc2, osl2, osll2)) ++ ++ ++ + class GitMetapackageObsoletesTests(OperationsTests): + + @staticmethod diff --git a/test/simpleupdatetests.py b/test/simpleupdatetests.py -index 6177fb1..2c8bcb3 100644 +index 6177fb1..9e22a6b 100644 --- a/test/simpleupdatetests.py +++ b/test/simpleupdatetests.py -@@ -990,3 +990,72 @@ class SimpleUpdateTests(OperationsTests): +@@ -990,3 +990,93 @@ class SimpleUpdateTests(OperationsTests): # Nothing to do... self.assert_(res==0, msg) @@ -148683,8 +149134,29 @@ index 6177fb1..2c8bcb3 100644 + # Ideal: + # self.assertResult((foo11, bar12, cbar11)) + self.assertResult((foo12, bar12, cbar11)) ++ ++ def testInstallOtherArch1(self): ++ # Installing something with dep. on newer version should upgrade older ++ # version with other arch. ++ # Eg. BZ 791326 ++ pax1 = FakePackage('inst', '1', '1', '0', 'x86_64') ++ pai1 = FakePackage('inst', '1', '1', '0', 'i686') ++ pax2 = FakePackage('inst', '2', '1', '0', 'x86_64') ++ pax2.addProvides('foo-x', 'EQ', ('0', '2', '1')) ++ pai2 = FakePackage('inst', '2', '1', '0', 'i686') ++ pai2.addProvides('foo-i', 'EQ', ('0', '2', '1')) ++ ++ pa2 = FakePackage('bar', '1', '1', '0', 'i386') ++ pa2.addRequires('foo-i', 'EQ', ('0', '2', '1')) ++ ++ res, msg = self.runOperation(['install', 'bar'], ++ [pax1], ++ [pax1, pai1, pax2, pai2, pa2]) ++ self.assert_(res=='ok', msg) ++ self.assertResult((pax2, pai2, pa2)) ++ diff --git a/test/testbase.py b/test/testbase.py -index d0f22be..0a931f1 100644 +index d0f22be..608da70 100644 --- a/test/testbase.py +++ b/test/testbase.py @@ -55,6 +55,9 @@ class FakeConf(object): @@ -148697,6 +149169,22 @@ index d0f22be..0a931f1 100644 class FakeSack: """ Fake PackageSack to use with FakeRepository""" +@@ -138,6 +141,7 @@ class FakePackage(packages.YumAvailablePackage): + self.yumdb_info = FakeYumDBInfo() + + self.prco['provides'].append((name, 'EQ', (epoch, version, release))) ++ self.prco['strong_requires'] = [] + + # Just a unique integer + self.id = self.__hash__() +@@ -149,6 +153,7 @@ class FakePackage(packages.YumAvailablePackage): + self.prco['provides'].append((name, flag, evr)) + def addRequires(self, name, flag=None, evr=(None, None, None)): + self.prco['requires'].append((name, flag, evr)) ++ self.prco['strong_requires'].append((name, flag, evr)) + def addRequiresPkg(self, pkg): + self.required_pkgs.append(pkg) + def addRequiringPkg(self, pkg): diff --git a/test/yum-leak-test.py b/test/yum-leak-test.py index 760b770..dd64483 100755 --- a/test/yum-leak-test.py @@ -150752,7 +151240,7 @@ index abd203f..65c62a9 100644 - 3.4.1 - umask bug fix. diff --git a/yum/__init__.py b/yum/__init__.py -index 99039e0..090882c 100644 +index 99039e0..c713cff 100644 --- a/yum/__init__.py +++ b/yum/__init__.py @@ -46,8 +46,13 @@ import operator @@ -151204,15 +151692,7 @@ index 99039e0..090882c 100644 warnings.warn(_('doGroupSetup() will go away in a future version of Yum.\n'), Errors.YumFutureDeprecationWarning, stacklevel=2) -@@ -822,14 +931,13 @@ class YumBase(depsolve.Depsolve): - groupfile = repo.getGroups() - # open it up as a file object so iterparse can cope with our compressed file - if groupfile: -- groupfile = misc.repo_gen_decompress(groupfile, 'groups.xml', -- cached=repo.cache) -+ groupfile = misc.repo_gen_decompress(groupfile, 'groups.xml') - # Do we want a RepoError here? - +@@ -829,7 +938,7 @@ class YumBase(depsolve.Depsolve): try: self._comps.add(groupfile) except (Errors.GroupsError,Errors.CompsException), e: @@ -151221,7 +151701,7 @@ index 99039e0..090882c 100644 self.logger.critical(msg) else: repo.groups_added = True -@@ -837,7 +945,10 @@ class YumBase(depsolve.Depsolve): +@@ -837,7 +946,10 @@ class YumBase(depsolve.Depsolve): if self._comps.compscount == 0: raise Errors.GroupsError, _('No Groups Available in any repository') @@ -151233,14 +151713,7 @@ index 99039e0..090882c 100644 self.verbose_logger.debug('group time: %0.3f' % (time.time() - group_st)) return self._comps -@@ -862,13 +973,11 @@ class YumBase(depsolve.Depsolve): - # fetch the sqlite tagdb - try: - tag_md = repo.retrieveMD('pkgtags') -- tag_sqlite = misc.repo_gen_decompress(tag_md, -- 'pkgtags.sqlite', -- cached=repo.cache) -+ tag_sqlite = misc.repo_gen_decompress(tag_md, 'pkgtags.sqlite') +@@ -868,7 +980,7 @@ class YumBase(depsolve.Depsolve): # feed it into _tags.add() self._tags.add(repo.id, tag_sqlite) except (Errors.RepoError, Errors.PkgTagsError), e: @@ -151249,7 +151722,7 @@ index 99039e0..090882c 100644 self.logger.critical(msg) -@@ -881,9 +990,18 @@ class YumBase(depsolve.Depsolve): +@@ -881,9 +993,18 @@ class YumBase(depsolve.Depsolve): if self._history is None: pdb_path = self.conf.persistdir + "/history" self._history = yum.history.YumHistory(root=self.conf.installroot, @@ -151269,7 +151742,7 @@ index 99039e0..090882c 100644 # properties so they auto-create themselves with defaults repos = property(fget=lambda self: self._getRepos(), fset=lambda self, value: setattr(self, "_repos", value), -@@ -921,6 +1039,11 @@ class YumBase(depsolve.Depsolve): +@@ -921,6 +1042,11 @@ class YumBase(depsolve.Depsolve): fdel=lambda self: setattr(self, "_history", None), doc="Yum History Object") @@ -151281,7 +151754,7 @@ index 99039e0..090882c 100644 pkgtags = property(fget=lambda self: self._getTags(), fset=lambda self, value: setattr(self, "_tags",value), fdel=lambda self: setattr(self, "_tags", None), -@@ -928,9 +1051,10 @@ class YumBase(depsolve.Depsolve): +@@ -928,9 +1054,10 @@ class YumBase(depsolve.Depsolve): def doSackFilelistPopulate(self): @@ -151295,7 +151768,7 @@ index 99039e0..090882c 100644 necessary = False # I can't think of a nice way of doing this, we have to have the sack here -@@ -951,8 +1075,12 @@ class YumBase(depsolve.Depsolve): +@@ -951,8 +1078,12 @@ class YumBase(depsolve.Depsolve): self.repos.populateSack(mdtype='filelists') def yumUtilsMsg(self, func, prog): @@ -151310,7 +151783,7 @@ index 99039e0..090882c 100644 if self.rpmdb.contains(name="yum-utils"): return -@@ -964,8 +1092,17 @@ class YumBase(depsolve.Depsolve): +@@ -964,8 +1095,17 @@ class YumBase(depsolve.Depsolve): (hibeg, prog, hiend)) def buildTransaction(self, unfinished_transactions_check=True): @@ -151330,7 +151803,7 @@ index 99039e0..090882c 100644 if (unfinished_transactions_check and misc.find_unfinished_transactions(yumlibpath=self.conf.persistdir)): msg = _('There are unfinished transactions remaining. You might ' \ -@@ -1004,7 +1141,7 @@ class YumBase(depsolve.Depsolve): +@@ -1004,7 +1144,7 @@ class YumBase(depsolve.Depsolve): # If transaction was changed by postresolve plugins then we should run skipbroken again (rescode, restring) = self._doSkipBroken(rescode, restring, clear_skipped=False ) @@ -151339,7 +151812,45 @@ index 99039e0..090882c 100644 self.tsInfo.pkgSack.dropCachedData() # FIXME: This is horrible, see below and yummain. Maybe create a real -@@ -1242,13 +1379,15 @@ class YumBase(depsolve.Depsolve): +@@ -1044,6 +1184,37 @@ class YumBase(depsolve.Depsolve): + if first.verEQ(other): + continue + msg = _('Protected multilib versions: %s != %s') ++ if not xrestring: ++ # People are confused about protected mutilib ... so give ++ # them a nicer message. ++ bigmsg = _("""\ ++ Multilib version problems found. This often means that the root ++cause is something else and multilib version checking is just ++pointing it that there is a problem. Eg.: ++ ++ 1. You have an upgrade for %(name)s which is missing some ++ dependency that another package requires. Yum is trying to ++ solve this by installing an older version of %(name)s of the ++ different architecture. If you exclude the bad architecture ++ yum will tell you what the root cause is (which package ++ requires what). ++ ++ 2. You have multiple architectures of %(name)s installed, but ++ yum can only see an upgrade for one of those arcitectures. ++ If you don't want/need both architectures anymore then you ++ can remove the one with the missing update and everything ++ will work. ++ ++ 3. You have duplicate versions of %(name)s installed already. ++ You can use "yum check" to get yum show these errors. ++ ++...you can also use --setopt=protected_multilib=false to remove ++this checking, however this is almost never the correct thing to ++do as something else is very likely to go wrong (often causing ++much more problems). ++ ++""") % {'name' : pkgname} ++ msg = bigmsg + msg + xrestring.append(msg % (first, other)) + if xrestring: + rescode = 1 +@@ -1242,13 +1413,15 @@ class YumBase(depsolve.Depsolve): if None in pkgtup: return None return pkgtup @@ -151359,7 +151870,7 @@ index 99039e0..090882c 100644 if pkgtup is None: return self._not_found_i[pkgtup] = YumNotFoundPackage(pkgtup) -@@ -1454,8 +1593,14 @@ class YumBase(depsolve.Depsolve): +@@ -1454,8 +1627,14 @@ class YumBase(depsolve.Depsolve): return probs def runTransaction(self, cb): @@ -151375,7 +151886,7 @@ index 99039e0..090882c 100644 self.plugins.run('pretrans') # We may want to put this other places, eventually, but for now it's -@@ -1516,10 +1661,23 @@ class YumBase(depsolve.Depsolve): +@@ -1516,10 +1695,23 @@ class YumBase(depsolve.Depsolve): pass self._ts_save_file = None @@ -151399,7 +151910,7 @@ index 99039e0..090882c 100644 # make resultobject - just a plain yumgenericholder object resultobject = misc.GenericHolder() -@@ -1567,13 +1725,24 @@ class YumBase(depsolve.Depsolve): +@@ -1567,13 +1759,24 @@ class YumBase(depsolve.Depsolve): self.plugins.run('posttrans') # sync up what just happened versus what is in the rpmdb if not self.ts.isTsFlagSet(rpm.RPMTRANS_FLAG_TEST): @@ -151429,7 +151940,7 @@ index 99039e0..090882c 100644 # check to see that the rpmdb and the tsInfo roughly matches # push package object metadata outside of rpmdb into yumdb # delete old yumdb metadata entries -@@ -1584,9 +1753,16 @@ class YumBase(depsolve.Depsolve): +@@ -1584,9 +1787,16 @@ class YumBase(depsolve.Depsolve): # that there is not also an install of this pkg in the tsInfo (reinstall) # for any kind of install add from_repo to the yumdb, and the cmdline # and the install reason @@ -151446,7 +151957,7 @@ index 99039e0..090882c 100644 for txmbr in self.tsInfo: if txmbr.output_state in TS_INSTALL_STATES: if not self.rpmdb.contains(po=txmbr.po): -@@ -1596,7 +1772,9 @@ class YumBase(depsolve.Depsolve): +@@ -1596,7 +1806,9 @@ class YumBase(depsolve.Depsolve): ' but is not!' % txmbr.po)) # Note: Get Panu to do te.Failed() so we don't have to txmbr.output_state = TS_FAILED @@ -151456,7 +151967,7 @@ index 99039e0..090882c 100644 po = self.getInstalledPackageObject(txmbr.pkgtup) rpo = txmbr.po po.yumdb_info.from_repo = rpo.repoid -@@ -1630,6 +1808,10 @@ class YumBase(depsolve.Depsolve): +@@ -1630,6 +1842,10 @@ class YumBase(depsolve.Depsolve): if md: po.yumdb_info.from_repo_timestamp = str(md.timestamp) @@ -151467,7 +151978,7 @@ index 99039e0..090882c 100644 loginuid = misc.getloginuid() if txmbr.updates or txmbr.downgrades or txmbr.reinstall: if txmbr.updates: -@@ -1640,11 +1822,16 @@ class YumBase(depsolve.Depsolve): +@@ -1640,11 +1856,16 @@ class YumBase(depsolve.Depsolve): opo = po if 'installed_by' in opo.yumdb_info: po.yumdb_info.installed_by = opo.yumdb_info.installed_by @@ -151484,7 +151995,7 @@ index 99039e0..090882c 100644 # Remove old ones after installing new ones, so we can copy values. for txmbr in self.tsInfo: if txmbr.output_state in TS_INSTALL_STATES: -@@ -1662,10 +1849,13 @@ class YumBase(depsolve.Depsolve): +@@ -1662,10 +1883,13 @@ class YumBase(depsolve.Depsolve): ' but is not!' % txmbr.po)) # Note: Get Panu to do te.Failed() so we don't have to txmbr.output_state = TS_FAILED @@ -151498,7 +152009,7 @@ index 99039e0..090882c 100644 self.verbose_logger.log(logginglevels.DEBUG_2, 'What is this? %s' % txmbr.po) self.plugins.run('postverifytrans') -@@ -1680,10 +1870,11 @@ class YumBase(depsolve.Depsolve): +@@ -1680,10 +1904,11 @@ class YumBase(depsolve.Depsolve): self.verbose_logger.debug('VerifyTransaction time: %0.3f' % (time.time() - vt_st)) def costExcludePackages(self): @@ -151514,7 +152025,7 @@ index 99039e0..090882c 100644 # if all the repo.costs are equal then don't bother running things costs = {} for r in self.repos.listEnabled(): -@@ -1705,10 +1896,12 @@ class YumBase(depsolve.Depsolve): +@@ -1705,10 +1930,12 @@ class YumBase(depsolve.Depsolve): done = True def excludePackages(self, repo=None): @@ -151530,7 +152041,7 @@ index 99039e0..090882c 100644 if "all" in self.conf.disable_excludes: return -@@ -1735,9 +1928,11 @@ class YumBase(depsolve.Depsolve): +@@ -1735,9 +1962,11 @@ class YumBase(depsolve.Depsolve): self.pkgSack.addPackageExcluder(repoid, exid,'exclude.match', match) def includePackages(self, repo): @@ -151545,7 +152056,7 @@ index 99039e0..090882c 100644 includelist = repo.getIncludePkgList() if len(includelist) == 0: -@@ -1757,8 +1952,11 @@ class YumBase(depsolve.Depsolve): +@@ -1757,8 +1986,11 @@ class YumBase(depsolve.Depsolve): self.pkgSack.addPackageExcluder(repo.id, exid, 'exclude.marked') def doLock(self, lockfile = YUM_PID_FILE): @@ -151559,7 +152070,7 @@ index 99039e0..090882c 100644 if self.conf.uid != 0: # If we are a user, assume we are using the root cache ... so don't # bother locking. -@@ -1774,38 +1972,26 @@ class YumBase(depsolve.Depsolve): +@@ -1774,38 +2006,26 @@ class YumBase(depsolve.Depsolve): mypid=str(os.getpid()) while not self._lock(lockfile, mypid, 0644): @@ -151613,7 +152124,7 @@ index 99039e0..090882c 100644 # if we're not root then we don't lock - just return nicely # Note that we can get here from __del__, so if we haven't created # YumBase.conf we don't want to do so here as creating stuff inside -@@ -1830,31 +2016,69 @@ class YumBase(depsolve.Depsolve): +@@ -1830,31 +2050,69 @@ class YumBase(depsolve.Depsolve): self._unlock(lockfile) self._lockfile = None @@ -151693,7 +152204,7 @@ index 99039e0..090882c 100644 failed = False if type(fo) is types.InstanceType: -@@ -1894,9 +2118,16 @@ class YumBase(depsolve.Depsolve): +@@ -1894,9 +2152,16 @@ class YumBase(depsolve.Depsolve): def verifyChecksum(self, fo, checksumType, csum): @@ -151713,7 +152224,7 @@ index 99039e0..090882c 100644 try: filesum = misc.checksum(checksumType, fo) except Errors.MiscError, e: -@@ -1908,6 +2139,17 @@ class YumBase(depsolve.Depsolve): +@@ -1908,6 +2173,17 @@ class YumBase(depsolve.Depsolve): return 0 def downloadPkgs(self, pkglist, callback=None, callback_total=None): @@ -151731,7 +152242,7 @@ index 99039e0..090882c 100644 def mediasort(apo, bpo): # FIXME: we should probably also use the mediaid; else we # could conceivably ping-pong between different disc1's -@@ -1979,8 +2221,9 @@ class YumBase(depsolve.Depsolve): +@@ -1979,8 +2255,9 @@ class YumBase(depsolve.Depsolve): urlgrabber.progress.text_meter_total_size(remote_size) beg_download = time.time() i = 0 @@ -151742,7 +152253,7 @@ index 99039e0..090882c 100644 for po in remote_pkgs: # Recheck if the file is there, works around a couple of weird # edge cases. -@@ -1992,52 +2235,47 @@ class YumBase(depsolve.Depsolve): +@@ -1992,52 +2269,47 @@ class YumBase(depsolve.Depsolve): remote_size -= po.size if hasattr(urlgrabber.progress, 'text_meter_total_size'): urlgrabber.progress.text_meter_total_size(remote_size, @@ -151821,7 +152332,7 @@ index 99039e0..090882c 100644 if hasattr(urlgrabber.progress, 'text_meter_total_size'): urlgrabber.progress.text_meter_total_size(0) if callback_total is not None and not errors: -@@ -2052,7 +2290,22 @@ class YumBase(depsolve.Depsolve): +@@ -2052,7 +2324,22 @@ class YumBase(depsolve.Depsolve): return errors def verifyHeader(self, fo, po, raiseError): @@ -151845,7 +152356,7 @@ index 99039e0..090882c 100644 if type(fo) is types.InstanceType: fo = fo.filename -@@ -2076,9 +2329,12 @@ class YumBase(depsolve.Depsolve): +@@ -2076,9 +2363,12 @@ class YumBase(depsolve.Depsolve): return 1 def downloadHeader(self, po): @@ -151860,7 +152371,7 @@ index 99039e0..090882c 100644 if hasattr(po, 'pkgtype') and po.pkgtype == 'local': return -@@ -2122,15 +2378,17 @@ class YumBase(depsolve.Depsolve): +@@ -2122,15 +2412,17 @@ class YumBase(depsolve.Depsolve): return def sigCheckPkg(self, po): @@ -151886,7 +152397,7 @@ index 99039e0..090882c 100644 if self._override_sigchecks: check = False hasgpgkey = 0 -@@ -2181,6 +2439,9 @@ class YumBase(depsolve.Depsolve): +@@ -2181,6 +2473,9 @@ class YumBase(depsolve.Depsolve): return result, msg def cleanUsedHeadersPackages(self): @@ -151896,7 +152407,7 @@ index 99039e0..090882c 100644 filelist = [] for txmbr in self.tsInfo: if txmbr.po.state not in TS_INSTALL_STATES: -@@ -2218,27 +2479,42 @@ class YumBase(depsolve.Depsolve): +@@ -2218,27 +2513,42 @@ class YumBase(depsolve.Depsolve): _('%s removed'), fn) def cleanHeaders(self): @@ -151941,7 +152452,7 @@ index 99039e0..090882c 100644 cachedir = self.conf.persistdir + "/rpmdb-indexes/" if not os.path.exists(cachedir): filelist = [] -@@ -2272,8 +2548,29 @@ class YumBase(depsolve.Depsolve): +@@ -2272,8 +2582,29 @@ class YumBase(depsolve.Depsolve): def doPackageLists(self, pkgnarrow='all', patterns=None, showdups=None, ignore_case=False): @@ -151973,7 +152484,7 @@ index 99039e0..090882c 100644 if showdups is None: showdups = self.conf.showdupesfromrepos ygh = misc.GenericHolder(iter=pkgnarrow) -@@ -2323,10 +2620,22 @@ class YumBase(depsolve.Depsolve): +@@ -2323,10 +2654,22 @@ class YumBase(depsolve.Depsolve): key = (pkg.name, pkg.arch) if pkg.pkgtup in dinst: reinstall_available.append(pkg) @@ -151999,7 +152510,7 @@ index 99039e0..090882c 100644 # produce the updates list of tuples elif pkgnarrow == 'updates': -@@ -2461,14 +2770,13 @@ class YumBase(depsolve.Depsolve): +@@ -2461,14 +2804,13 @@ class YumBase(depsolve.Depsolve): def findDeps(self, pkgs): @@ -152019,7 +152530,7 @@ index 99039e0..090882c 100644 results = {} for pkg in pkgs: -@@ -2495,10 +2803,22 @@ class YumBase(depsolve.Depsolve): +@@ -2495,10 +2837,22 @@ class YumBase(depsolve.Depsolve): # pre 3.2.10 API used to always showdups, so that's the default atm. def searchGenerator(self, fields, criteria, showdups=True, keys=False, searchtags=True, searchrpmdb=True): @@ -152046,7 +152557,7 @@ index 99039e0..090882c 100644 sql_fields = [] for f in fields: sql_fields.append(RPM_TO_SQLITE.get(f, f)) -@@ -2661,6 +2981,14 @@ class YumBase(depsolve.Depsolve): +@@ -2661,6 +3015,14 @@ class YumBase(depsolve.Depsolve): yield (po, vs) def searchPackageTags(self, criteria): @@ -152061,7 +152572,7 @@ index 99039e0..090882c 100644 results = {} # name = [(criteria, taglist)] for c in criteria: c = c.lower() -@@ -2677,11 +3005,16 @@ class YumBase(depsolve.Depsolve): +@@ -2677,11 +3039,16 @@ class YumBase(depsolve.Depsolve): return results def searchPackages(self, fields, criteria, callback=None): @@ -152083,7 +152594,7 @@ index 99039e0..090882c 100644 warnings.warn(_('searchPackages() will go away in a future version of Yum.\ Use searchGenerator() instead. \n'), Errors.YumFutureDeprecationWarning, stacklevel=2) -@@ -2700,13 +3033,23 @@ class YumBase(depsolve.Depsolve): +@@ -2700,13 +3067,23 @@ class YumBase(depsolve.Depsolve): def searchPackageProvides(self, args, callback=None, callback_has_matchfor=False): @@ -152111,7 +152622,7 @@ index 99039e0..090882c 100644 else: isglob = True canBeFile = misc.re_filename(arg) -@@ -2723,7 +3066,7 @@ class YumBase(depsolve.Depsolve): +@@ -2723,7 +3100,7 @@ class YumBase(depsolve.Depsolve): where = self.returnPackagesByDep(arg) else: usedDepString = False @@ -152120,10 +152631,16 @@ index 99039e0..090882c 100644 self.verbose_logger.log(logginglevels.DEBUG_1, P_('Searching %d package', 'Searching %d packages', len(where)), len(where)) -@@ -2817,25 +3160,93 @@ class YumBase(depsolve.Depsolve): +@@ -2817,25 +3194,160 @@ class YumBase(depsolve.Depsolve): return matches +- def doGroupLists(self, uservisible=0, patterns=None, ignore_case=True): +- """returns two lists of groups, installed groups and available groups +- optional 'uservisible' bool to tell it whether or not to return +- only groups marked as uservisible""" +- +- + def _groupInstalledData(self, group): + """ Return a dict of + pkg_name => @@ -152158,30 +152675,81 @@ index 99039e0..090882c 100644 + + return ret + ++ def _groupInstalledEnvData(self, evgroup): ++ """ Return a dict of ++ grp_name => ++ (installed, available, ++ backlisted-installed, blacklisted-available). """ ++ ret = {} ++ if not evgroup or self.conf.group_command != 'objects': ++ return ret ++ ++ grp_names = {} ++ if evgroup.environmentid in self.igroups.groups: ++ grp_names = self.igroups.environments[evgroup.environmentid] ++ grp_names = grp_names.grp_names ++ ++ for grp_name in set(evgroup.allgroups + list(grp_names)): ++ igrp = self.igroups.groups.get(grp_name) ++ if grp_name not in grp_names and not igrp: ++ ret[grp_name] = 'available' ++ continue ++ ++ if not igrp: ++ ret[grp_name] = 'blacklisted-available' ++ continue ++ ++ if igrp.environment == evgroup.environmentid: ++ ret[grp_name] = 'installed' ++ break ++ else: ++ ret[grp_name] = 'blacklisted-installed' ++ ++ return ret ++ + def _groupReturnGroups(self, patterns=None, ignore_case=True): + igrps = None ++ ievgrps = None + if patterns is None: + grps = self.comps.groups + if self.conf.group_command == 'objects': + igrps = self.igroups.groups.values() -+ return igrps, grps ++ evgrps = self.comps.environments ++ if False and self.conf.group_command == 'objects': ++ # FIXME: Environment groups. ++ ievgrps = self.igroups.environments.values() ++ return igrps, grps, ievgrps, evgrps ++ ++ gpats = [] ++ epats = [] ++ for pat in patterns: ++ if pat.startswith('@^'): ++ epats.append(pat[2:]) ++ elif pat.startswith('@'): ++ gpats.append(pat[1:]) ++ else: ++ epats.append(pat) ++ gpats.append(pat) ++ ++ epats = ",".join(epats) ++ gpats = ",".join(gpats) + -+ pats = ",".join(patterns) + cs = not ignore_case -+ grps = self.comps.return_groups(pats, case_sensitive=cs) ++ grps = self.comps.return_groups(gpats, case_sensitive=cs) + # Because we want name matches too, and we don't store group names + # we need to add the groupid's we've found: + if self.conf.group_command == 'objects': -+ pats += "," + ",".join([grp.groupid for grp in grps]) -+ igrps = self.igroups.return_groups(pats, case_sensitive=cs) -+ return igrps, grps ++ gpats = gpats + "," + ",".join([grp.groupid for grp in grps]) ++ igrps = self.igroups.return_groups(gpats, case_sensitive=cs) + - def doGroupLists(self, uservisible=0, patterns=None, ignore_case=True): -- """returns two lists of groups, installed groups and available groups -- optional 'uservisible' bool to tell it whether or not to return -- only groups marked as uservisible""" -- -- ++ evgrps = self.comps.return_environments(epats, case_sensitive=cs) ++ if self.conf.group_command == 'objects': ++ epats = epats+ "," + ",".join([grp.environmentid for grp in evgrps]) ++ ievgrps = self.igroups.return_environments(epats, case_sensitive=cs) ++ return igrps, grps, ievgrps, evgrps ++ ++ def doGroupLists(self, uservisible=0, patterns=None, ignore_case=True, ++ return_evgrps=False): + """Return two lists of groups: installed groups and available + groups. + @@ -152192,9 +152760,13 @@ index 99039e0..090882c 100644 + lists. If not given, all groups will be included + :param ignore_case: whether to ignore case when determining + whether group names match the strings in *patterns* ++ :param return_evgrps: whether to return environment groups as well as ++ package groups + """ installed = [] available = [] ++ einstalled = [] ++ eavailable = [] if self.comps.compscount == 0: raise Errors.GroupsError, _('No group data available for configured repositories') @@ -152204,13 +152776,20 @@ index 99039e0..090882c 100644 - else: - grps = self.comps.return_groups(",".join(patterns), - case_sensitive=not ignore_case) -+ igrps, grps = self._groupReturnGroups(patterns, ignore_case) ++ igrps, grps, ievgrps, evgrps = self._groupReturnGroups(patterns, ++ ignore_case) + + if igrps is not None: + digrps = {} + for igrp in igrps: + digrps[igrp.gid] = igrp + igrps = digrps ++ ++ if ievgrps is not None: ++ digrps = {} ++ for ievgrp in ievgrps: ++ digrps[ievgrp.evgid] = ievgrp ++ ievgrps = digrps + for grp in grps: - if grp.installed: @@ -152225,23 +152804,53 @@ index 99039e0..090882c 100644 if uservisible: if grp.user_visible: installed.append(grp) -@@ -2848,12 +3259,29 @@ class YumBase(depsolve.Depsolve): +@@ -2847,34 +3359,98 @@ class YumBase(depsolve.Depsolve): + available.append(grp) else: available.append(grp) ++ ++ for evgrp in evgrps: ++ if ievgrps is None: ++ evgrp_installed = evgrp.installed ++ else: ++ evgrp_installed = evgrp.environmentid in ievgrps ++ if evgrp_installed: ++ del ievgrps[evgrp.environmentid] ++ ++ if evgrp_installed: ++ einstalled.append(evgrp) ++ else: ++ eavailable.append(evgrp) + if igrps is None: -+ return sorted(installed), sorted(available) ++ igrps = {} ++ if ievgrps is None: ++ ievgrps = {} + + for igrp in igrps.values(): + # These are installed groups that aren't in comps anymore. so we + # create fake comps groups for them. + grp = comps.Group() ++ grp.groupid = igrp.gid + grp.installed = True + grp.name = grp.groupid + for pkg_name in igrp.pkg_names: + grp.mandatory_packages[pkg_name] = 1 + installed.append(grp) + ++ for ievgrp in ievgrps.values(): ++ # These are installed evgroups that aren't in comps anymore. so we ++ # create fake comps evgroups for them. ++ evgrp = comps.Environment() ++ grp.environmentid = ievgrp.evgid ++ evgrp.installed = True ++ evgrp.name = evgrp.environmentid ++ evgrp._groups = list(ievgrp.groups) ++ einstalled.append(evgrp) ++ ++ if return_evgrps: ++ return (sorted(installed), sorted(available), ++ sorted(einstalled), sorted(eavailable)) return sorted(installed), sorted(available) - @@ -152256,26 +152865,41 @@ index 99039e0..090882c 100644 + transaction set by this function + """ txmbrs_used = [] - - thesegroups = self.comps.return_groups(grpid) -@@ -2861,20 +3289,28 @@ class YumBase(depsolve.Depsolve): +- +- thesegroups = self.comps.return_groups(grpid) ++ ++ if self.conf.group_command == 'objects': ++ thesegroups = self.igroups.return_groups(grpid) ++ else: ++ thesegroups = self.comps.return_groups(grpid) + if not thesegroups: raise Errors.GroupsError, _("No Group named %s exists") % to_unicode(grpid) for thisgroup in thesegroups: + igroup_data = self._groupInstalledData(thisgroup) + thisgroup.toremove = True - pkgs = thisgroup.packages - for pkg in thisgroup.packages: +- pkgs = thisgroup.packages +- for pkg in thisgroup.packages: ++ ++ if self.conf.group_command == 'objects': ++ pkgs = thisgroup.pkg_names ++ gid = thisgroup.gid ++ else: ++ pkgs = thisgroup.packages ++ gid = thisgroup.groupid ++ ++ for pkg in pkgs: + if pkg in igroup_data and igroup_data[pkg] != 'installed': + continue + txmbrs = self.remove(name=pkg, silence_warnings=True) txmbrs_used.extend(txmbrs) for txmbr in txmbrs: - txmbr.groups.append(thisgroup.groupid) +- txmbr.groups.append(thisgroup.groupid) ++ txmbr.groups.append(gid) + if igroup_data: -+ self.igroups.del_group(thisgroup.groupid) ++ self.igroups.del_group(gid) return txmbrs_used @@ -152289,7 +152913,7 @@ index 99039e0..090882c 100644 thesegroups = self.comps.return_groups(grpid) if not thesegroups: raise Errors.GroupsError, _("No Group named %s exists") % to_unicode(grpid) -@@ -2898,13 +3334,18 @@ class YumBase(depsolve.Depsolve): +@@ -2898,13 +3474,58 @@ class YumBase(depsolve.Depsolve): self.tsInfo.remove(txmbr.po.pkgtup) @@ -152300,8 +152924,48 @@ index 99039e0..090882c 100644 - Optionally take: - group_package_types=List - overrides self.conf.group_package_types - enable_group_conditionals=Bool - overrides self.conf.enable_group_conditionals ++ def environmentRemove(self, evgrpid): ++ """Mark all the packages in the given group to be removed. ++ ++ :param evgrpid: the name of the environment containing the groups to ++ mark for removal ++ :return: a list of transaction members added to the ++ transaction set by this function ++ """ ++ txmbrs_used = [] ++ ++ if self.conf.group_command == 'objects': ++ thesegroups = self.igroups.return_environments(evgrpid) ++ else: ++ thesegroups = self.comps.return_environments(evgrpid) ++ if not thesegroups: ++ raise Errors.GroupsError, _("No Environment named %s exists") % to_unicode(evgrpid) ++ ++ for thisgroup in thesegroups: ++ igroup_data = self._groupInstalledEnvData(thisgroup) ++ ++ if self.conf.group_command == 'objects': ++ grps = thisgroup.grp_names ++ evgid = thisgroup.evgid ++ else: ++ grps = thisgroup.allgroups ++ evgid = thisgroup.environmentid ++ ++ for grp in grps: ++ if grp in igroup_data and igroup_data[grp] != 'installed': ++ continue ++ ++ txmbrs = self.groupRemove(grp) ++ txmbrs_used.extend(txmbrs) ++ for txmbr in txmbrs: ++ txmbr.environments.append(evgid) ++ if igroup_data: ++ self.igroups.del_environment(evgid) ++ ++ return txmbrs_used ++ + def selectGroup(self, grpid, group_package_types=[], -+ enable_group_conditionals=None, upgrade=False): ++ enable_group_conditionals=None, upgrade=False, ievgrp=None): + """Mark all the packages in the given group to be installed. + + :param grpid: the name of the group containing the packages to @@ -152315,7 +152979,17 @@ index 99039e0..090882c 100644 """ if not self.comps.has_group(grpid): -@@ -2934,12 +3375,47 @@ class YumBase(depsolve.Depsolve): +@@ -2920,6 +3541,9 @@ class YumBase(depsolve.Depsolve): + if group_package_types: + package_types = group_package_types + ++ if self.conf.group_command == 'compat': ++ upgrade = False ++ + for thisgroup in thesegroups: + if thisgroup.selected: + continue +@@ -2934,12 +3558,49 @@ class YumBase(depsolve.Depsolve): if 'optional' in package_types: pkgs.extend(thisgroup.optional_packages) @@ -152325,7 +152999,8 @@ index 99039e0..090882c 100644 + if thisgroup.groupid in self.igroups.groups: + igrp = self.igroups.groups[thisgroup.groupid] + else: -+ self.igroups.add_group(thisgroup.groupid,thisgroup.packages) ++ self.igroups.add_group(thisgroup.groupid, ++ thisgroup.packages, ievgrp) + pkgs.extend(list(igroup_data.keys())) + old_txmbrs = len(txmbrs_used) @@ -152353,7 +153028,8 @@ index 99039e0..090882c 100644 + if (upgrade and + (self.conf.group_command == 'simple' or + (igroup_data and igroup_data[pkg] == 'installed'))): -+ txmbrs = self.update(name = pkg) ++ txmbrs = self.update(name = pkg, ++ pkg_warning_level='debug2') + elif igroup_data and igroup_data[pkg] == 'installed': + pass # Don't upgrade on install. + else: @@ -152364,15 +153040,28 @@ index 99039e0..090882c 100644 except Errors.InstallError, e: self.verbose_logger.debug(_('No package named %s available to be installed'), pkg) -@@ -2953,6 +3429,7 @@ class YumBase(depsolve.Depsolve): +@@ -2953,7 +3614,9 @@ class YumBase(depsolve.Depsolve): group_conditionals = enable_group_conditionals count_cond_test = 0 +- if group_conditionals: + # FIXME: What do we do about group conditionals when group==objects - if group_conditionals: ++ # or group upgrade for group_command=simple? ++ if not upgrade and group_conditionals: for condreq, cond in thisgroup.conditional_packages.iteritems(): if self.isPackageInstalled(cond): -@@ -2997,10 +3474,14 @@ class YumBase(depsolve.Depsolve): + try: +@@ -2990,17 +3653,22 @@ class YumBase(depsolve.Depsolve): + if cond not in self.tsInfo.conditionals: + self.tsInfo.conditionals[cond] = [] + self.tsInfo.conditionals[cond].extend(pkgs) +- if len(txmbrs_used) == old_txmbrs: +- self.logger.critical(_('Warning: Group %s does not have any packages.'), thisgroup.groupid) ++ ++ if not upgrade and len(txmbrs_used) == old_txmbrs: ++ self.logger.critical(_('Warning: Group %s does not have any packages to install.'), thisgroup.groupid) + if count_cond_test: + self.logger.critical(_('Group %s does have %u conditional packages, which may get installed.'), count_cond_test) return txmbrs_used def deselectGroup(self, grpid, force=False): @@ -152391,9 +153080,100 @@ index 99039e0..090882c 100644 if not self.comps.has_group(grpid): raise Errors.GroupsError, _("No Group named %s exists") % to_unicode(grpid) -@@ -3035,12 +3516,21 @@ class YumBase(depsolve.Depsolve): +@@ -3008,7 +3676,8 @@ class YumBase(depsolve.Depsolve): + thesegroups = self.comps.return_groups(grpid) + if not thesegroups: + raise Errors.GroupsError, _("No Group named %s exists") % to_unicode(grpid) +- ++ ++ # FIXME: Do something with groups as objects, and env. groups. + for thisgroup in thesegroups: + thisgroup.selected = False + +@@ -3034,13 +3703,102 @@ class YumBase(depsolve.Depsolve): + for pkg in self.tsInfo.conditionals.get(txmbr.name, []): self.tsInfo.remove(pkg.pkgtup) ++ def selectEnvironment(self, evgrpid, group_package_types=[], ++ enable_group_conditionals=None, upgrade=False): ++ """Mark all the groups in the given environment group to be installed. ++ ++ :param evgrpid: the name of the env. group containing the groups to ++ mark for installation ++ :param group_package_types: a list of the types of groups to ++ work with. This overrides self.conf.group_package_types ++ :param enable_group_conditionals: overrides ++ self.conf.enable_group_conditionals ++ :return: a list of transaction members added to the ++ transaction set by this function ++ """ ++ evgrps = self.comps.return_environments(evgrpid) ++ if not evgrps: ++ raise Errors.GroupsError, _("No Environment named %s exists") % to_unicode(evgrpid) ++ ++ ret = [] ++ for evgrp in evgrps: ++ ++ ievgrp = None ++ if self.conf.group_command == 'compat': ++ grps = ",".join(sorted(evgrp.groups)) ++ elif self.conf.group_command == 'simple': ++ if not upgrade: ++ grps = ",".join(sorted(evgrp.groups)) ++ else: # Only upgrade the installed groups... ++ grps = [] ++ for grpid in evgrp.groups: ++ grp = self.comps.return_group(grpid) ++ if grp is None: ++ continue ++ if not grp.installed: ++ continue ++ grps.append(grpid) ++ grps = ",".join(sorted(grps)) ++ elif self.conf.group_command == 'objects': ++ igroup_data = self._groupInstalledEnvData(evgrp) ++ ++ grps = [] ++ for grpid in evgrp.groups: ++ if (grpid not in igroup_data or ++ igroup_data[grpid].startswith('blacklisted')): ++ msg = _('Skipping group %s from environment %s'), ++ self.verbose_logger.log(logginglevels.DEBUG_2, ++ msg, grpid, evgrp.environmentid) ++ continue ++ grps.apped(grp) ++ if evgrp.environmentid in self.igroups.environments: ++ ievgrp = self.igroups.environments[evgrp.environmentid] ++ else: ++ self.igroups.add_environment(evgrp.environmentid, ++ evgrp.allgroups) ++ grps = ",".join(sorted(grps)) ++ ++ txs = self.selectGroup(grps, ++ group_package_types, ++ enable_group_conditionals, upgrade, ++ ievgrp=ievgrp) ++ ret.extend(txs) ++ return ret ++ ++ def deselectEnvironment(self, evgrpid, force=False): ++ """Unmark the groups in the given environment group from being ++ installed. ++ ++ :param evgrpid: the name of the environment group containing the ++ groups to unmark from installation ++ :param force: if True, force remove all the packages in the ++ given groups from the transaction ++ """ ++ evgrps = self.comps.return_environments(evgrpid) ++ if not thesegroups: ++ raise Errors.GroupsError, _("No Environment named %s exists") % to_unicode(evgrpid) ++ ++ for evgrp in evgrps: ++ grps = ",".join(sorted(evgrp.groups)) ++ self.deselectGroup(grps, force) ++ # FIXME: env. needs to be marked not-to-be-installed, etc. ++ def getPackageObject(self, pkgtup, allow_missing=False): - """retrieves a packageObject from a pkgtuple - if we need - to pick and choose which one is best we better call out @@ -152419,7 +153199,7 @@ index 99039e0..090882c 100644 # look it up in the self.localPackages first: for po in self.localPackages: if po.pkgtup == pkgtup: -@@ -3049,7 +3539,7 @@ class YumBase(depsolve.Depsolve): +@@ -3049,7 +3807,7 @@ class YumBase(depsolve.Depsolve): pkgs = self.pkgSack.searchPkgTuple(pkgtup) if len(pkgs) == 0: @@ -152428,7 +153208,7 @@ index 99039e0..090882c 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 +3555,21 @@ class YumBase(depsolve.Depsolve): +@@ -3065,13 +3823,21 @@ class YumBase(depsolve.Depsolve): return result def getInstalledPackageObject(self, pkgtup): @@ -152455,7 +153235,7 @@ index 99039e0..090882c 100644 raise Errors.RpmDBError, _('Package tuple %s could not be found in rpmdb') % str(pkgtup) # Dito. FIXME from getPackageObject() for len() > 1 ... :) -@@ -3079,9 +3577,11 @@ class YumBase(depsolve.Depsolve): +@@ -3079,9 +3845,11 @@ class YumBase(depsolve.Depsolve): return po def gpgKeyCheck(self): @@ -152469,7 +153249,7 @@ index 99039e0..090882c 100644 gpgkeyschecked = self.conf.cachedir + '/.gpgkeyschecked.yum' if os.path.exists(gpgkeyschecked): return 1 -@@ -3106,9 +3606,13 @@ class YumBase(depsolve.Depsolve): +@@ -3106,9 +3874,13 @@ class YumBase(depsolve.Depsolve): return 1 def returnPackagesByDep(self, depstring): @@ -152485,7 +153265,7 @@ index 99039e0..090882c 100644 if not depstring: return [] -@@ -3135,9 +3639,16 @@ class YumBase(depsolve.Depsolve): +@@ -3135,9 +3907,16 @@ class YumBase(depsolve.Depsolve): return self.pkgSack.getProvides(depname, depflags, depver).keys() def returnPackageByDep(self, depstring): @@ -152505,7 +153285,7 @@ index 99039e0..090882c 100644 # we get all sorts of randomness here errstring = depstring if type(depstring) not in types.StringTypes: -@@ -3149,16 +3660,22 @@ class YumBase(depsolve.Depsolve): +@@ -3149,16 +3928,22 @@ class YumBase(depsolve.Depsolve): raise Errors.YumBaseError, _('No Package found for %s') % errstring ps = ListPackageSack(pkglist) @@ -152532,7 +153312,7 @@ index 99039e0..090882c 100644 if not depstring: return [] -@@ -3184,12 +3701,47 @@ class YumBase(depsolve.Depsolve): +@@ -3184,12 +3969,47 @@ class YumBase(depsolve.Depsolve): return self.rpmdb.getProvides(depname, depflags, depver).keys() @@ -152582,7 +153362,7 @@ index 99039e0..090882c 100644 if len(pkglist) == 0: -@@ -3198,14 +3750,23 @@ class YumBase(depsolve.Depsolve): +@@ -3198,14 +4018,23 @@ class YumBase(depsolve.Depsolve): if len(pkglist) == 1: return pkglist[0] @@ -152612,7 +153392,7 @@ index 99039e0..090882c 100644 returnlist = [] compatArchList = self.arch.get_arch_list(arch) multiLib = [] -@@ -3222,9 +3783,9 @@ class YumBase(depsolve.Depsolve): +@@ -3222,9 +4051,9 @@ class YumBase(depsolve.Depsolve): singleLib.append(po) # we now have three lists. find the best package(s) of each @@ -152625,7 +153405,7 @@ index 99039e0..090882c 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 +3799,7 @@ class YumBase(depsolve.Depsolve): +@@ -3238,7 +4067,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: @@ -152634,7 +153414,7 @@ index 99039e0..090882c 100644 if best.arch == "noarch": returnlist.append(no) else: -@@ -3246,7 +3807,7 @@ class YumBase(depsolve.Depsolve): +@@ -3246,7 +4075,7 @@ class YumBase(depsolve.Depsolve): if single: returnlist.append(single) # similar for the non-multilib case elif single: @@ -152643,7 +153423,7 @@ index 99039e0..090882c 100644 if best.arch == "noarch": returnlist.append(no) else: -@@ -3350,23 +3911,27 @@ class YumBase(depsolve.Depsolve): +@@ -3350,28 +4179,58 @@ class YumBase(depsolve.Depsolve): done = True slow = next_func(slow) @@ -152658,6 +153438,20 @@ index 99039e0..090882c 100644 assert pattern[0] == '@' group_string = pattern[1:] tx_return = [] ++ ++ if group_string and group_string[0] == '^': ++ group_string = group_string[1:] ++ # Actually dealing with "environment groups". ++ for env_grp in self.comps.return_environments(group_string): ++ try: ++ txmbrs = self.selectEnvironment(env_grp.environmentid, ++ upgrade=upgrade) ++ tx_return.extend(txmbrs) ++ except yum.Errors.GroupsError: ++ self.logger.critical(_('Warning: Environment Group %s does not exist.'), group_string) ++ continue ++ return tx_return ++ for group in self.comps.return_groups(group_string): try: - txmbrs = self.selectGroup(group.groupid) @@ -152676,16 +153470,46 @@ index 99039e0..090882c 100644 def _at_groupremove(self, pattern): " Do groupremove via. leading @ on the cmd line, for remove." assert pattern[0] == '@' -@@ -3398,7 +3963,7 @@ class YumBase(depsolve.Depsolve): + group_string = pattern[1:] + tx_return = [] ++ ++ if group_string and group_string[0] == '^': ++ group_string = group_string[1:] ++ # Actually dealing with "environment groups". ++ try: ++ txmbrs = self.environmentRemove(group_string) ++ except yum.Errors.GroupsError: ++ self.logger.critical(_('Warning: Environment Group %s does not exist.'), group_string) ++ else: ++ tx_return.extend(txmbrs) ++ return tx_return ++ + try: + txmbrs = self.groupRemove(group_string) + except yum.Errors.GroupsError: +@@ -3387,6 +4246,8 @@ class YumBase(depsolve.Depsolve): + assert pattern[0] == '@' + grpid = pattern[1:] + ++ # FIXME: **** environment groups and groups as objects... **** ++ + thesegroups = self.comps.return_groups(grpid) + if not thesegroups: + raise Errors.GroupsError, _("No Group named %s exists") % to_unicode(grpid) +@@ -3398,7 +4259,11 @@ class YumBase(depsolve.Depsolve): def _minus_deselect(self, pattern): """ Remove things from the transaction, like kickstart. """ assert pattern[0] == '-' - pat = pattern[1:] + pat = pattern[1:].strip() ++ ++ if pat and pat.startswith('@^'): ++ pat = pat[2:] ++ return self.deselectEnvironment(pat) if pat and pat[0] == '@': pat = pat[1:] -@@ -3437,14 +4002,61 @@ class YumBase(depsolve.Depsolve): +@@ -3437,14 +4302,61 @@ class YumBase(depsolve.Depsolve): if flag not in self.tsInfo.probFilterFlags: self.tsInfo.probFilterFlags.append(flag) @@ -152753,7 +153577,7 @@ index 99039e0..090882c 100644 pkgs = [] was_pattern = False if po: -@@ -3477,20 +4089,12 @@ class YumBase(depsolve.Depsolve): +@@ -3477,20 +4389,12 @@ class YumBase(depsolve.Depsolve): self.verbose_logger.debug(_('Checking for virtual provide or file-provide for %s'), arg) @@ -152780,7 +153604,7 @@ index 99039e0..090882c 100644 else: nevra_dict = self._nevra_kwarg_parse(kwargs) -@@ -3577,8 +4181,8 @@ class YumBase(depsolve.Depsolve): +@@ -3577,8 +4481,8 @@ class YumBase(depsolve.Depsolve): continue # make sure this shouldn't be passed to update: @@ -152791,7 +153615,7 @@ index 99039e0..090882c 100644 txmbrs = self.update(po=po) tx_return.extend(txmbrs) continue -@@ -3587,7 +4191,7 @@ class YumBase(depsolve.Depsolve): +@@ -3587,7 +4491,7 @@ class YumBase(depsolve.Depsolve): # something else in the repo. Unless there is a obsoletion loop, # at which point ignore everything. obsoleting_pkg = None @@ -152800,7 +153624,7 @@ index 99039e0..090882c 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 +4204,23 @@ class YumBase(depsolve.Depsolve): +@@ -3600,23 +4504,23 @@ class YumBase(depsolve.Depsolve): already_obs = pkgs[0] if already_obs: @@ -152831,7 +153655,7 @@ index 99039e0..090882c 100644 continue # make sure we don't have a name.arch of this already installed -@@ -3630,7 +4234,7 @@ class YumBase(depsolve.Depsolve): +@@ -3630,7 +4534,7 @@ class YumBase(depsolve.Depsolve): found = True break if not found: @@ -152840,7 +153664,7 @@ index 99039e0..090882c 100644 txmbrs = self.update(po=po) tx_return.extend(txmbrs) continue -@@ -3719,14 +4323,33 @@ class YumBase(depsolve.Depsolve): +@@ -3719,19 +4623,47 @@ class YumBase(depsolve.Depsolve): return txmbr def update(self, po=None, requiringPo=None, update_to=False, **kwargs): @@ -152881,7 +153705,21 @@ index 99039e0..090882c 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 +4388,12 @@ class YumBase(depsolve.Depsolve): + # uninstalled pkgs called for update get returned with errors in a list, maybe? + ++ pkg_warn = kwargs.get('pkg_warning_level', 'flibble') ++ def _dbg2(*args, **kwargs): ++ self.verbose_logger.log(logginglevels.DEBUG_2, *args, **kwargs) ++ level2func = {'debug2' : _dbg2, ++ 'warning' : self.verbose_logger.warning} ++ if pkg_warn not in level2func: ++ pkg_warn = 'warning' ++ pkg_warn = level2func[pkg_warn] ++ + tx_return = [] + if not po and not kwargs: # update everything (the easy case) + self.verbose_logger.log(logginglevels.DEBUG_2, _('Updating Everything')) +@@ -3765,7 +4697,12 @@ class YumBase(depsolve.Depsolve): if new is None: continue tx_return.extend(self.update(po=new)) @@ -152895,7 +153733,7 @@ index 99039e0..090882c 100644 return tx_return # complications -@@ -3787,7 +4415,7 @@ class YumBase(depsolve.Depsolve): +@@ -3787,7 +4724,7 @@ class YumBase(depsolve.Depsolve): return self._minus_deselect(kwargs['pattern']) if kwargs['pattern'] and kwargs['pattern'][0] == '@': @@ -152904,7 +153742,16 @@ index 99039e0..090882c 100644 arg = kwargs['pattern'] if not update_to: -@@ -3920,6 +4548,18 @@ class YumBase(depsolve.Depsolve): +@@ -3843,7 +4780,7 @@ class YumBase(depsolve.Depsolve): + availpkgs = self._compare_providers(availpkgs, requiringPo) + availpkgs = map(lambda x: x[0], availpkgs) + elif not availpkgs: +- self.logger.warning(_("No package matched to upgrade: %s"), self._ui_nevra_dict(nevra_dict)) ++ pkg_warn(_("No package matched to upgrade: %s"), self._ui_nevra_dict(nevra_dict)) + + # for any thing specified + # get the list of available pkgs matching it (or take the po) +@@ -3920,6 +4857,18 @@ class YumBase(depsolve.Depsolve): tx_return.append(txmbr) for available_pkg in availpkgs: @@ -152923,7 +153770,7 @@ index 99039e0..090882c 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 +4625,18 @@ class YumBase(depsolve.Depsolve): +@@ -3985,11 +4934,18 @@ class YumBase(depsolve.Depsolve): return tx_return def remove(self, po=None, **kwargs): @@ -152947,7 +153794,7 @@ index 99039e0..090882c 100644 if not po and not kwargs: raise Errors.RemoveError, 'Nothing specified to remove' -@@ -4055,17 +4702,19 @@ class YumBase(depsolve.Depsolve): +@@ -4055,17 +5011,19 @@ class YumBase(depsolve.Depsolve): return tx_return def installLocal(self, pkg, po=None, updateonly=False): @@ -152977,7 +153824,7 @@ index 99039e0..090882c 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 +4832,15 @@ class YumBase(depsolve.Depsolve): +@@ -4183,16 +5141,15 @@ class YumBase(depsolve.Depsolve): return tx_return def reinstallLocal(self, pkg, po=None): @@ -153002,7 +153849,7 @@ index 99039e0..090882c 100644 if not po: try: po = YumUrlPackage(self, ts=self.rpmdb.readOnlyTS(), url=pkg, -@@ -4215,9 +4863,19 @@ class YumBase(depsolve.Depsolve): +@@ -4215,9 +5172,19 @@ class YumBase(depsolve.Depsolve): return self.reinstall(po=po) def reinstall(self, po=None, **kwargs): @@ -153025,7 +153872,7 @@ index 99039e0..090882c 100644 self._add_prob_flags(rpm.RPMPROB_FILTER_REPLACEPKG, rpm.RPMPROB_FILTER_REPLACENEWFILES, rpm.RPMPROB_FILTER_REPLACEOLDFILES) -@@ -4259,16 +4917,15 @@ class YumBase(depsolve.Depsolve): +@@ -4259,16 +5226,15 @@ class YumBase(depsolve.Depsolve): return tx_mbrs def downgradeLocal(self, pkg, po=None): @@ -153050,7 +153897,7 @@ index 99039e0..090882c 100644 if not po: try: po = YumUrlPackage(self, ts=self.rpmdb.readOnlyTS(), url=pkg, -@@ -4309,13 +4966,19 @@ class YumBase(depsolve.Depsolve): +@@ -4309,13 +5275,19 @@ class YumBase(depsolve.Depsolve): return False def downgrade(self, po=None, **kwargs): @@ -153077,7 +153924,7 @@ index 99039e0..090882c 100644 if not po and not kwargs: raise Errors.DowngradeError, 'Nothing specified to downgrade' -@@ -4421,6 +5084,9 @@ class YumBase(depsolve.Depsolve): +@@ -4421,6 +5393,9 @@ class YumBase(depsolve.Depsolve): warned_nas.add(na) continue @@ -153087,7 +153934,7 @@ index 99039e0..090882c 100644 if pkg.verGE(lipkg): if na not in warned_nas: msg = _('Only Upgrade available on package: %s') % pkg -@@ -4457,7 +5123,7 @@ class YumBase(depsolve.Depsolve): +@@ -4457,7 +5432,7 @@ class YumBase(depsolve.Depsolve): if e and v and r: evr = '%s:%s-%s' % (e, v, r) elif v and r: @@ -153096,7 +153943,7 @@ index 99039e0..090882c 100644 elif e and v: evr = '%s:%s' % (e, v) elif v: # e and r etc. is just too weird to print -@@ -4500,12 +5166,24 @@ class YumBase(depsolve.Depsolve): +@@ -4500,12 +5475,24 @@ class YumBase(depsolve.Depsolve): return returndict @@ -153124,7 +153971,7 @@ index 99039e0..090882c 100644 old_conf_obs = self.conf.obsoletes self.conf.obsoletes = False done = False -@@ -4515,19 +5193,46 @@ class YumBase(depsolve.Depsolve): +@@ -4515,19 +5502,46 @@ class YumBase(depsolve.Depsolve): done = True for pkg in transaction.trans_data: if pkg.state == 'Downgrade': @@ -153171,7 +154018,7 @@ index 99039e0..090882c 100644 if self.install(pkgtup=pkg.pkgtup): done = True for pkg in transaction.trans_data: -@@ -4538,8 +5243,14 @@ class YumBase(depsolve.Depsolve): +@@ -4538,8 +5552,14 @@ class YumBase(depsolve.Depsolve): return done def history_undo(self, transaction): @@ -153188,7 +154035,7 @@ index 99039e0..090882c 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 +5327,7 @@ class YumBase(depsolve.Depsolve): +@@ -4616,7 +5636,7 @@ class YumBase(depsolve.Depsolve): except urlgrabber.grabber.URLGrabError, e: raise Errors.YumBaseError(_('GPG key retrieval failed: ') + @@ -153197,7 +154044,7 @@ index 99039e0..090882c 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 +5360,7 @@ class YumBase(depsolve.Depsolve): +@@ -4649,7 +5669,7 @@ class YumBase(depsolve.Depsolve): keys_info = misc.getgpgkeyinfo(rawkey, multiple=True) except ValueError, e: raise Errors.YumBaseError(_('Invalid GPG Key from %s: %s') % @@ -153206,7 +154053,7 @@ index 99039e0..090882c 100644 keys = [] for keyinfo in keys_info: thiskey = {} -@@ -4674,39 +5385,49 @@ class YumBase(depsolve.Depsolve): +@@ -4674,39 +5694,49 @@ class YumBase(depsolve.Depsolve): if pkgs: pkgs = sorted(pkgs)[-1] msg = (_('Importing %s key 0x%s:\n' @@ -153274,7 +154121,7 @@ index 99039e0..090882c 100644 user_cb_fail = False for keyurl in keyurls: keys = self._retrievePublicKey(keyurl, repo) -@@ -4725,7 +5446,9 @@ class YumBase(depsolve.Depsolve): +@@ -4725,7 +5755,9 @@ class YumBase(depsolve.Depsolve): # Try installing/updating GPG key self._getKeyImportMessage(info, keyurl) rc = False @@ -153285,7 +154132,7 @@ index 99039e0..090882c 100644 rc = True # grab the .sig/.asc for the keyurl, if it exists -@@ -4751,8 +5474,8 @@ class YumBase(depsolve.Depsolve): +@@ -4751,8 +5783,8 @@ class YumBase(depsolve.Depsolve): ts = self.rpmdb.readOnlyTS() result = ts.pgpImportPubkey(misc.procgpgkey(info['raw_key'])) if result != 0: @@ -153296,7 +154143,7 @@ index 99039e0..090882c 100644 self.logger.info(_('Key imported successfully')) key_installed = True -@@ -4760,18 +5483,20 @@ class YumBase(depsolve.Depsolve): +@@ -4760,18 +5792,20 @@ class YumBase(depsolve.Depsolve): raise Errors.YumBaseError, _("Didn't install any keys") if not key_installed: @@ -153322,7 +154169,7 @@ index 99039e0..090882c 100644 def _getAnyKeyForRepo(self, repo, destdir, keyurl_list, is_cakey=False, callback=None): """ -@@ -4788,6 +5513,18 @@ class YumBase(depsolve.Depsolve): +@@ -4788,6 +5822,18 @@ class YumBase(depsolve.Depsolve): """ key_installed = False @@ -153341,7 +154188,7 @@ index 99039e0..090882c 100644 user_cb_fail = False for keyurl in keyurl_list: keys = self._retrievePublicKey(keyurl, repo, getSig=not is_cakey) -@@ -4819,8 +5556,11 @@ class YumBase(depsolve.Depsolve): +@@ -4819,8 +5865,11 @@ class YumBase(depsolve.Depsolve): if not key_installed: self._getKeyImportMessage(info, keyurl, keytype) rc = False @@ -153354,7 +154201,7 @@ index 99039e0..090882c 100644 elif callback: rc = callback({"repo": repo, "userid": info['userid'], "hexkeyid": info['hexkeyid'], "keyurl": keyurl, -@@ -4835,7 +5575,8 @@ class YumBase(depsolve.Depsolve): +@@ -4835,7 +5884,8 @@ class YumBase(depsolve.Depsolve): # Import the key result = misc.import_key_to_pubring(info['raw_key'], info['hexkeyid'], gpgdir=destdir) if not result: @@ -153364,7 +154211,7 @@ index 99039e0..090882c 100644 self.logger.info(_('Key imported successfully')) key_installed = True # write out the key id to imported_cakeys in the repos basedir -@@ -4851,36 +5592,35 @@ class YumBase(depsolve.Depsolve): +@@ -4851,36 +5901,35 @@ class YumBase(depsolve.Depsolve): pass if not key_installed and user_cb_fail: @@ -153417,7 +154264,7 @@ index 99039e0..090882c 100644 self._getAnyKeyForRepo(repo, repo.gpgcadir, repo.gpgcakey, is_cakey=True, callback=callback) def _limit_installonly_pkgs(self): -@@ -4927,6 +5667,7 @@ class YumBase(depsolve.Depsolve): +@@ -4927,6 +5976,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) @@ -153425,7 +154272,7 @@ index 99039e0..090882c 100644 for m in self.tsInfo.getMembers(): if m.ts_state not in ('i', 'u'): continue -@@ -4937,12 +5678,21 @@ class YumBase(depsolve.Depsolve): +@@ -4937,12 +5987,21 @@ class YumBase(depsolve.Depsolve): if not po_names.intersection(install_only_names): continue @@ -153451,7 +154298,7 @@ index 99039e0..090882c 100644 for po in installed: if (po.version, po.release) == (cur_kernel_v, cur_kernel_r): # don't remove running -@@ -4959,19 +5709,22 @@ class YumBase(depsolve.Depsolve): +@@ -4959,19 +6018,22 @@ class YumBase(depsolve.Depsolve): txmbr.depends_on.append(rel) def processTransaction(self, callback=None,rpmTestDisplay=None, rpmDisplay=None): @@ -153487,7 +154334,7 @@ index 99039e0..090882c 100644 if not callback: callback = callbacks.ProcessTransNoOutputCallback() -@@ -5114,13 +5867,19 @@ class YumBase(depsolve.Depsolve): +@@ -5114,13 +6176,19 @@ class YumBase(depsolve.Depsolve): return results def add_enable_repo(self, repoid, baseurls=[], mirrorlist=None, **kwargs): @@ -153514,7 +154361,7 @@ index 99039e0..090882c 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 +5926,15 @@ class YumBase(depsolve.Depsolve): +@@ -5167,9 +6235,15 @@ class YumBase(depsolve.Depsolve): def setCacheDir(self, force=False, tmpdir=None, reuse=True, suffix='/$basearch/$releasever'): @@ -153533,7 +154380,7 @@ index 99039e0..090882c 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 +5944,7 @@ class YumBase(depsolve.Depsolve): +@@ -5179,7 +6253,7 @@ class YumBase(depsolve.Depsolve): try: cachedir = misc.getCacheDir(tmpdir, reuse) except (IOError, OSError), e: @@ -153542,7 +154389,7 @@ index 99039e0..090882c 100644 cachedir = None if cachedir is None: -@@ -5190,6 +5955,7 @@ class YumBase(depsolve.Depsolve): +@@ -5190,6 +6264,7 @@ class YumBase(depsolve.Depsolve): self.prerepoconf.cachedir = cachedir else: self.repos.setCacheDir(cachedir) @@ -153550,7 +154397,7 @@ index 99039e0..090882c 100644 self.conf.cachedir = cachedir return True # We got a new cache dir -@@ -5220,13 +5986,24 @@ class YumBase(depsolve.Depsolve): +@@ -5220,13 +6295,24 @@ class YumBase(depsolve.Depsolve): self.history.write_addon_data('config-repos', myrepos) def verify_plugins_cb(self, verify_package): @@ -153578,7 +154425,7 @@ index 99039e0..090882c 100644 if self.tsInfo._unresolvedMembers: if auto: self.logger.critical(_("Dependencies not solved. Will not save unresolved transaction.")) -@@ -5234,7 +6011,7 @@ class YumBase(depsolve.Depsolve): +@@ -5234,7 +6320,7 @@ class YumBase(depsolve.Depsolve): raise Errors.YumBaseError(_("Dependencies not solved. Will not save unresolved transaction.")) if not filename: @@ -153587,7 +154434,7 @@ index 99039e0..090882c 100644 fd,filename = tempfile.mkstemp(suffix='.yumtx', prefix=prefix) f = os.fdopen(fd, 'w') else: -@@ -5244,13 +6021,17 @@ class YumBase(depsolve.Depsolve): +@@ -5244,13 +6330,17 @@ class YumBase(depsolve.Depsolve): msg = "%s\n" % self.rpmdb.simpleVersion(main_only=True)[0] msg += "%s\n" % self.ts.getTsFlags() @@ -153608,7 +154455,7 @@ index 99039e0..090882c 100644 msg += "%s\n" % len(self.tsInfo.getMembers()) for txmbr in self.tsInfo.getMembers(): msg += txmbr._dump() -@@ -5260,13 +6041,25 @@ class YumBase(depsolve.Depsolve): +@@ -5260,13 +6350,25 @@ class YumBase(depsolve.Depsolve): except (IOError, OSError), e: self._ts_save_file = None if auto: @@ -153640,7 +154487,7 @@ index 99039e0..090882c 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 +6069,45 @@ class YumBase(depsolve.Depsolve): +@@ -5276,26 +6378,45 @@ class YumBase(depsolve.Depsolve): try: data = open(filename, 'r').readlines() except (IOError, OSError), e: @@ -153688,7 +154535,7 @@ index 99039e0..090882c 100644 if ignorerpm: msg += _(" ignoring, as requested.") self.logger.critical(_(msg)) -@@ -5318,8 +6130,17 @@ class YumBase(depsolve.Depsolve): +@@ -5318,8 +6439,17 @@ class YumBase(depsolve.Depsolve): numrepos = int(data[2].strip()) repos = [] rindex=3+numrepos @@ -153707,7 +154554,7 @@ index 99039e0..090882c 100644 # pkgs/txmbrs numpkgs = int(data[rindex].strip()) -@@ -5329,6 +6150,7 @@ class YumBase(depsolve.Depsolve): +@@ -5329,6 +6459,7 @@ class YumBase(depsolve.Depsolve): pkgcount = 0 pkgprob = False curpkg = None @@ -153715,7 +154562,7 @@ index 99039e0..090882c 100644 for l in data[pkgstart:]: l = l.rstrip() # our main txmbrs -@@ -5438,6 +6260,11 @@ class YumBase(depsolve.Depsolve): +@@ -5438,6 +6569,11 @@ class YumBase(depsolve.Depsolve): msg += _(" aborting.") raise Errors.YumBaseError(msg) @@ -153727,7 +154574,7 @@ index 99039e0..090882c 100644 return self.tsInfo.getMembers() def _remove_old_deps(self): -@@ -5470,18 +6297,6 @@ class YumBase(depsolve.Depsolve): +@@ -5470,18 +6606,6 @@ class YumBase(depsolve.Depsolve): if requiring == required: # if they are self-requiring skip them continue @@ -153746,7 +154593,7 @@ index 99039e0..090882c 100644 #for tbi_pkg in self.tsInfo.getMembersWithState(output_states=TS_INSTALL_STATES): # for reqtuple in tbi_pkg.po.requires: # if required.provides_for(reqtuple): -@@ -5533,7 +6348,24 @@ class YumBase(depsolve.Depsolve): +@@ -5533,7 +6657,24 @@ class YumBase(depsolve.Depsolve): # Debugging output self.verbose_logger.log(logginglevels.DEBUG_2, _("%s has revdep %s which was user-installed."), pkg, curpkg) ok_to_remove[pkg] = False @@ -153771,7 +154618,7 @@ index 99039e0..090882c 100644 visited[curpkg] = True all_leaves_visited = True leaves = curpkg.requiring_packages() -@@ -5547,4 +6379,3 @@ class YumBase(depsolve.Depsolve): +@@ -5547,4 +6688,3 @@ class YumBase(depsolve.Depsolve): # Debugging output self.verbose_logger.log(logginglevels.DEBUG_2, _("%s has no user-installed revdeps."), pkg) return False @@ -153923,6 +154770,322 @@ index 7ad25ce..a9a8e53 100644 + """ pass +diff --git a/yum/comps.py b/yum/comps.py +index 65f6d5e..cf671b6 100755 +--- a/yum/comps.py ++++ b/yum/comps.py +@@ -43,6 +43,16 @@ class CompsObj(object): + return self.name + + @property ++ def compsid(self): ++ """ Return the "id": categoryid, groupid, environmentid. """ ++ ++ for idT in ('categoryid', 'groupid', 'environmentid'): ++ if hasattr(self, idT): ++ return getattr(self, idT) ++ ++ return None ++ ++ @property + def ui_name(self): + """ Return the "name" of the object for the current locale. """ + return self.nameByLang(get_my_lang_code()) +@@ -108,7 +118,7 @@ class Group(CompsObj): + self.optional_packages = {} + self.default_packages = {} + self.conditional_packages = {} +- self.langonly = None ## what the hell is this? ++ self.langonly = None + self.groupid = None + self.display_order = 1024 + self.installed = False +@@ -272,6 +282,137 @@ class Group(CompsObj): + return msg + + ++class Environment(CompsObj): ++ """ Environment object parsed from group data in each repo, and merged """ ++ ++ def __init__(self, elem=None): ++ self.name = "" ++ self.environmentid = None ++ self.description = "" ++ self.translated_name = {} ++ self.translated_description = {} ++ self.display_order = 1024 ++ self.langonly = None ++ self.installed = False ++ self._groups = {} ++ self._options = {} ++ ++ if elem: ++ self.parse(elem) ++ ++ def _allgroupiter(self): ++ lst = self._groups.keys() + \ ++ self._options.keys() ++ return lst ++ ++ allgroups = property(_allgroupiter) ++ ++ def _groupiter(self): ++ return self._groups.keys() ++ ++ groups = property(_groupiter) ++ ++ def _optioniter(self): ++ return self._options.keys() ++ ++ options = property(_optioniter) ++ ++ def parse(self, elem): ++ for child in elem: ++ if child.tag == 'id': ++ myid = child.text ++ if self.environmentid is not None: ++ raise CompsException ++ self.environmentid = myid ++ ++ elif child.tag == 'name': ++ text = child.text ++ if text: ++ text = text.encode('utf8') ++ ++ lang = child.attrib.get(lang_attr) ++ if lang: ++ self.translated_name[lang] = text ++ else: ++ self.name = text ++ ++ elif child.tag == 'description': ++ text = child.text ++ if text: ++ text = text.encode('utf8') ++ ++ lang = child.attrib.get(lang_attr) ++ if lang: ++ self.translated_description[lang] = text ++ else: ++ self.description = text ++ ++ elif child.tag == 'grouplist': ++ self.parse_group_list(child) ++ ++ elif child.tag == 'optionlist': ++ self.parse_option_list(child) ++ ++ elif child.tag == 'display_order': ++ self.display_order = parse_number(child.text) ++ ++ def parse_group_list(self, grouplist_elem): ++ for child in grouplist_elem: ++ if child.tag == 'groupid': ++ groupid = child.text ++ self._groups[groupid] = 1 ++ ++ def parse_option_list(self, optionlist_elem): ++ for child in optionlist_elem: ++ if child.tag == 'groupid': ++ optionid = child.text ++ self._options[optionid] = 1 ++ ++ def add(self, obj): ++ """Add another category object to this object""" ++ ++ for grp in obj.groups: ++ self._groups[grp] = 1 ++ ++ for grp in obj.options: ++ self._options[grp] = 1 ++ ++ # name and description translations ++ for lang in obj.translated_name: ++ if lang not in self.translated_name: ++ self.translated_name[lang] = obj.translated_name[lang] ++ ++ for lang in obj.translated_description: ++ if lang not in self.translated_description: ++ self.translated_description[lang] = obj.translated_description[lang] ++ ++ def xml(self): ++ """write out an xml stanza for the environment object""" ++ msg =""" ++ ++ %s ++ %s\n""" % (self.environmentid, self.display_order) ++ ++ msg +=""" %s\n""" % self.name ++ for (lang, val) in self.translated_name.items(): ++ msg += """ %s\n""" % (lang, val) ++ ++ msg += """ %s\n""" % self.description ++ for (lang, val) in self.translated_description.items(): ++ msg += """ %s\n""" % (lang, val) ++ ++ msg += """ \n""" ++ for grp in self.groups: ++ msg += """ %s\n""" % grp ++ msg += """ \n""" ++ msg += """ \n""" ++ for grp in self.options: ++ msg += """ %s\n""" % grp ++ msg += """ \n""" ++ msg += """ \n""" ++ ++ return msg ++ + class Category(CompsObj): + """ Category object parsed from group data in each repo. and merged. """ + +@@ -376,6 +517,7 @@ class Category(CompsObj): + class Comps(object): + def __init__(self, overwrite_groups=False): + self._groups = {} ++ self._environments = {} + self._categories = {} + self.compscount = 0 + self.overwrite_groups = overwrite_groups +@@ -388,12 +530,18 @@ class Comps(object): + grps.sort(key=lambda x: (x.display_order, x.name)) + return grps + ++ def get_environments(self): ++ environments = self._environments.values() ++ environments.sort(key=lambda x: (x.display_order, x.name)) ++ return environments ++ + def get_categories(self): + cats = self._categories.values() + cats.sort(key=lambda x: (x.display_order, x.name)) + return cats + + groups = property(get_groups) ++ environments = property(get_environments) + categories = property(get_categories) + + def has_group(self, grpid): +@@ -447,6 +595,57 @@ class Comps(object): + + return returns.values() + ++ def has_environment(self, environmentid): ++ exists = self.return_environments(environmentid) ++ ++ if exists: ++ return True ++ ++ return False ++ ++ def return_environment(self, environmentid): ++ """Return the first group which matches""" ++ environments = self.return_environments(environmentid) ++ if environments: ++ return environments[0] ++ ++ return None ++ ++ def return_environments(self, env_pattern, case_sensitive=False): ++ """return all environments which match either by glob or exact match""" ++ returns = {} ++ ++ for item in env_pattern.split(','): ++ item = item.strip() ++ if item in self._environments: ++ env = self._environments[item] ++ returns[env.environmentid] = env ++ continue ++ ++ if case_sensitive: ++ match = re.compile(fnmatch.translate(item)).match ++ else: ++ match = re.compile(fnmatch.translate(item), flags=re.I).match ++ ++ done = False ++ for env in self.environments: ++ for name in env.name, env.environmentid, env.ui_name: ++ if match(name): ++ done = True ++ returns[env.environmentid] = env ++ break ++ if done: ++ continue ++ ++ # If we didn't match to anything in the current locale, try others ++ for env in self.environments: ++ for name in env.translated_name.values(): ++ if match(name): ++ returns[env.environmentid] = env ++ break ++ ++ return returns.values() ++ + # This is close to returnPackages() etc. API ... need to std. these names + # the above return_groups uses different, but equal, API. + def return_categories(self, pattern, ignore_case=True): +@@ -490,6 +689,13 @@ class Comps(object): + else: + self._groups[group.groupid] = group + ++ def add_environment(self, environment): ++ if environment.environmentid in self._environments: ++ env = self._environments[environment.environmentid] ++ env.add(environment) ++ else: ++ self._environments[environment.environmentid] = environment ++ + def add_category(self, category): + if category.categoryid in self._categories: + thatcat = self._categories[category.categoryid] +@@ -520,6 +726,9 @@ class Comps(object): + if elem.tag == "group": + group = Group(elem) + self.add_group(group) ++ if elem.tag == "environment": ++ environment = Environment(elem) ++ self.add_environment(environment) + if elem.tag == "category": + category = Category(elem) + self.add_category(category) +@@ -557,6 +766,24 @@ class Comps(object): + if pkgname in inst_pkg_names: + group.installed = True + break ++ ++ # Now do basically the same thing for evgroups. ++ inst_grp_names = {} ++ for group in self.groups: ++ inst_grp_names[group.groupid] = group.installed ++ for evgroup in self.environments: ++ if evgroup.groups: ++ evgroup.installed = True ++ for grpname in evgroup.groups: ++ if not inst_grp_names.get(grpname): ++ evgroup.installed = False ++ break ++ else: ++ evgroup.installed = False ++ for grpname in evgroup.optional: ++ if grpname in inst_grp_names: ++ evgroup.installed = True ++ break + + self.compiled = True + +@@ -595,6 +822,13 @@ def main(): + for pkg in group.packages: + print ' ' + pkg + ++ for environment in p.environments: ++ print environment.name ++ for group in environment.groups: ++ print ' ' + group ++ for group in environment.options: ++ print ' *' + group ++ + for category in p.categories: + print category.name + for group in category.groups: diff --git a/yum/config.py b/yum/config.py index d09511f..2bf4f45 100644 --- a/yum/config.py @@ -154928,7 +156091,7 @@ index d09511f..2bf4f45 100644 if name not in cfgOptions and option.default == value: diff --git a/yum/depsolve.py b/yum/depsolve.py -index 6d744c0..449cf48 100644 +index 6d744c0..5e95662 100644 --- a/yum/depsolve.py +++ b/yum/depsolve.py @@ -31,13 +31,15 @@ from transactioninfo import TransactionMember @@ -155137,7 +156300,40 @@ index 6d744c0..449cf48 100644 msg = self._err_missing_requires(requiringPo, requirement) self.verbose_logger.log(logginglevels.DEBUG_2, _('No update paths found for %s. Failure!'), requiringPo) return self._requiringFromTransaction(requiringPo, requirement, errorlist) -@@ -696,6 +776,13 @@ class Depsolve(object): +@@ -405,12 +485,30 @@ class Depsolve(object): + # try to update the requiring package in hopes that all this problem goes away :( + self.verbose_logger.log(logginglevels.DEBUG_2, _('Trying to update %s to resolve dep'), requiringPo) + txmbrs = self.update(po=requiringPo, requiringPo=requiringPo) ++ fixed = False + if not txmbrs: + msg = self._err_missing_requires(requiringPo, requirement) +- self.verbose_logger.log(logginglevels.DEBUG_2, _('No update paths found for %s. Failure!'), requiringPo) ++ self.verbose_logger.log(logginglevels.DEBUG_2, _('No update paths found for %s. Failure due to requirement: %s!'), requiringPo, msg) ++ else: ++ req_lookup = (needname, needflags, ++ rpmUtils.miscutils.stringToVersion(needversion)) ++ ++ for txmbr in txmbrs: ++ # This works for upgrades, and for obsoletes, on one side. ++ # Also catches upgrades that don't work on the other. ++ if txmbr.output_state in TS_INSTALL_STATES: ++ if txmbr.po.checkPrco('requires', req_lookup): ++ fixed = False ++ break ++ else: ++ fixed = True ++ if txmbrs and not fixed: ++ msg = self._err_missing_requires(requiringPo, requirement) ++ self.verbose_logger.log(logginglevels.DEBUG_2, _("Update for %s. Doesn't fix requirement: %s!"), requiringPo, msg) ++ ++ if not fixed: + return self._requiringFromTransaction(requiringPo, requirement, errorlist) + checkdeps = 1 +- + + if needmode in ['e']: + self.verbose_logger.log(logginglevels.DEBUG_2, _('TSINFO: %s package requiring %s marked as erase'), +@@ -696,6 +794,13 @@ class Depsolve(object): self.tsInfo.remove(txmbr.pkgtup) def prof_resolveDeps(self): @@ -155151,7 +156347,7 @@ index 6d744c0..449cf48 100644 fn = "anaconda.prof.0" import hotshot, hotshot.stats prof = hotshot.Profile(fn) -@@ -709,6 +796,13 @@ class Depsolve(object): +@@ -709,6 +814,13 @@ class Depsolve(object): return rc def cprof_resolveDeps(self): @@ -155165,7 +156361,7 @@ index 6d744c0..449cf48 100644 import cProfile, pstats prof = cProfile.Profile() rc = prof.runcall(self.resolveDeps) -@@ -722,7 +816,17 @@ class Depsolve(object): +@@ -722,7 +834,17 @@ class Depsolve(object): return rc def resolveDeps(self, full_check=True, skipping_broken=False): @@ -155184,7 +156380,7 @@ index 6d744c0..449cf48 100644 if not len(self.tsInfo): return (0, [_('Success - empty transaction')]) -@@ -778,6 +882,25 @@ class Depsolve(object): +@@ -778,6 +900,25 @@ class Depsolve(object): if checkdep: break # The next conflict might be the same pkg @@ -155210,7 +156406,7 @@ index 6d744c0..449cf48 100644 if CheckDeps: if self.dsCallback: self.dsCallback.restartLoop() self.verbose_logger.log(logginglevels.DEBUG_1, _('Restarting Loop')) -@@ -920,9 +1043,12 @@ class Depsolve(object): +@@ -920,9 +1061,12 @@ class Depsolve(object): # if this is an update, we should check what the old # requires were to make things faster @@ -155225,7 +156421,7 @@ index 6d744c0..449cf48 100644 oldreqs = set(oldreqs) ret = [] -@@ -1150,6 +1276,11 @@ class Depsolve(object): +@@ -1150,6 +1294,11 @@ class Depsolve(object): return ret def isPackageInstalled(self, pkgname): @@ -155237,7 +156433,7 @@ index 6d744c0..449cf48 100644 lst = self.tsInfo.matchNaevr(name = pkgname) for txmbr in lst: if txmbr.output_state in TS_INSTALL_STATES: -@@ -1166,7 +1297,7 @@ class Depsolve(object): +@@ -1166,7 +1315,7 @@ class Depsolve(object): return True _isPackageInstalled = isPackageInstalled @@ -155246,7 +156442,7 @@ index 6d744c0..449cf48 100644 """take the list of pkgs and score them based on the requesting package return a dictionary of po=score""" self.verbose_logger.log(logginglevels.DEBUG_4, -@@ -1210,6 +1341,24 @@ class Depsolve(object): +@@ -1210,6 +1359,24 @@ class Depsolve(object): return None return x @@ -155271,7 +156467,7 @@ index 6d744c0..449cf48 100644 # Actual start of _compare_providers(). # Do a NameArch filtering, based on repo. __cmp__ -@@ -1332,6 +1481,26 @@ class Depsolve(object): +@@ -1332,6 +1499,26 @@ class Depsolve(object): _('common prefix of %s between %s and %s' % (cpl, po, reqpo))) pkgresults[po] += cpl*2 @@ -155298,7 +156494,7 @@ index 6d744c0..449cf48 100644 # If we have more than one "best", see what would happen if we picked # each package ... ie. what things do they require that _aren't_ already -@@ -1393,42 +1562,52 @@ class Depsolve(object): +@@ -1393,42 +1580,52 @@ class Depsolve(object): class DepCheck(object): @@ -155341,12 +156537,12 @@ index 6d744c0..449cf48 100644 class Requires(object): - -- """ -- A pure data class for holding a package and the list of things it -- requires. + """A pure data class for holding a package and the list of things + it requires. """ +- A pure data class for holding a package and the list of things it +- requires. +- """ - def __init__(self, pkg,requires): self.pkg = pkg # po of requiring pkg @@ -156020,10 +157216,10 @@ index 9889bf6..76a258d 100755 Setup the yum translation domain and make _() and P_() translation wrappers diff --git a/yum/igroups.py b/yum/igroups.py new file mode 100644 -index 0000000..625ee66 +index 0000000..6a04f3a --- /dev/null +++ b/yum/igroups.py -@@ -0,0 +1,141 @@ +@@ -0,0 +1,267 @@ +#! /usr/bin/python -tt +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by @@ -156039,7 +157235,7 @@ index 0000000..625ee66 +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# -+# Copyright 2010 Red Hat ++# Copyright 2010, 2012 Red Hat +# +# James Antill + @@ -156051,6 +157247,7 @@ index 0000000..625ee66 + def __init__(self, gid): + self.gid = gid + self.pkg_names = set() ++ self.environment = None + + def __cmp__(self, other): + if other is None: @@ -156066,12 +157263,36 @@ index 0000000..625ee66 + return sorted(pkg_names.difference(self.pkg_names)) + + ++class InstalledEnvironment(object): ++ def __init__(self, evgid): ++ self.evgid = evgid ++ self.grp_names = set() ++ ++ def __cmp__(self, other): ++ if other is None: ++ return 1 ++ return cmp(self.evgid, other.evgid) ++ ++ def _additions(self, grp_names): ++ grp_names = set(grp_names) ++ return sorted(grp_names.difference(self.grp_names)) ++ ++ def _removals(self, grp_names): ++ grp_names = set(grp_names) ++ return sorted(grp_names.difference(self.grp_names)) ++ ++ +class InstalledGroups(object): + def __init__(self, db_path): -+ self.filename = db_path + "/installed" + self.groups = {} + self.changed = False ++ self.environments = {} + ++ self._read_pkg_grps(db_path) ++ self._read_grp_grps(db_path) ++ ++ def _read_pkg_grps(self, db_path): ++ self.filename = db_path + "/installed" + if not os.access(self.filename, os.R_OK): + return + @@ -156095,6 +157316,38 @@ index 0000000..625ee66 + num -= 1 + grp.pkg_names.add(_read_str(fo)) + ++ def _read_grp_grps(self, db_path): ++ self.grp_filename = db_path + "/environment" ++ if not os.access(self.grp_filename, os.R_OK): ++ return ++ ++ def _read_str(fo): ++ return fo.readline()[:-1] ++ ++ fo = open(self.grp_filename) ++ ver = int(_read_str(fo)) ++ if ver != 1: ++ return ++ ++ groups_num = int(_read_str(fo)) ++ while groups_num > 0: ++ groups_num -= 1 ++ ++ evgrp = InstalledEnvironment(_read_str(fo)) ++ self.environments[evgrp.evgid] = evgrp ++ ++ num = int(_read_str(fo)) ++ while num > 0: ++ num -= 1 ++ grpname = _read_str(fo) ++ memb = _read_str(fo) ++ evgrp.grp_names.add(grpname) ++ assert memb in ('true', 'false') ++ if memb == 'true': ++ assert grpname in self.groups ++ if grpname in self.groups: ++ self.groups[grpname].environment = evgrp.evgid ++ + def close(self): + pass + @@ -156113,6 +157366,12 @@ index 0000000..625ee66 + if not os.access(db_path, os.W_OK): + return False + ++ self._write_pkg_grps() ++ self._write_grp_grps() ++ ++ self.changed = False ++ ++ def _write_pkg_grps(self): + fo = open(self.filename + '.tmp', 'w') + + fo.write("1\n") # version @@ -156124,9 +157383,26 @@ index 0000000..625ee66 + fo.write("%s\n" % pkgname) + fo.close() + os.rename(self.filename + '.tmp', self.filename) -+ self.changed = False + -+ def add_group(self, groupid, pkg_names): ++ def _write_grp_grps(self): ++ fo = open(self.grp_filename + '.tmp', 'w') ++ ++ fo.write("1\n") # version ++ fo.write("%u\n" % len(self.environments)) ++ for evgrp in sorted(self.environments.values()): ++ fo.write("%s\n" % evgrp.evgid) ++ fo.write("%u\n" % len(evgrp.grp_names)) ++ for grpname in sorted(evgrp.grp_names): ++ fo.write("%s\n" % grpname) ++ if self.groups[grpname].environment == evgrp.evgid: ++ fo.write("%s\n" % "true") ++ else: ++ fo.write("%s\n" % "false") ++ ++ fo.close() ++ os.rename(self.grp_filename + '.tmp', self.grp_filename) ++ ++ def add_group(self, groupid, pkg_names, ievgrp=None): + self.changed = True + + if groupid not in self.groups: @@ -156136,6 +157412,11 @@ index 0000000..625ee66 + for pkg_name in pkg_names: + grp.pkg_names.add(pkg_name) + ++ if ievgrp is not None: ++ grp.environment = ievgrp.evgid ++ ievgrp.grp_names.add(groupid) ++ return grp ++ + def del_group(self, groupid): + self.changed = True + @@ -156165,6 +157446,47 @@ index 0000000..625ee66 + break + + return returns.values() ++ ++ def add_environment(self, evgroupid, grp_names): ++ self.changed = True ++ ++ if evgroupid not in self.environments: ++ self.environments[evgroupid] = InstalledEnvironment(evgroupid) ++ grp = self.environments[evgroupid] ++ ++ for grp_name in grp_names: ++ grp.grp_names.add(grp_name) ++ return grp ++ ++ def del_environment(self, evgroupid): ++ self.changed = True ++ ++ if evgroupid in self.environments: ++ del self.environments[evgroupid] ++ ++ def return_environments(self, evgroup_pattern, case_sensitive=False): ++ returns = {} ++ ++ for item in evgroup_pattern.split(','): ++ item = item.strip() ++ if item in self.environments: ++ thisgroup = self.environments[item] ++ returns[thisgroup.evgid] = thisgroup ++ continue ++ ++ if case_sensitive: ++ match = re.compile(fnmatch.translate(item)).match ++ else: ++ match = re.compile(fnmatch.translate(item), flags=re.I).match ++ ++ done = False ++ for group in self.environments.values(): ++ if match(group.evgid): ++ done = True ++ returns[group.evgid] = group ++ break ++ ++ return returns.values() diff --git a/yum/metalink.py b/yum/metalink.py index aaa4f25..51895fd 100755 --- a/yum/metalink.py @@ -157234,7 +158556,7 @@ index bfc49b7..9ddcae6 100644 b = parsever(b) diff --git a/yum/repos.py b/yum/repos.py -index 3793bad..3cbbe25 100644 +index 3793bad..97fa71e 100644 --- a/yum/repos.py +++ b/yum/repos.py @@ -22,6 +22,7 @@ import misc @@ -157245,7 +158567,7 @@ index 3793bad..3cbbe25 100644 from weakref import proxy as weakref -@@ -67,6 +68,40 @@ class RepoStorage: +@@ -67,6 +68,47 @@ class RepoStorage: self._cache_enabled_repos = [] self.quick_enable_disable = {} @@ -157261,7 +158583,14 @@ index 3793bad..3cbbe25 100644 + for repo in self.listEnabled(): + if repo.cache: + continue -+ if repo._async and repo._commonLoadRepoXML(repo): ++ try: ++ dl = repo._async and repo._commonLoadRepoXML(repo) ++ except Errors.RepoError, e: ++ if not repo.skip_if_unavailable: ++ raise ++ self.disableRepo(repo.id) ++ dl = False ++ if dl: + mdtypes = repo._mdpolicy2mdtypes() + downloading = repo._commonRetrieveDataMD_list(mdtypes) + repos.append((repo, downloading, [False])) @@ -157286,7 +158615,7 @@ index 3793bad..3cbbe25 100644 def doSetup(self, thisrepo = None): self.ayum.plugins.run('prereposetup') -@@ -89,6 +124,7 @@ class RepoStorage: +@@ -89,6 +131,7 @@ class RepoStorage: self.disableRepo(repo.id) self._setup = True @@ -157294,7 +158623,7 @@ index 3793bad..3cbbe25 100644 self.ayum.plugins.run('postreposetup') def __str__(self): -@@ -223,8 +259,9 @@ class RepoStorage: +@@ -223,8 +266,9 @@ class RepoStorage: self._cachedir = cachedir for repo in self.repos.values(): @@ -157306,7 +158635,7 @@ index 3793bad..3cbbe25 100644 def setProgressBar(self, obj): -@@ -288,6 +325,16 @@ class RepoStorage: +@@ -288,6 +332,16 @@ class RepoStorage: else: data = [ mdtype ] @@ -157324,7 +158653,7 @@ index 3793bad..3cbbe25 100644 sack = repo.getPackageSack() try: diff --git a/yum/rpmsack.py b/yum/rpmsack.py -index e289a7a..ed8e3d1 100644 +index e289a7a..a4da4ab 100644 --- a/yum/rpmsack.py +++ b/yum/rpmsack.py @@ -48,6 +48,17 @@ def _open_no_umask(*args): @@ -157364,6 +158693,15 @@ index e289a7a..ed8e3d1 100644 continue pkg = pkg[0] +@@ -616,7 +628,7 @@ class RPMDBPackageSack(PackageSackBase): + for hdr, idx in self._get_packages(): + if self._match_repattern(rpats, hdr, ignore_case): + self._makePackageObject(hdr, idx) +- self._completely_loaded = patterns is None ++ self._completely_loaded = rpats is None + + pkgobjlist = self._idx2pkg.values() + # Remove gpg-pubkeys, as no sane callers expects/likes them... @@ -993,7 +1005,7 @@ class RPMDBPackageSack(PackageSackBase): return @@ -157530,7 +158868,7 @@ index 8a6f6f3..ba929de 100644 if len(self.filelistsdb) == 0: # grab repo object from primarydb and force filelists population in this sack using repo diff --git a/yum/transactioninfo.py b/yum/transactioninfo.py -index 4d89d83..b584338 100644 +index 4d89d83..e7377bf 100644 --- a/yum/transactioninfo.py +++ b/yum/transactioninfo.py @@ -87,7 +87,8 @@ class TransactionData: @@ -157543,7 +158881,16 @@ index 4d89d83..b584338 100644 self.pkgSackPackages = 0 self.localSack = PackageSack() self._inSack = GetProvReqOnlyPackageSack() -@@ -105,6 +106,9 @@ class TransactionData: +@@ -95,6 +96,8 @@ class TransactionData: + # lists of txmbrs in their states - just placeholders + self.instgroups = [] + self.removedgroups = [] ++ self.instenvironments = [] ++ self.removedenvironments = [] + self.removed = [] + self.installed = [] + self.updated = [] +@@ -105,6 +108,9 @@ class TransactionData: self.reinstalled = [] self.downgraded = [] self.failed = [] @@ -157553,7 +158900,7 @@ index 4d89d83..b584338 100644 def __len__(self): return len(self.pkgdict) -@@ -115,6 +119,18 @@ class TransactionData: +@@ -115,6 +121,18 @@ class TransactionData: else: return iter(self.getMembers()) @@ -157572,7 +158919,7 @@ index 4d89d83..b584338 100644 def debugprint(self, msg): if self.debug: print msg -@@ -208,7 +224,9 @@ class TransactionData: +@@ -208,7 +226,9 @@ class TransactionData: txmbrs = self.matchNaevr(na[0], na[1]) if not txmbrs: @@ -157583,7 +158930,46 @@ index 4d89d83..b584338 100644 pkgs = [] else: pkgs = self.pkgSack.returnPackages(patterns=[pattern]) -@@ -547,9 +565,10 @@ class TransactionData: +@@ -334,6 +354,8 @@ class TransactionData: + + self.instgroups = [] + self.removedgroups = [] ++ self.instenvironments = [] ++ self.removedenvironments = [] + self.removed = [] + self.installed = [] + self.updated = [] +@@ -365,6 +387,10 @@ class TransactionData: + for g in txmbr.groups: + if g not in self.instgroups: + self.instgroups.append(g) ++ if txmbr.environments: ++ for evg in txmbr.environments: ++ if evg not in self.instenvironments: ++ self.instenvironments.append(evg) + if txmbr.isDep: + self.depinstalled.append(txmbr) + else: +@@ -377,6 +403,9 @@ class TransactionData: + for g in txmbr.groups: + if g not in self.instgroups: + self.removedgroups.append(g) ++ for evg in txmbr.environments: ++ if evg not in self.instenvironments: ++ self.removedenvironments.append(evg) + if txmbr.isDep: + self.depremoved.append(txmbr) + else: +@@ -402,6 +431,8 @@ class TransactionData: + self.depremoved.sort() + self.instgroups.sort() + self.removedgroups.sort() ++ self.instenvironments.sort() ++ self.removedenvironments.sort() + self.reinstalled.sort() + self.downgraded.sort() + self.failed.sort() +@@ -547,9 +578,10 @@ class TransactionData: return txmbr @@ -157596,7 +158982,7 @@ index 4d89d83..b584338 100644 def getNewProvides(self, name, flag=None, version=(None, None, None)): """return dict { packages -> list of matching provides } -@@ -619,6 +638,12 @@ class TransactionData: +@@ -619,6 +651,12 @@ class TransactionData: """ Return a simple version for the future rpmdb. Works like rpmdb.simpleVersion(main_only=True)[0], but for the state the rpmdb will be in after the transaction. """ @@ -157609,7 +158995,7 @@ index 4d89d83..b584338 100644 pkgs = self.rpmdb.returnPackages() _reinstalled_pkgtups = {} for txmbr in self.getMembersWithState(None, TS_INSTALL_STATES): -@@ -658,6 +683,7 @@ class TransactionData: +@@ -658,6 +696,7 @@ class TransactionData: self.rpmdb.transactionCachePackageChecksums(pkg_checksum_tups) @@ -157617,6 +159003,22 @@ index 4d89d83..b584338 100644 return main def findObsoletedByThisMember(self, txmbr): +@@ -752,6 +791,7 @@ class TransactionMember: + self.downgraded_by = [] + self.reinstall = False + self.groups = [] # groups it's in ++ self.environments = [] # Env. groups it's in + self._poattr = ['pkgtup', 'repoid', 'name', 'arch', 'epoch', 'version', + 'release'] + +@@ -825,5 +865,7 @@ class TransactionMember: + + if self.groups: + msg += " groups: %s\n" % ' '.join(self.groups) ++ if self.environments: ++ msg += " environments: %s\n" % ' '.join(self.environments) + + return msg diff --git a/yum/update_md.py b/yum/update_md.py index 2cb1acb..7da6a08 100644 --- a/yum/update_md.py @@ -157637,7 +159039,7 @@ index 2cb1acb..7da6a08 100644 self._md[item] = val diff --git a/yum/yumRepo.py b/yum/yumRepo.py -index e5e9ece..14f6d5f 100644 +index e5e9ece..35182d3 100644 --- a/yum/yumRepo.py +++ b/yum/yumRepo.py @@ -20,10 +20,12 @@ import time @@ -157687,33 +159089,44 @@ index e5e9ece..14f6d5f 100644 def populate(self, repo, mdtype='metadata', callback=None, cacheonly=0): if mdtype == 'all': data = ['metadata', 'filelists', 'otherdata'] -@@ -162,6 +184,25 @@ class YumPackageSack(packageSack.PackageSack): +@@ -138,8 +160,6 @@ class YumPackageSack(packageSack.PackageSack): + if item in self.added[repo]: + continue + +- db_fn = None +- + if item == 'metadata': + mydbtype = 'primary_db' + mymdtype = 'primary' +@@ -162,25 +182,37 @@ class YumPackageSack(packageSack.PackageSack): continue if 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 +- # unlink it + # 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(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_fn = repo._retrieveMD(mydbtype) + if db_fn: +- if not repo.cache: +- db_un_fn = misc.decompress(db_fn) +- misc.unlink_f(db_fn) +- db_un_fn = self._check_uncompressed_db(repo, mydbtype) + 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): + + dobj = repo.cacheHandler.open_database(db_un_fn) else: repo._xml2sqlite_local = True @@ -157723,7 +159136,7 @@ index e5e9ece..14f6d5f 100644 + # Use generated dir. and handle compression types metadata + # parser doesn't understand. + gen = mymdtype + '.xml' -+ ret = misc.repo_gen_decompress(xml, gen) ++ ret = misc.repo_gen_decompress(xml, gen, cached=repo.cache) + if not ret: + raise URLGrabError(-1, 'Decompress DB failed') + xml = ret @@ -157731,7 +159144,7 @@ index e5e9ece..14f6d5f 100644 xmldata = repo.repoXML.getData(mymdtype) (ctype, csum) = xmldata.checksum dobj = repo_cache_function(xml, csum) -@@ -193,6 +244,24 @@ class YumPackageSack(packageSack.PackageSack): +@@ -193,6 +225,25 @@ class YumPackageSack(packageSack.PackageSack): # get rid of all this stuff we don't need now del repo.cacheHandler @@ -157748,7 +159161,8 @@ index e5e9ece..14f6d5f 100644 + check_can_fail=fast, fast=fast): + return None + -+ ret = misc.repo_gen_decompress(compressed_fn, db_un_fn) ++ 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 @@ -157756,7 +159170,7 @@ index e5e9ece..14f6d5f 100644 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 +270,11 @@ class YumPackageSack(packageSack.PackageSack): +@@ -201,9 +252,11 @@ class YumPackageSack(packageSack.PackageSack): compressed_fn = repo.cachedir + '/' + fname db_un_fn = misc.decompress(compressed_fn, fn_only=True) @@ -157769,7 +159183,16 @@ index e5e9ece..14f6d5f 100644 if os.path.exists(db_un_fn): if skip_old_DBMD_check and repo._using_old_MD: return db_un_fn -@@ -285,6 +356,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -260,7 +313,7 @@ class YumRepository(Repository, config.RepoConf): + self.copy_local = 0 + # holder for stuff we've grabbed + self.retrieved = { 'primary':0, 'filelists':0, 'other':0, 'group':0, +- 'updateinfo':0, 'prestodelta' : 0} ++ 'updateinfo':0} + + # callbacks + self.callback = None # for the grabber +@@ -285,6 +338,7 @@ class YumRepository(Repository, config.RepoConf): self._grabfunc = None self._grab = None @@ -157777,7 +159200,7 @@ index e5e9ece..14f6d5f 100644 def __cmp__(self, other): """ Sort yum repos. by cost, and then by alphanumeric on their id. """ -@@ -431,25 +503,18 @@ class YumRepository(Repository, config.RepoConf): +@@ -431,25 +485,18 @@ class YumRepository(Repository, config.RepoConf): self._proxy_dict = {} # zap it proxy_string = None empty = (None, '_none_', '') @@ -157811,7 +159234,7 @@ index e5e9ece..14f6d5f 100644 if proxy_string is not None: self._proxy_dict['http'] = proxy_string -@@ -488,8 +553,20 @@ class YumRepository(Repository, config.RepoConf): +@@ -488,8 +535,20 @@ class YumRepository(Repository, config.RepoConf): copy_local=self.copy_local, reget='simple', **ugopts) @@ -157833,7 +159256,7 @@ index e5e9ece..14f6d5f 100644 failure_callback=self.mirror_failure_obj) def _default_grabopts(self, cache=True): -@@ -499,6 +576,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -499,6 +558,7 @@ class YumRepository(Repository, config.RepoConf): 'throttle': self.throttle, 'proxies': self.proxy_dict, 'timeout': self.timeout, @@ -157841,22 +159264,16 @@ index e5e9ece..14f6d5f 100644 'http_headers': tuple(self.__headersListFromDict(cache=cache)), 'ssl_verify_peer': self.sslverify, 'ssl_verify_host': self.sslverify, -@@ -531,12 +609,11 @@ class YumRepository(Repository, config.RepoConf): - if os.path.exists(dpath) and os.path.isdir(dpath): - return - -- if self.cache: -- raise Errors.RepoError, "Cannot access repository dir %s" % dpath -- - try: - os.makedirs(dpath, mode=0755) - except OSError, e: -+ if self.cache and e.errno == errno.EACCES: -+ raise Errors.RepoError, "Cannot access repository dir %s" % dpath - msg = "%s: %s %s: %s" % ("Error making cache directory", - dpath, "error was", e) - raise Errors.RepoError, msg -@@ -751,7 +828,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -714,7 +774,7 @@ class YumRepository(Repository, config.RepoConf): + local = self.metalink_filename + '.tmp' + if not self._metalinkCurrent(): + url = misc.to_utf8(self.metalink) +- ugopts = self._default_grabopts() ++ ugopts = self._default_grabopts(cache=self.http_caching=='all') + try: + ug = URLGrabber(progress_obj = self.callback, **ugopts) + result = ug.urlgrab(url, local, text=self.id + "/metalink") +@@ -751,7 +811,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', @@ -157865,7 +159282,7 @@ index e5e9ece..14f6d5f 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 +873,16 @@ class YumRepository(Repository, config.RepoConf): +@@ -796,6 +856,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,)) @@ -157882,7 +159299,7 @@ index e5e9ece..14f6d5f 100644 if url and scheme != "media": ugopts = self._default_grabopts(cache=cache) ug = URLGrabber(progress_obj = self.callback, -@@ -835,7 +922,8 @@ class YumRepository(Repository, config.RepoConf): +@@ -835,7 +905,8 @@ class YumRepository(Repository, config.RepoConf): reget = reget, checkfunc=checkfunc, http_headers=headers, @@ -157892,7 +159309,7 @@ index e5e9ece..14f6d5f 100644 ) except URLGrabError, e: errstr = "failure: %s from %s: %s" % (relative, self.id, e) -@@ -847,7 +935,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -847,7 +918,7 @@ class YumRepository(Repository, config.RepoConf): return result __get = _getFile @@ -157901,15 +159318,35 @@ index e5e9ece..14f6d5f 100644 remote = package.relativepath local = package.localPkg() basepath = package.basepath -@@ -864,6 +952,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -857,15 +928,26 @@ class YumRepository(Repository, config.RepoConf): + return local + misc.unlink_f(local) + +- return self._getFile(url=basepath, ++ if checkfunc is None: ++ checkfunc = (package.verifyLocalPkg, (), {}) ++ ++ ret = self._getFile(url=basepath, + relative=remote, + local=local, + checkfunc=checkfunc, text=text, cache=cache, size=package.size, + **kwargs ) ++ if not package.verifyLocalPkg(): # Don't return as "success" when bad. ++ msg = "Downloaded package %s, from %s, but it was invalid." ++ msg = msg % (package, pacakge.repo.id) ++ raise Errors.RepoError, msg ++ ++ return ret ++ def getHeader(self, package, checkfunc = None, reget = 'simple', -@@ -1020,7 +1109,7 @@ class YumRepository(Repository, config.RepoConf): + cache = True): + +@@ -1020,7 +1102,7 @@ class YumRepository(Repository, config.RepoConf): if grab_can_fail: return None raise Errors.RepoError, 'Error downloading file %s: %s' % (local, e) @@ -157918,7 +159355,7 @@ index e5e9ece..14f6d5f 100644 misc.unlink_f(tfname) if grab_can_fail: return None -@@ -1260,6 +1349,9 @@ class YumRepository(Repository, config.RepoConf): +@@ -1260,6 +1342,9 @@ class YumRepository(Repository, config.RepoConf): return True def _check_db_version(self, mdtype, repoXML=None): @@ -157928,7 +159365,7 @@ index e5e9ece..14f6d5f 100644 if repoXML is None: repoXML = self.repoXML if mdtype in repoXML.repoData: -@@ -1277,11 +1369,11 @@ class YumRepository(Repository, config.RepoConf): +@@ -1277,11 +1362,11 @@ class YumRepository(Repository, config.RepoConf): return None if not file_check: @@ -157943,7 +159380,7 @@ index e5e9ece..14f6d5f 100644 if not os.path.exists(local): local = misc.decompress(local, fn_only=True) compressed = True -@@ -1302,6 +1394,17 @@ class YumRepository(Repository, config.RepoConf): +@@ -1302,6 +1387,17 @@ class YumRepository(Repository, config.RepoConf): into the delete list, this means metadata can change filename without us leaking it. """ @@ -157961,7 +159398,22 @@ index e5e9ece..14f6d5f 100644 def _mdtype_eq(omdtype, odata, nmdtype, ndata): """ Check if two returns from _get_mdtype_data() are equal. """ if ndata is None: -@@ -1333,8 +1436,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1321,6 +1417,14 @@ class YumRepository(Repository, config.RepoConf): + return True + + all_mdtypes = self.retrieved.keys() ++ # Add in any extra stuff we don't know about. ++ for mdtype in self.repoXML.fileTypes(): ++ if mdtype in all_mdtypes: ++ continue ++ if mdtype in ('primary_db', 'filelists_db', 'other_db'): ++ continue ++ all_mdtypes.append(mdtype) ++ + if mdtypes is None: + mdtypes = all_mdtypes + +@@ -1333,8 +1437,7 @@ class YumRepository(Repository, config.RepoConf): # Inited twice atm. ... sue me self._oldRepoMDData['new_MD_files'] = [] @@ -157971,7 +159423,7 @@ index e5e9ece..14f6d5f 100644 for mdtype in all_mdtypes: (nmdtype, ndata) = self._get_mdtype_data(mdtype) -@@ -1371,43 +1473,16 @@ class YumRepository(Repository, config.RepoConf): +@@ -1371,43 +1474,16 @@ class YumRepository(Repository, config.RepoConf): # No old repomd data, but we might still have uncompressed MD if self._groupCheckDataMDValid(ndata, nmdtype, mdtype): continue @@ -158020,7 +159472,7 @@ index e5e9ece..14f6d5f 100644 def _groupLoadRepoXML(self, text=None, mdtypes=None): """ Retrieve the new repomd.xml from the repository, then check it -@@ -1421,7 +1496,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1421,7 +1497,7 @@ class YumRepository(Repository, config.RepoConf): self._commonRetrieveDataMD(mdtypes) def _mdpolicy2mdtypes(self): @@ -158029,7 +159481,7 @@ index e5e9ece..14f6d5f 100644 'group:primary' : ['primary'], 'group:small' : ["primary", "updateinfo"], 'group:main' : ["primary", "group", "filelists", -@@ -1436,6 +1511,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1436,6 +1512,7 @@ class YumRepository(Repository, config.RepoConf): if not mdtypes or 'group:all' in mdtypes: mdtypes = None else: @@ -158037,7 +159489,7 @@ index e5e9ece..14f6d5f 100644 mdtypes = sorted(list(mdtypes)) return mdtypes -@@ -1451,12 +1527,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1451,12 +1528,7 @@ class YumRepository(Repository, config.RepoConf): def _getRepoXML(self): if self._repoXML: return self._repoXML @@ -158051,7 +159503,7 @@ index e5e9ece..14f6d5f 100644 return self._repoXML -@@ -1514,7 +1585,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1514,7 +1586,7 @@ class YumRepository(Repository, config.RepoConf): return self._checkMD(fn, mdtype, openchecksum) def _checkMD(self, fn, mdtype, openchecksum=False, @@ -158060,7 +159512,7 @@ index e5e9ece..14f6d5f 100644 """ Internal function, use .checkMD() from outside yum. """ thisdata = data # So the argument name is nicer -@@ -1537,6 +1608,18 @@ class YumRepository(Repository, config.RepoConf): +@@ -1537,6 +1609,18 @@ class YumRepository(Repository, config.RepoConf): if size is not None: size = int(size) @@ -158079,7 +159531,7 @@ index e5e9ece..14f6d5f 100644 try: # get the local checksum l_csum = self._checksum(r_ctype, file, datasize=size) except Errors.RepoError, e: -@@ -1551,15 +1634,13 @@ class YumRepository(Repository, config.RepoConf): +@@ -1551,15 +1635,13 @@ class YumRepository(Repository, config.RepoConf): return None raise URLGrabError(-1, 'Metadata file does not match checksum') @@ -158096,29 +159548,9 @@ index e5e9ece..14f6d5f 100644 """ Internal function, use .retrieveMD() from outside yum. """ # Note that this can raise Errors.RepoMDError if mdtype doesn't exist # for this repo. -@@ -1575,6 +1656,12 @@ class YumRepository(Repository, config.RepoConf): - # got it, move along - return local +@@ -1597,7 +1679,9 @@ class YumRepository(Repository, config.RepoConf): + return local # it's the same return the local one -+ if (os.path.exists(local) or -+ self._preload_md_from_system_cache(os.path.basename(local))): -+ if self._checkMD(local, mdtype, check_can_fail=True): -+ self.retrieved[mdtype] = 1 -+ return local # it's the same return the local one -+ - if self.cache == 1: - if os.path.exists(local): - try: -@@ -1590,14 +1677,10 @@ class YumRepository(Repository, config.RepoConf): - "Caching enabled but no local cache of %s from %s" % (local, - self) - -- if (os.path.exists(local) or -- self._preload_md_from_system_cache(os.path.basename(local))): -- if self._checkMD(local, mdtype, check_can_fail=True): -- self.retrieved[mdtype] = 1 -- return local # it's the same return the local one -- try: - checkfunc = (self.checkMD, (mdtype,), {}) + def checkfunc(obj): @@ -158127,7 +159559,7 @@ index e5e9ece..14f6d5f 100644 text = "%s/%s" % (self.id, mdtype) if thisdata.size is None: reget = None -@@ -1613,8 +1696,9 @@ class YumRepository(Repository, config.RepoConf): +@@ -1613,8 +1697,9 @@ class YumRepository(Repository, config.RepoConf): checkfunc=checkfunc, text=text, cache=self.http_caching == 'all', @@ -158139,7 +159571,7 @@ index e5e9ece..14f6d5f 100644 if retrieve_can_fail: return None raise -@@ -1624,7 +1708,6 @@ class YumRepository(Repository, config.RepoConf): +@@ -1624,7 +1709,6 @@ class YumRepository(Repository, config.RepoConf): raise Errors.RepoError, \ "Could not retrieve %s matching remote checksum from %s" % (local, self) else: @@ -158147,8 +159579,36 @@ index e5e9ece..14f6d5f 100644 return local +@@ -1646,9 +1730,16 @@ class YumRepository(Repository, config.RepoConf): + + def getGroups(self): + """gets groups and returns group file path for the repository, if there +- is none it returns None""" ++ is none or retrieve/decompress fails, it returns None""" + if 'group_gz' in self.repoXML.fileTypes(): +- return self._retrieveMD('group_gz', retrieve_can_fail=True) ++ fn = self._retrieveMD('group_gz', retrieve_can_fail=True) ++ if fn: ++ try: ++ fn = misc.repo_gen_decompress(fn, 'comps.xml') ++ except IOError, e: ++ logger.warning(e) ++ fn = None ++ return fn + return self._retrieveMD('group', retrieve_can_fail=True) + + def setCallback(self, callback): +@@ -1681,7 +1772,7 @@ class YumRepository(Repository, config.RepoConf): + print "Could not read mirrorlist %s, error was \n%s" %(url, e) + content = [] + for line in content: +- if re.match('\s*(#|$)', line): ++ if not re.match('\w+://\S+\s*$', line): + continue + mirror = line.rstrip() # no more trailing \n's + mirror = mirror.replace('$ARCH', '$BASEARCH') diff --git a/yumcommands.py b/yumcommands.py -index 4dcbea7..bc30bd4 100644 +index 4dcbea7..52c3127 100644 --- a/yumcommands.py +++ b/yumcommands.py @@ -29,7 +29,7 @@ import operator @@ -158666,7 +160126,7 @@ index 4dcbea7..bc30bd4 100644 '=' : clar, 'not in' : clai}) rep = base.listPkgs(ypl.extras, _('Extra Packages'), basecmd, columns=columns) -@@ -389,45 +635,121 @@ class InfoCommand(YumCommand): +@@ -389,45 +635,144 @@ class InfoCommand(YumCommand): return 0, [] def needTs(self, base, basecmd, extcmds): @@ -158711,12 +160171,15 @@ index 4dcbea7..bc30bd4 100644 + def getNames(self): +- return ['erase', 'remove'] + """Return a list containing the names of this command. This + command can be called from the command line by using any of these names. + + :return: a list containing the names of this command + """ - return ['erase', 'remove'] ++ return ['erase', 'remove', 'autoremove', ++ 'erase-n', 'erase-na', 'erase-nevra', ++ 'remove-n', 'remove-na', 'remove-nevra'] def getUsage(self): + """Return a usage string for this command. @@ -158743,6 +160206,8 @@ index 4dcbea7..bc30bd4 100644 + :param extcmds: the command line arguments passed to *basecmd* + """ checkRootUID(base) ++ if basecmd == 'autoremove': ++ return checkPackageArg(base, basecmd, extcmds) def doCommand(self, base, basecmd, extcmds): @@ -158759,12 +160224,32 @@ index 4dcbea7..bc30bd4 100644 + 1 = we've errored, exit with error string + 2 = we've got work yet to do, onto the next stage + """ ++ ++ pos = False ++ if basecmd == 'autoremove': ++ # We have to alter this, as it's used in resolving stage. Which ++ # sucks. Just be careful in "yum shell". ++ base.conf.clean_requirements_on_remove = True ++ ++ if not extcmds: ++ pos = True ++ extcmds = [] ++ for pkg in sorted(base.rpmdb.returnLeafNodes()): ++ if 'reason' not in pkg.yumdb_info: ++ continue ++ if pkg.yumdb_info.reason != 'dep': ++ continue ++ extcmds.append(pkg) ++ self.doneCommand(base, _("Setting up Remove Process")) try: - return base.erasePkgs(extcmds) +- return base.erasePkgs(extcmds) ++ ret = base.erasePkgs(extcmds, pos=pos, basecmd=basecmd) except yum.Errors.YumBaseError, e: - return 1, [str(e)] -+ return 1, [exception2msg(e)] ++ ret = (1, [exception2msg(e)]) ++ ++ return ret def needTs(self, base, basecmd, extcmds): + """Return whether a transaction set must be set up before this @@ -158789,7 +160274,7 @@ index 4dcbea7..bc30bd4 100644 return True -@@ -442,12 +764,25 @@ class GroupsCommand(YumCommand): +@@ -442,12 +787,25 @@ class GroupsCommand(YumCommand): 'groupinfo' : 'info'} def getNames(self): @@ -158815,7 +160300,7 @@ index 4dcbea7..bc30bd4 100644 return _("Display, or use, the groups information") def _grp_setup_doCommand(self, base): -@@ -459,7 +794,7 @@ class GroupsCommand(YumCommand): +@@ -459,7 +817,7 @@ class GroupsCommand(YumCommand): except yum.Errors.GroupsError: return 1, [_('No Groups on which to run command')] except yum.Errors.YumBaseError, e: @@ -158824,7 +160309,7 @@ index 4dcbea7..bc30bd4 100644 def _grp_cmd(self, basecmd, extcmds): if basecmd in self.direct_commands: -@@ -470,6 +805,10 @@ class GroupsCommand(YumCommand): +@@ -470,6 +828,10 @@ class GroupsCommand(YumCommand): else: cmd = 'summary' @@ -158835,7 +160320,7 @@ index 4dcbea7..bc30bd4 100644 remap = {'update' : 'upgrade', 'erase' : 'remove', 'mark-erase' : 'mark-remove', -@@ -479,32 +818,70 @@ class GroupsCommand(YumCommand): +@@ -479,32 +841,76 @@ class GroupsCommand(YumCommand): return cmd, extcmds def doCheck(self, base, basecmd, extcmds): @@ -158860,12 +160345,18 @@ index 4dcbea7..bc30bd4 100644 + ocmds_arg = ('mark-install', 'mark-remove', + 'mark-packages', 'mark-packages-force', + 'unmark-packages', -+ 'mark-packages-sync', 'mark-packages-sync-force') ++ 'mark-packages-sync', 'mark-packages-sync-force', ++ 'mark-groups', 'mark-groups-force', ++ 'unmark-groups', ++ 'mark-groups-sync', 'mark-groups-sync-force') + + ocmds_all = ('mark-install', 'mark-remove', 'mark-convert', + 'mark-packages', 'mark-packages-force', + 'unmark-packages', -+ 'mark-packages-sync', 'mark-packages-sync-force') ++ 'mark-packages-sync', 'mark-packages-sync-force', ++ 'mark-groups', 'mark-groups-force', ++ 'unmark-groups', ++ 'mark-groups-sync', 'mark-groups-sync-force') + + if cmd in ('install', 'remove', 'info') or cmd in ocmds_arg: checkGroupArg(base, cmd, extcmds) @@ -158916,23 +160407,28 @@ index 4dcbea7..bc30bd4 100644 cmd, extcmds = self._grp_cmd(basecmd, extcmds) self._grp_setup_doCommand(base) -@@ -524,39 +901,195 @@ class GroupsCommand(YumCommand): +@@ -524,39 +930,258 @@ class GroupsCommand(YumCommand): if cmd == 'remove': return base.removeGroups(extcmds) + if cmd == 'mark-install': -+ for strng in extcmds: -+ for group in base.comps.return_groups(strng): -+ base.igroups.add_group(group.groupid, group.packages) ++ gRG = base._groupReturnGroups(extcmds,ignore_case=False) ++ igrps, grps, ievgrps, evgrps = gRG ++ for evgrp in evgrps: ++ base.igroups.add_environment(evgrp.environmentid, ++ evgrp.allgroups) ++ for grp in grps: ++ base.igroups.add_group(grp.groupid, grp.packages) + base.igroups.save() + return 0, ['Marked install: ' + ','.join(extcmds)] + + if cmd in ('mark-packages', 'mark-packages-force'): + if len(extcmds) < 2: + return 1, ['No group or package given'] -+ igrps, grps = base._groupReturnGroups([extcmds[0]], -+ ignore_case=False) -+ if igrps is not None and len(igrps) != 1: ++ gRG = base._groupReturnGroups([extcmds[0]], ++ ignore_case=False) ++ igrps, grps, ievgrps, evgrps = gRG ++ if igrps is None or len(igrps) != 1: + return 1, ['No group matched'] + grp = igrps[0] + force = cmd == 'mark-packages-force' @@ -158952,7 +160448,8 @@ index 4dcbea7..bc30bd4 100644 + return 0, ['UnMarked packages: ' + ','.join(extcmds)] + + if cmd in ('mark-packages-sync', 'mark-packages-sync-force'): -+ igrps, grps = base._groupReturnGroups(extcmds,ignore_case=False) ++ gRG = base._groupReturnGroups(extcmds,ignore_case=False) ++ igrps, grps, ievgrps, evgrps = gRG + if not igrps: + return 1, ['No group matched'] + force = cmd == 'mark-packages-sync-force' @@ -158966,6 +160463,60 @@ index 4dcbea7..bc30bd4 100644 + else: + return 0, ['Marked packages-sync: ' + ','.join(extcmds)] + ++ if cmd in ('mark-groups', 'mark-groups-force'): ++ if len(extcmds) < 2: ++ return 1, ['No environment or group given'] ++ gRG = base._groupReturnGroups([extcmds[0]], ++ ignore_case=False) ++ igrps, grps, ievgrps, evgrps = gRG ++ if ievgrps is None or len(ievgrps) != 1: ++ return 1, ['No environment matched'] ++ evgrp = ievgrps[0] ++ force = cmd == 'mark-groups-force' ++ gRG = base._groupReturnGroups(extcmds[1:], ignore_case=False) ++ for grp in gRG[1]: ++ # Packages full or empty? ++ self.igroups.add_group(grp.groupid, ++ grp.packages, ievgrp) ++ if force: ++ for grp in gRG[0]: ++ grp.environment = evgrp.evgid ++ base.igroups.changed = True ++ base.igroups.save() ++ return 0, ['Marked groups: ' + ','.join(extcmds[1:])] ++ ++ if cmd == 'unmark-groups': ++ gRG = base._groupReturnGroups([extcmds[0]], ++ ignore_case=False) ++ igrps, grps, ievgrps, evgrps = gRG ++ if igrps is None: ++ return 1, ['No groups matched'] ++ for grp in igrps: ++ grp.environment = None ++ base.igroups.changed = True ++ base.igroups.save() ++ return 0, ['UnMarked groups: ' + ','.join(extcmds)] ++ ++ if cmd in ('mark-groups-sync', 'mark-groups-sync-force'): ++ gRG = base._groupReturnGroups(extcmds,ignore_case=False) ++ igrps, grps, ievgrps, evgrps = gRG ++ if not ievgrps: ++ return 1, ['No environment matched'] ++ force = cmd == 'mark-groups-sync-force' ++ for evgrp in ievgrps: ++ grp_names = ",".join(sorted(evgrp.grp_names)) ++ for grp in base.igroups.return_groups(grp_names): ++ if not force and grp.environment is not None: ++ continue ++ grp.environment = evgrp.evgid ++ base.igroups.changed = True ++ base.igroups.save() ++ if force: ++ return 0, ['Marked groups-sync-force: '+','.join(extcmds)] ++ else: ++ return 0, ['Marked groups-sync: ' + ','.join(extcmds)] ++ ++ # FIXME: This doesn't do environment groups atm. + if cmd == 'mark-convert': + # Convert old style info. into groups as objects. + @@ -159015,9 +160566,12 @@ index 4dcbea7..bc30bd4 100644 + return 0, ['Converted old style groups to objects.'] + + if cmd == 'mark-remove': -+ for strng in extcmds: -+ for group in base.comps.return_groups(strng): -+ base.igroups.del_group(group.groupid) ++ gRG = base._groupReturnGroups(extcmds,ignore_case=False) ++ igrps, grps, ievgrps, evgrps = gRG ++ for evgrp in ievgrps: ++ base.igroups.del_environment(evgrp.evgid) ++ for grp in igrps: ++ base.igroups.del_group(grp.gid) + base.igroups.save() + return 0, ['Marked remove: ' + ','.join(extcmds)] + @@ -159114,7 +160668,7 @@ index 4dcbea7..bc30bd4 100644 base.logger.debug(_("Making cache files for all metadata files.")) base.logger.debug(_("This may take a while depending on the speed of this computer")) try: -@@ -565,81 +1098,204 @@ class MakeCacheCommand(YumCommand): +@@ -565,81 +1190,216 @@ class MakeCacheCommand(YumCommand): repo.mdpolicy = "group:all" base.doRepoSetup(dosack=0) base.repos.doSetup() @@ -159130,6 +160684,18 @@ index 4dcbea7..bc30bd4 100644 - base.repos.populateSack(mdtype='otherdata', cacheonly=1) + base.repos.populateSack(mdtype='all', cacheonly=1) ++ # Now decompress stuff, so that -C works, sigh. ++ fname_map = {'group_gz' : 'groups.xml', ++ 'pkgtags' : 'pkgtags.sqlite', ++ 'updateinfo' : 'updateinfo.xml', ++ } ++ for repo in base.repos.listEnabled(): ++ for MD in repo.repoXML.fileTypes(): ++ if MD not in fname_map: ++ continue ++ misc.repo_gen_decompress(repo.retrieveMD(MD), ++ fname_map[MD], ++ cached=repo.cache) except yum.Errors.YumBaseError, e: - return 1, [str(e)] @@ -159326,7 +160892,7 @@ index 4dcbea7..bc30bd4 100644 obscmds = ['obsoletes'] + extcmds base.extcmds.insert(0, 'updates') result = 0 -@@ -676,161 +1332,437 @@ class CheckUpdateCommand(YumCommand): +@@ -676,161 +1436,437 @@ class CheckUpdateCommand(YumCommand): columns=columns) result = 100 except yum.Errors.YumBaseError, e: @@ -159772,7 +161338,7 @@ index 4dcbea7..bc30bd4 100644 def _repo_size(repo): ret = 0 for pkg in repo.sack.returnPackages(): -@@ -866,6 +1798,13 @@ class RepoListCommand(YumCommand): +@@ -866,6 +1902,13 @@ class RepoListCommand(YumCommand): except yum.Errors.RepoError: if verbose: raise @@ -159786,7 +161352,7 @@ index 4dcbea7..bc30bd4 100644 repos = base.repos.repos.values() repos.sort() -@@ -924,111 +1863,108 @@ class RepoListCommand(YumCommand): +@@ -924,111 +1967,108 @@ class RepoListCommand(YumCommand): ui_enabled = dhibeg + _('disabled') + hiend ui_endis_wid = utf8_width(_('disabled')) @@ -159991,7 +161557,7 @@ index 4dcbea7..bc30bd4 100644 if not verbose and cols: # Work out the first (id) and last (enabled/disalbed/count), -@@ -1088,21 +2024,54 @@ class RepoListCommand(YumCommand): +@@ -1088,21 +2128,54 @@ class RepoListCommand(YumCommand): return 0, ['repolist: ' +to_unicode(locale.format("%d", tot_num, True))] def needTs(self, base, basecmd, extcmds): @@ -160046,7 +161612,7 @@ index 4dcbea7..bc30bd4 100644 if len(extcmds) == 0: base.usage() raise cli.CliError -@@ -1147,28 +2116,85 @@ class HelpCommand(YumCommand): +@@ -1147,28 +2220,85 @@ class HelpCommand(YumCommand): return help_output def doCommand(self, base, basecmd, extcmds): @@ -160132,7 +161698,7 @@ index 4dcbea7..bc30bd4 100644 self.doneCommand(base, _("Setting up Reinstall Process")) try: return base.reinstallPkgs(extcmds) -@@ -1177,49 +2203,139 @@ class ReInstallCommand(YumCommand): +@@ -1177,49 +2307,139 @@ class ReInstallCommand(YumCommand): return 1, [to_unicode(e)] def getSummary(self): @@ -160273,7 +161839,7 @@ index 4dcbea7..bc30bd4 100644 vcmd = 'installed' if extcmds: vcmd = extcmds[0] -@@ -1308,7 +2424,7 @@ class VersionCommand(YumCommand): +@@ -1308,7 +2528,7 @@ class VersionCommand(YumCommand): str(data[2][grp]))) _append_repos(cols, data[3][grp]) except yum.Errors.YumBaseError, e: @@ -160282,7 +161848,7 @@ index 4dcbea7..bc30bd4 100644 if vcmd in ('available', 'all', 'group-available', 'group-all'): try: data = base.pkgSack.simpleVersion(not verbose, groups=groups) -@@ -1327,7 +2443,7 @@ class VersionCommand(YumCommand): +@@ -1327,7 +2547,7 @@ class VersionCommand(YumCommand): if verbose: _append_repos(cols, data[3][grp]) except yum.Errors.YumBaseError, e: @@ -160291,7 +161857,7 @@ index 4dcbea7..bc30bd4 100644 data = {'rid' : {}, 'ver' : {}} for (rid, ver) in cols: -@@ -1344,6 +2460,14 @@ class VersionCommand(YumCommand): +@@ -1344,6 +2564,14 @@ class VersionCommand(YumCommand): return 0, ['version'] def needTs(self, base, basecmd, extcmds): @@ -160306,7 +161872,7 @@ index 4dcbea7..bc30bd4 100644 vcmd = 'installed' if extcmds: vcmd = extcmds[0] -@@ -1354,23 +2478,62 @@ class VersionCommand(YumCommand): +@@ -1354,23 +2582,62 @@ class VersionCommand(YumCommand): class HistoryCommand(YumCommand): @@ -160370,7 +161936,7 @@ index 4dcbea7..bc30bd4 100644 return 2, ["Repeating transaction %u" % (old.tid,)] def _hcmd_undo(self, base, extcmds): -@@ -1426,12 +2589,57 @@ class HistoryCommand(YumCommand): +@@ -1426,12 +2693,57 @@ class HistoryCommand(YumCommand): def _hcmd_new(self, base, extcmds): base.history._create_db_file() @@ -160429,7 +161995,7 @@ index 4dcbea7..bc30bd4 100644 if extcmds and extcmds[0] not in cmds: base.logger.critical(_('Invalid history sub-command, use: %s.'), ", ".join(cmds)) -@@ -1444,6 +2652,19 @@ class HistoryCommand(YumCommand): +@@ -1444,6 +2756,19 @@ class HistoryCommand(YumCommand): raise cli.CliError def doCommand(self, base, basecmd, extcmds): @@ -160449,7 +162015,7 @@ index 4dcbea7..bc30bd4 100644 vcmd = 'list' if extcmds: vcmd = extcmds[0] -@@ -1468,12 +2689,26 @@ class HistoryCommand(YumCommand): +@@ -1468,12 +2793,26 @@ class HistoryCommand(YumCommand): ret = self._hcmd_rollback(base, extcmds) elif vcmd == 'new': ret = self._hcmd_new(base, extcmds) @@ -160476,7 +162042,7 @@ index 4dcbea7..bc30bd4 100644 vcmd = 'list' if extcmds: vcmd = extcmds[0] -@@ -1481,16 +2716,46 @@ class HistoryCommand(YumCommand): +@@ -1481,16 +2820,46 @@ class HistoryCommand(YumCommand): class CheckRpmdbCommand(YumCommand): @@ -160523,7 +162089,7 @@ index 4dcbea7..bc30bd4 100644 chkcmd = 'all' if extcmds: chkcmd = extcmds -@@ -1505,19 +2770,57 @@ class CheckRpmdbCommand(YumCommand): +@@ -1505,19 +2874,57 @@ class CheckRpmdbCommand(YumCommand): return rc, ['%s %s' % (basecmd, chkcmd)] def needTs(self, base, basecmd, extcmds): @@ -160581,7 +162147,7 @@ index 4dcbea7..bc30bd4 100644 if not extcmds: base.logger.critical(_("No saved transaction file specified.")) raise cli.CliError -@@ -1533,5 +2836,13 @@ class LoadTransactionCommand(YumCommand): +@@ -1533,5 +2940,13 @@ class LoadTransactionCommand(YumCommand): def needTs(self, base, basecmd, extcmds): From 93fed308e22097715c44d53d712a03af61211c3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zden=C4=9Bk=20Pavlas?= Date: Wed, 22 Aug 2012 10:47:48 +0200 Subject: [PATCH 02/24] Fix a typo in checkfunc. BZ 850550 --- yum-HEAD.patch | 2 +- yum.spec | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/yum-HEAD.patch b/yum-HEAD.patch index b42f95b..8a391dc 100644 --- a/yum-HEAD.patch +++ b/yum-HEAD.patch @@ -159399,7 +159399,7 @@ index e5e9ece..f831f23 100644 - return self._getFile(url=basepath, + if checkfunc is None: -+ checkfunc = (package.verifyLocalPkg, (), {}) ++ checkfunc = lambda obj: package.verifyLocalPkg() + + ret = self._getFile(url=basepath, relative=remote, diff --git a/yum.spec b/yum.spec index 5a82a29..f15fa3d 100644 --- a/yum.spec +++ b/yum.spec @@ -18,7 +18,7 @@ Summary: RPM package installer/updater/manager Name: yum Version: 3.4.3 -Release: 32%{?dist} +Release: 33%{?dist} License: GPLv2+ Group: System Environment/Base Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz @@ -313,6 +313,9 @@ exit 0 %endif %changelog +* Wed Aug 22 2012 Zdenek Pavlas - 3.4.3-33 +- Fix a typo in checkfunc. BZ 850550 + * Thu Aug 16 2012 James Antill - 3.4.3-32 - update to latest HEAD. - Some fixes for new environment groups. From 1acc8e5e6d83839ae7fb26638a0c9cb46af9611f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zden=C4=9Bk=20Pavlas?= Date: Mon, 27 Aug 2012 11:16:21 +0200 Subject: [PATCH 03/24] Update to latest HEAD --- yum-HEAD.patch | 619 ++++++++++++++++++++++-------------- yum-completion-helper.patch | 11 + yum.spec | 9 +- 3 files changed, 393 insertions(+), 246 deletions(-) create mode 100644 yum-completion-helper.patch diff --git a/yum-HEAD.patch b/yum-HEAD.patch index 8a391dc..3a05bc9 100644 --- a/yum-HEAD.patch +++ b/yum-HEAD.patch @@ -3441,7 +3441,7 @@ index f1e06e8..b21c594 100644 complete -F _yum -o filenames yum yummain.py diff --git a/output.py b/output.py -index b6aa277..d29eba8 100755 +index b6aa277..caac21a 100755 --- a/output.py +++ b/output.py @@ -1,6 +1,6 @@ @@ -3452,6 +3452,15 @@ index b6aa277..d29eba8 100755 # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by +@@ -29,7 +29,7 @@ import re # For YumTerm + + from weakref import proxy as weakref + +-from urlgrabber.progress import TextMeter ++from urlgrabber.progress import TextMeter, TextMultiFileMeter + import urlgrabber.progress + from urlgrabber.grabber import URLGrabError + from yum.misc import prco_tuple_to_string @@ -47,6 +47,21 @@ import yum.history from yum.i18n import utf8_width, utf8_width_fill, utf8_text_fill @@ -3474,7 +3483,7 @@ index b6aa277..d29eba8 100755 def _term_width(): """ Simple terminal width, limit to 20 chars. and make 0 == 80. """ if not hasattr(urlgrabber.progress, 'terminal_width_cached'): -@@ -60,17 +75,21 @@ def _term_width(): +@@ -60,17 +75,26 @@ def _term_width(): class YumTextMeter(TextMeter): @@ -3495,13 +3504,18 @@ index b6aa277..d29eba8 100755 checkSignals() TextMeter.update(self, amount_read, now) ++class YumTextMultiFileMeter(TextMultiFileMeter): ++ def update_meter(self, meter, now): ++ checkSignals() ++ TextMultiFileMeter.update_meter(self, meter, now) ++ class YumTerm: - """some terminal "UI" helpers based on curses""" + """A class to provide some terminal "UI" helpers based on curses.""" # From initial search for "terminfo and python" got: # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/475116 -@@ -145,6 +164,17 @@ class YumTerm: +@@ -145,6 +169,17 @@ class YumTerm: self.BG_COLOR = self.__ansi_forced_BG_COLOR def reinit(self, term_stream=None, color='auto'): @@ -3519,7 +3533,7 @@ index b6aa277..d29eba8 100755 self.__enabled = True if not hasattr(urlgrabber.progress, 'terminal_width_cached'): self.columns = 80 -@@ -255,6 +285,37 @@ class YumTerm: +@@ -255,6 +290,37 @@ class YumTerm: return re.sub(r'\$<\d+>[/*]?', '', cap) def sub(self, haystack, beg, end, needles, escape=None, ignore_case=False): @@ -3557,7 +3571,7 @@ index b6aa277..d29eba8 100755 if not self.__enabled: return haystack -@@ -269,27 +330,106 @@ class YumTerm: +@@ -269,27 +335,106 @@ class YumTerm: haystack = re.sub(pat, render, haystack) return haystack def sub_norm(self, haystack, beg, needles, **kwds): @@ -3668,7 +3682,7 @@ index b6aa277..d29eba8 100755 def __init__(self): self.logger = logging.getLogger("yum.cli") -@@ -304,6 +444,12 @@ class YumOutput: +@@ -304,6 +449,12 @@ class YumOutput: def printtime(self): @@ -3681,7 +3695,7 @@ index b6aa277..d29eba8 100755 months = [_('Jan'), _('Feb'), _('Mar'), _('Apr'), _('May'), _('Jun'), _('Jul'), _('Aug'), _('Sep'), _('Oct'), _('Nov'), _('Dec')] now = time.localtime(time.time()) -@@ -312,14 +458,27 @@ class YumOutput: +@@ -312,14 +463,27 @@ class YumOutput: return ret def failureReport(self, errobj): @@ -3711,7 +3725,7 @@ index b6aa277..d29eba8 100755 progressbar(current, total, name) def _highlight(self, highlight): -@@ -368,9 +527,29 @@ class YumOutput: +@@ -368,9 +532,29 @@ class YumOutput: def calcColumns(self, data, columns=None, remainder_column=0, total_width=None, indent=''): @@ -3744,7 +3758,7 @@ index b6aa277..d29eba8 100755 if total_width is None: total_width = self.term.columns -@@ -473,10 +652,20 @@ class YumOutput: +@@ -473,10 +657,20 @@ class YumOutput: return (val, width, hibeg, hiend) def fmtColumns(self, columns, msg=u'', end=u'', text_width=utf8_width): @@ -3769,7 +3783,7 @@ index b6aa277..d29eba8 100755 total_width = len(msg) data = [] for col_data in columns[:-1]: -@@ -513,8 +702,18 @@ class YumOutput: +@@ -513,8 +707,18 @@ class YumOutput: def simpleList(self, pkg, ui_overflow=False, indent='', highlight=False, columns=None): @@ -3790,7 +3804,7 @@ index b6aa277..d29eba8 100755 if columns is None: columns = (-40, -22, -16) # Old default ver = pkg.printVer() -@@ -526,9 +725,19 @@ class YumOutput: +@@ -526,9 +730,19 @@ class YumOutput: def simpleEnvraList(self, pkg, ui_overflow=False, indent='', highlight=False, columns=None): @@ -3813,7 +3827,7 @@ index b6aa277..d29eba8 100755 if columns is None: columns = (-63, -16) # Old default envra = '%s%s' % (indent, str(pkg)) -@@ -538,7 +747,13 @@ class YumOutput: +@@ -538,7 +752,13 @@ class YumOutput: print self.fmtColumns(columns, text_width=len) def fmtKeyValFill(self, key, val): @@ -3828,7 +3842,7 @@ index b6aa277..d29eba8 100755 val = to_str(val) keylen = utf8_width(key) cols = self.term.columns -@@ -553,6 +768,15 @@ class YumOutput: +@@ -553,6 +773,15 @@ class YumOutput: return ret def fmtSection(self, name, fill='='): @@ -3844,7 +3858,7 @@ index b6aa277..d29eba8 100755 name = to_str(name) cols = self.term.columns - 2 name_len = utf8_width(name) -@@ -577,6 +801,12 @@ class YumOutput: +@@ -577,6 +806,12 @@ class YumOutput: return to_unicode(s) def infoOutput(self, pkg, highlight=False): @@ -3857,7 +3871,7 @@ index b6aa277..d29eba8 100755 (hibeg, hiend) = self._highlight(highlight) print _("Name : %s%s%s") % (hibeg, to_unicode(pkg.name), hiend) print _("Arch : %s") % to_unicode(pkg.arch) -@@ -617,9 +847,22 @@ class YumOutput: +@@ -617,9 +852,22 @@ class YumOutput: print "" def updatesObsoletesList(self, uotup, changetype, columns=None): @@ -3883,7 +3897,7 @@ index b6aa277..d29eba8 100755 (changePkg, instPkg) = uotup if columns is not None: -@@ -640,12 +883,45 @@ class YumOutput: +@@ -640,12 +888,45 @@ class YumOutput: def listPkgs(self, lst, description, outputType, highlight_na={}, columns=None, highlight_modes={}): @@ -3935,7 +3949,7 @@ index b6aa277..d29eba8 100755 if outputType in ['list', 'info']: thingslisted = 0 if len(lst) > 0: -@@ -654,7 +930,8 @@ class YumOutput: +@@ -654,7 +935,8 @@ class YumOutput: for pkg in sorted(lst): key = (pkg.name, pkg.arch) highlight = False @@ -3945,7 +3959,7 @@ index b6aa277..d29eba8 100755 elif key not in highlight_na: highlight = highlight_modes.get('not in', 'normal') elif pkg.verEQ(highlight_na[key]): -@@ -679,8 +956,11 @@ class YumOutput: +@@ -679,8 +961,11 @@ class YumOutput: def userconfirm(self): @@ -3958,7 +3972,7 @@ index b6aa277..d29eba8 100755 yui = (to_unicode(_('y')), to_unicode(_('yes'))) nui = (to_unicode(_('n')), to_unicode(_('no'))) aui = (yui[0], yui[1], nui[0], nui[1]) -@@ -739,27 +1019,58 @@ class YumOutput: +@@ -739,27 +1024,58 @@ class YumOutput: return ret def _calcDataPkgColumns(self, data, pkg_names, pkg_names2pkgs, @@ -4021,7 +4035,7 @@ index b6aa277..d29eba8 100755 continue for (apkg, ipkg) in sorted(pkg_names2pkgs[item], key=lambda x: x[1] or x[0]): -@@ -770,18 +1081,38 @@ class YumOutput: +@@ -770,18 +1086,38 @@ class YumOutput: else: highlight = False self.simpleEnvraList(ipkg or apkg, ui_overflow=True, @@ -4064,7 +4078,7 @@ index b6aa277..d29eba8 100755 if group.ui_description: print _(' Description: %s') % to_unicode(group.ui_description) if group.langonly: -@@ -795,7 +1126,8 @@ class YumOutput: +@@ -795,7 +1131,8 @@ class YumOutput: if verb: data = {'envra' : {}, 'rid' : {}} for (section_name, pkg_names) in sections: @@ -4074,7 +4088,7 @@ index b6aa277..d29eba8 100755 data = [data['envra'], data['rid']] columns = self.calcColumns(data) columns = (-columns[0], -columns[1]) -@@ -804,11 +1136,77 @@ class YumOutput: +@@ -804,11 +1141,77 @@ class YumOutput: if len(pkg_names) > 0: print section_name self._displayPkgsFromNames(pkg_names, verb, pkg_names2pkgs, @@ -4155,7 +4169,7 @@ index b6aa277..d29eba8 100755 verb = self.verbose_logger.isEnabledFor(logginglevels.DEBUG_3) for pkg in sorted(results): print _("package: %s") % pkg.compactPrint() -@@ -832,7 +1230,18 @@ class YumOutput: +@@ -832,7 +1235,18 @@ class YumOutput: print " provider: %s" % po.compactPrint() def format_number(self, number, SI=0, space=' '): @@ -4175,7 +4189,7 @@ index b6aa277..d29eba8 100755 symbols = [ ' ', # (none) 'k', # kilo 'M', # mega -@@ -870,16 +1279,31 @@ class YumOutput: +@@ -870,16 +1284,31 @@ class YumOutput: @staticmethod def format_time(seconds, use_hours=0): @@ -4213,7 +4227,7 @@ index b6aa277..d29eba8 100755 if self.conf.showdupesfromrepos: msg = '%s : ' % po else: -@@ -923,7 +1347,15 @@ class YumOutput: +@@ -923,7 +1352,15 @@ class YumOutput: item = self._enc(item) can_overflow = False else: @@ -4230,7 +4244,7 @@ index b6aa277..d29eba8 100755 if matchfor: item = self._sub_highlight(item, highlight, matchfor, -@@ -935,14 +1367,34 @@ class YumOutput: +@@ -935,14 +1372,34 @@ class YumOutput: print '\n\n' def matchcallback_verbose(self, po, values, matchfor=None): @@ -4266,7 +4280,7 @@ index b6aa277..d29eba8 100755 for pkg in packages: # Just to be on the safe side, if for some reason getting # the package size fails, log the error and don't report download -@@ -971,18 +1423,18 @@ class YumOutput: +@@ -971,18 +1428,18 @@ class YumOutput: if (not error): if locsize: @@ -4293,7 +4307,7 @@ index b6aa277..d29eba8 100755 totsize = 0 error = False for pkg in packages: -@@ -997,13 +1449,19 @@ class YumOutput: +@@ -997,13 +1454,19 @@ class YumOutput: self.logger.error(_('There was an error calculating installed size')) break if (not error): @@ -4318,7 +4332,7 @@ index b6aa277..d29eba8 100755 self.tsInfo.makelists(True, True) pkglist_lines = [] data = {'n' : {}, 'v' : {}, 'r' : {}} -@@ -1032,8 +1490,7 @@ class YumOutput: +@@ -1032,8 +1495,7 @@ class YumOutput: for (d, v) in (("n",len(n)), ("v",len(evr)), ("r",len(repoid))): data[d].setdefault(v, 0) data[d][v] += 1 @@ -4328,7 +4342,7 @@ index b6aa277..d29eba8 100755 return a_wid for (action, pkglist) in [(_('Installing'), self.tsInfo.installed), -@@ -1102,19 +1559,72 @@ class YumOutput: +@@ -1102,19 +1564,72 @@ class YumOutput: Transaction Summary %s """) % ('=' * self.term.columns)) @@ -4411,7 +4425,7 @@ index b6aa277..d29eba8 100755 out = '' self.tsInfo.makelists() -@@ -1179,9 +1689,9 @@ Transaction Summary +@@ -1179,17 +1694,19 @@ Transaction Summary return out def setupProgressCallbacks(self): @@ -4424,7 +4438,33 @@ index b6aa277..d29eba8 100755 # if we're below 2 on the debug level we don't need to be outputting # progress bars - this is hacky - I'm open to other options # One of these is a download -@@ -1216,10 +1726,12 @@ Transaction Summary + if self.conf.debuglevel < 2 or not sys.stdout.isatty(): + progressbar = None ++ multi_progressbar = None + callback = None + else: + progressbar = YumTextMeter(fo=sys.stdout) ++ multi_progressbar = YumTextMultiFileMeter(fo=sys.stdout) + callback = CacheProgressCallback() + + # setup our failure report for failover +@@ -1200,13 +1717,14 @@ Transaction Summary + interrupt_callback = self.interrupt_callback + if hasattr(self, 'prerepoconf'): + self.prerepoconf.progressbar = progressbar ++ self.prerepoconf.multi_progressbar = multi_progressbar + self.prerepoconf.callback = callback + self.prerepoconf.failure_callback = failure_callback + self.prerepoconf.interrupt_callback = interrupt_callback + else: + # Just in case some API user decides to do self.repos before + # calling us. +- self.repos.setProgressBar(progressbar) ++ self.repos.setProgressBar(progressbar, multi_progressbar) + self.repos.callback = callback + self.repos.setFailureCallback(failure_callback) + self.repos.setInterruptCallback(interrupt_callback) +@@ -1216,10 +1734,12 @@ Transaction Summary self.dsCallback = dscb def setupProgessCallbacks(self): @@ -4438,7 +4478,7 @@ index b6aa277..d29eba8 100755 confirm_func = self._cli_confirm_gpg_key_import gpg_import_func = self.getKeyForRepo gpgca_import_func = self.getCAKeyForRepo -@@ -1233,14 +1745,12 @@ Transaction Summary +@@ -1233,14 +1753,12 @@ Transaction Summary self.repos.gpgca_import_func = gpgca_import_func def interrupt_callback(self, cbobj): @@ -4458,7 +4498,7 @@ index b6aa277..d29eba8 100755 ''' delta_exit_chk = 2.0 # Delta between C-c's so we treat as exit delta_exit_str = _("two") # Human readable version of above -@@ -1269,6 +1779,14 @@ to exit. +@@ -1269,6 +1787,14 @@ to exit. def download_callback_total_cb(self, remote_pkgs, remote_size, download_start_timestamp): @@ -4473,26 +4513,26 @@ index b6aa277..d29eba8 100755 if len(remote_pkgs) <= 1: return if not hasattr(urlgrabber.progress, 'TerminalLine'): -@@ -1434,8 +1952,17 @@ to exit. +@@ -1434,8 +1960,17 @@ to exit. return tids, printall def historyListCmd(self, extcmds): - """ Shows the user a list of data about the history. """ + """Output a list of information about the history of yum + transactions. - ++ + :param extcmds: list of extra command line arguments + :return: (exit_code, [errors]) + + exit_code is:: -+ + + 0 = we're done, exit + 1 = we've errored, exit with error string + """ tids, printall = self._history_list_transactions(extcmds) if tids is None: return 1, ['Failed history list'] -@@ -1564,6 +2091,16 @@ to exit. +@@ -1564,6 +2099,16 @@ to exit. return old[0] def historyInfoCmd(self, extcmds): @@ -4509,7 +4549,7 @@ index b6aa277..d29eba8 100755 def str2int(x): try: return int(x) -@@ -1656,6 +2193,9 @@ to exit. +@@ -1656,6 +2201,9 @@ to exit. def _hpkg2from_repo(self, hpkg): """ Given a pkg, find the ipkg.ui_from_repo ... if none, then get an apkg. ... and put a ? in there. """ @@ -4519,7 +4559,7 @@ index b6aa277..d29eba8 100755 ipkgs = self.rpmdb.searchPkgTuple(hpkg.pkgtup) if not ipkgs: apkgs = self.pkgSack.searchPkgTuple(hpkg.pkgtup) -@@ -1672,13 +2212,12 @@ to exit. +@@ -1672,13 +2220,12 @@ to exit. 'o' : _('Updated'), 'n' : _('Downgraded')} _pkg_states_available = {'i' : _('Installed'), 'e' : _('Not installed'), 'o' : _('Older'), 'n' : _('Newer')} @@ -4536,7 +4576,7 @@ index b6aa277..d29eba8 100755 prefix = " " * prefix_len if was_installed: _pkg_states = _pkg_states_installed -@@ -1702,9 +2241,11 @@ to exit. +@@ -1702,9 +2249,11 @@ to exit. else: (hibeg, hiend) = self._highlight('normal') state = utf8_width_fill(state, _pkg_states['maxlen']) @@ -4550,7 +4590,7 @@ index b6aa277..d29eba8 100755 if type(old.tid) == type([]): print _("Transaction ID :"), "%u..%u" % (old.tid[0], old.tid[-1]) -@@ -1778,8 +2319,8 @@ to exit. +@@ -1778,8 +2327,8 @@ to exit. default_addons = set(['config-main', 'config-repos', 'saved_tx']) non_default = set(addon_info).difference(default_addons) if len(non_default) > 0: @@ -4561,7 +4601,7 @@ index b6aa277..d29eba8 100755 if old.trans_with: # This is _possible_, but not common -@@ -1794,7 +2335,9 @@ to exit. +@@ -1794,7 +2343,9 @@ to exit. print _("Packages Skipped:") pkg_max_len = max((len(str(hpkg)) for hpkg in old.trans_skip)) for hpkg in old.trans_skip: @@ -4572,7 +4612,7 @@ index b6aa277..d29eba8 100755 if old.rpmdb_problems: print _("Rpmdb Problems:") -@@ -1833,6 +2376,13 @@ to exit. +@@ -1833,6 +2384,13 @@ to exit. 'Updated' : _('Updated'), } def historyInfoCmdPkgsAltered(self, old, pats=[]): @@ -4586,7 +4626,7 @@ index b6aa277..d29eba8 100755 last = None # Note that these don't use _simple_pkg() because we are showing what # happened to them in the transaction ... not the difference between the -@@ -1886,6 +2436,10 @@ to exit. +@@ -1886,6 +2444,10 @@ to exit. self._hpkg2from_repo(hpkg)) def historySummaryCmd(self, extcmds): @@ -4597,7 +4637,7 @@ index b6aa277..d29eba8 100755 tids, printall = self._history_list_transactions(extcmds) if tids is None: return 1, ['Failed history info'] -@@ -1946,6 +2500,10 @@ to exit. +@@ -1946,6 +2508,10 @@ to exit. utf8_width_fill(uiacts, 16, 16), count) def historyAddonInfoCmd(self, extcmds): @@ -4608,7 +4648,7 @@ index b6aa277..d29eba8 100755 tid = None if len(extcmds) > 1: tid = extcmds[1] -@@ -1983,16 +2541,19 @@ to exit. +@@ -1983,16 +2549,19 @@ to exit. for item in extcmds[2:]: if item in addon_info: @@ -4634,7 +4674,7 @@ index b6aa277..d29eba8 100755 tids = self.history.search(extcmds) limit = None if extcmds and not tids: -@@ -2078,9 +2639,94 @@ to exit. +@@ -2078,9 +2647,94 @@ to exit. if lastdbv.end_rpmdbversion != rpmdbv: self._rpmdb_warn_checks() @@ -4730,7 +4770,7 @@ index b6aa277..d29eba8 100755 def __init__(self, ayum=None): """requires yum-cli log and errorlog functions as arguments""" -@@ -2089,6 +2735,25 @@ class DepSolveProgressCallBack: +@@ -2089,6 +2743,25 @@ class DepSolveProgressCallBack: self.ayum = ayum def pkgAdded(self, pkgtup, mode): @@ -4756,7 +4796,7 @@ index b6aa277..d29eba8 100755 modedict = { 'i': _('installed'), 'u': _('an update'), 'e': _('erased'), -@@ -2104,43 +2769,85 @@ class DepSolveProgressCallBack: +@@ -2104,43 +2777,85 @@ class DepSolveProgressCallBack: modeterm) def start(self): @@ -4844,7 +4884,7 @@ index b6aa277..d29eba8 100755 needname, needflags, needversion = reqTup yb = self.ayum -@@ -2225,46 +2932,106 @@ class DepSolveProgressCallBack: +@@ -2225,46 +2940,106 @@ class DepSolveProgressCallBack: return msg def procConflict(self, name, confname): @@ -4956,7 +4996,7 @@ index b6aa277..d29eba8 100755 def _pkgname_ui(ayum, pkgname, ts_states=None): """ Get more information on a simple pkgname, if we can. We need to search -@@ -2316,10 +3083,7 @@ def _pkgname_ui(ayum, pkgname, ts_states=None): +@@ -2316,10 +3091,7 @@ def _pkgname_ui(ayum, pkgname, ts_states=None): return pkgname class YumCliRPMCallBack(RPMBaseCallback): @@ -4968,7 +5008,7 @@ index b6aa277..d29eba8 100755 width = property(lambda x: _term_width()) -@@ -2337,21 +3101,34 @@ class YumCliRPMCallBack(RPMBaseCallback): +@@ -2337,21 +3109,34 @@ class YumCliRPMCallBack(RPMBaseCallback): # Installing things have pkg objects passed to the events, so only need to # lookup for erased/obsoleted. def pkgname_ui(self, pkgname, ts_states=('e', 'od', 'ud', None)): @@ -5013,7 +5053,7 @@ index b6aa277..d29eba8 100755 if type(package) not in types.StringTypes: pkgname = str(package) -@@ -2363,9 +3140,25 @@ class YumCliRPMCallBack(RPMBaseCallback): +@@ -2363,9 +3148,25 @@ class YumCliRPMCallBack(RPMBaseCallback): percent = 0 else: percent = (te_current*100L)/te_total @@ -5040,7 +5080,7 @@ index b6aa277..d29eba8 100755 pkgname=pkgname, wid1=wid1) msg = fmt % (utf8_width_fill(process, wid1, wid1), utf8_width_fill(pkgname, wid2, wid2)) -@@ -2377,6 +3170,11 @@ class YumCliRPMCallBack(RPMBaseCallback): +@@ -2377,6 +3178,11 @@ class YumCliRPMCallBack(RPMBaseCallback): print " " def scriptout(self, package, msgs): @@ -5052,7 +5092,7 @@ index b6aa277..d29eba8 100755 if msgs: sys.stdout.write(to_unicode(msgs)) sys.stdout.flush() -@@ -2429,8 +3227,30 @@ class YumCliRPMCallBack(RPMBaseCallback): +@@ -2429,8 +3235,30 @@ class YumCliRPMCallBack(RPMBaseCallback): wid2 = pnl return fmt, wid1, wid2 @@ -151274,8 +151314,35 @@ index abd203f..65c62a9 100644 * Wed Apr 20 2011 James Antill - 3.4.1 - umask bug fix. +diff --git a/yum/Errors.py b/yum/Errors.py +index c1af4ad..e3e3956 100644 +--- a/yum/Errors.py ++++ b/yum/Errors.py +@@ -79,9 +79,20 @@ class RepoError(YumBaseError): + class DuplicateRepoError(RepoError): + pass + ++# Have our own custom .value with all the mirror errors. + class NoMoreMirrorsRepoError(RepoError): +- pass +- ++ def __init__(self, value=None, errors=None): ++ Exception.__init__(self) ++ self._value = value ++ self.errors = errors ++ ++ @property ++ def value(self): ++ ret = self._value ++ for url, msg in self.errors or []: ++ ret += '\n%s: %s' % (url, msg) ++ return ret ++ + class ConfigError(YumBaseError): + pass + diff --git a/yum/__init__.py b/yum/__init__.py -index 99039e0..1108443 100644 +index 99039e0..198dc6d 100644 --- a/yum/__init__.py +++ b/yum/__init__.py @@ -46,8 +46,13 @@ import operator @@ -151328,7 +151395,7 @@ index 99039e0..1108443 100644 def __init__(self): self.fn = '/etc/yum/yum.conf' self.root = '/' -@@ -125,10 +133,12 @@ class _YumPreBaseConf: +@@ -125,12 +133,15 @@ class _YumPreBaseConf: class _YumPreRepoConf: @@ -151344,8 +151411,11 @@ index 99039e0..1108443 100644 + """ def __init__(self): self.progressbar = None ++ self.multi_progressbar = None self.callback = None -@@ -164,11 +174,11 @@ class _YumCostExclude: + self.failure_callback = None + self.interrupt_callback = None +@@ -164,11 +175,11 @@ class _YumCostExclude: return False class YumBase(depsolve.Depsolve): @@ -151362,7 +151432,7 @@ index 99039e0..1108443 100644 def __init__(self): depsolve.Depsolve.__init__(self) self._conf = None -@@ -177,6 +187,7 @@ class YumBase(depsolve.Depsolve): +@@ -177,6 +188,7 @@ class YumBase(depsolve.Depsolve): self._up = None self._comps = None self._history = None @@ -151370,7 +151440,7 @@ index 99039e0..1108443 100644 self._pkgSack = None self._lockfile = None self._tags = None -@@ -204,6 +215,7 @@ class YumBase(depsolve.Depsolve): +@@ -204,6 +216,7 @@ class YumBase(depsolve.Depsolve): self.run_with_package_names = set() self._cleanup = [] @@ -151378,7 +151448,7 @@ index 99039e0..1108443 100644 def __del__(self): self.close() -@@ -213,10 +225,15 @@ class YumBase(depsolve.Depsolve): +@@ -213,10 +226,15 @@ class YumBase(depsolve.Depsolve): for cb in self._cleanup: cb() def close(self): @@ -151394,7 +151464,7 @@ index 99039e0..1108443 100644 if self._repos: self._repos.close() -@@ -225,15 +242,33 @@ class YumBase(depsolve.Depsolve): +@@ -225,15 +243,33 @@ class YumBase(depsolve.Depsolve): return transactioninfo.TransactionData() def doGenericSetup(self, cache=0): @@ -151430,7 +151500,7 @@ index 99039e0..1108443 100644 warnings.warn(_('doConfigSetup() will go away in a future version of Yum.\n'), Errors.YumFutureDeprecationWarning, stacklevel=2) -@@ -297,15 +332,17 @@ class YumBase(depsolve.Depsolve): +@@ -297,15 +333,17 @@ class YumBase(depsolve.Depsolve): # Try the old default fn = '/etc/yum.conf' @@ -151451,7 +151521,7 @@ index 99039e0..1108443 100644 if debuglevel != None: startupconf.debuglevel = debuglevel -@@ -336,6 +373,12 @@ class YumBase(depsolve.Depsolve): +@@ -336,6 +374,12 @@ class YumBase(depsolve.Depsolve): self._conf = config.readMainConfig(startupconf) @@ -151464,7 +151534,7 @@ index 99039e0..1108443 100644 # We don't want people accessing/altering preconf after it becomes # worthless. So we delete it, and thus. it'll raise AttributeError del self.preconf -@@ -367,22 +410,36 @@ class YumBase(depsolve.Depsolve): +@@ -367,22 +411,36 @@ class YumBase(depsolve.Depsolve): def doLoggingSetup(self, debuglevel, errorlevel, syslog_ident=None, syslog_facility=None, syslog_device='/dev/log'): @@ -151508,7 +151578,7 @@ index 99039e0..1108443 100644 if repo_age is None: repo_age = os.stat(repofn)[8] -@@ -391,8 +448,7 @@ class YumBase(depsolve.Depsolve): +@@ -391,8 +449,7 @@ class YumBase(depsolve.Depsolve): try: parser.readfp(confpp_obj) except ParsingError, e: @@ -151518,7 +151588,7 @@ index 99039e0..1108443 100644 # Check sections in the .repo file that was just slurped up for section in parser.sections(): -@@ -429,7 +485,15 @@ class YumBase(depsolve.Depsolve): +@@ -429,7 +486,15 @@ class YumBase(depsolve.Depsolve): thisrepo.base_persistdir = self.conf._repos_persistdir @@ -151535,7 +151605,7 @@ index 99039e0..1108443 100644 if thisrepo.id in self.repo_setopts: for opt in self.repo_setopts[thisrepo.id].items: if not hasattr(thisrepo, opt): -@@ -440,6 +504,20 @@ class YumBase(depsolve.Depsolve): +@@ -440,6 +505,20 @@ class YumBase(depsolve.Depsolve): if validate and not validate(thisrepo): continue @@ -151556,7 +151626,7 @@ index 99039e0..1108443 100644 # Got our list of repo objects, add them to the repos # collection try: -@@ -448,8 +526,11 @@ class YumBase(depsolve.Depsolve): +@@ -448,8 +527,11 @@ class YumBase(depsolve.Depsolve): self.logger.warning(e) def getReposFromConfig(self): @@ -151570,7 +151640,7 @@ index 99039e0..1108443 100644 # Read .repo files from directories specified by the reposdir option # (typically /etc/yum/repos.d) repo_config_age = self.conf.config_file_age -@@ -466,18 +547,22 @@ class YumBase(depsolve.Depsolve): +@@ -466,18 +548,22 @@ class YumBase(depsolve.Depsolve): if os.path.isdir(reposdir): for repofn in sorted(glob.glob('%s/*.repo' % reposdir)): @@ -151598,7 +151668,7 @@ index 99039e0..1108443 100644 repo = yumRepo.YumRepository(section) try: repo.populate(parser, section, self.conf) -@@ -493,38 +578,40 @@ class YumBase(depsolve.Depsolve): +@@ -493,38 +579,40 @@ class YumBase(depsolve.Depsolve): repo.name = to_unicode(repo.name) # Set attributes not from the config file @@ -151661,7 +151731,7 @@ index 99039e0..1108443 100644 if isinstance(self.plugins, plugins.YumPlugins): raise RuntimeError(_("plugins already initialised")) -@@ -533,6 +620,8 @@ class YumBase(depsolve.Depsolve): +@@ -533,6 +621,8 @@ class YumBase(depsolve.Depsolve): def doRpmDBSetup(self): @@ -151670,7 +151740,7 @@ index 99039e0..1108443 100644 warnings.warn(_('doRpmDBSetup() will go away in a future version of Yum.\n'), Errors.YumFutureDeprecationWarning, stacklevel=2) -@@ -552,7 +641,8 @@ class YumBase(depsolve.Depsolve): +@@ -552,7 +642,8 @@ class YumBase(depsolve.Depsolve): return self._rpmdb def closeRpmDB(self): @@ -151680,7 +151750,7 @@ index 99039e0..1108443 100644 if self._rpmdb is not None: self._rpmdb.ts = None self._rpmdb.dropCachedData() -@@ -567,6 +657,12 @@ class YumBase(depsolve.Depsolve): +@@ -567,6 +658,12 @@ class YumBase(depsolve.Depsolve): self._ts = None def doRepoSetup(self, thisrepo=None): @@ -151693,7 +151763,17 @@ index 99039e0..1108443 100644 warnings.warn(_('doRepoSetup() will go away in a future version of Yum.\n'), Errors.YumFutureDeprecationWarning, stacklevel=2) -@@ -630,6 +726,14 @@ class YumBase(depsolve.Depsolve): +@@ -588,7 +685,8 @@ class YumBase(depsolve.Depsolve): + prerepoconf = self.prerepoconf + del self.prerepoconf + +- self.repos.setProgressBar(prerepoconf.progressbar) ++ self.repos.setProgressBar(prerepoconf.progressbar, ++ prerepoconf.multi_progressbar) + self.repos.callback = prerepoconf.callback + self.repos.setFailureCallback(prerepoconf.failure_callback) + self.repos.setInterruptCallback(prerepoconf.interrupt_callback) +@@ -630,6 +728,14 @@ class YumBase(depsolve.Depsolve): self._repos = RepoStorage(self) def doSackSetup(self, archlist=None, thisrepo=None): @@ -151708,7 +151788,7 @@ index 99039e0..1108443 100644 warnings.warn(_('doSackSetup() will go away in a future version of Yum.\n'), Errors.YumFutureDeprecationWarning, stacklevel=2) -@@ -711,6 +815,9 @@ class YumBase(depsolve.Depsolve): +@@ -711,6 +817,9 @@ class YumBase(depsolve.Depsolve): def doUpdateSetup(self): @@ -151718,7 +151798,7 @@ index 99039e0..1108443 100644 warnings.warn(_('doUpdateSetup() will go away in a future version of Yum.\n'), Errors.YumFutureDeprecationWarning, stacklevel=2) -@@ -765,6 +872,8 @@ class YumBase(depsolve.Depsolve): +@@ -765,6 +874,8 @@ class YumBase(depsolve.Depsolve): return self._up def doGroupSetup(self): @@ -151727,7 +151807,7 @@ index 99039e0..1108443 100644 warnings.warn(_('doGroupSetup() will go away in a future version of Yum.\n'), Errors.YumFutureDeprecationWarning, stacklevel=2) -@@ -829,7 +938,7 @@ class YumBase(depsolve.Depsolve): +@@ -829,7 +940,7 @@ class YumBase(depsolve.Depsolve): try: self._comps.add(groupfile) except (Errors.GroupsError,Errors.CompsException), e: @@ -151736,7 +151816,7 @@ index 99039e0..1108443 100644 self.logger.critical(msg) else: repo.groups_added = True -@@ -837,7 +946,10 @@ class YumBase(depsolve.Depsolve): +@@ -837,7 +948,10 @@ class YumBase(depsolve.Depsolve): if self._comps.compscount == 0: raise Errors.GroupsError, _('No Groups Available in any repository') @@ -151748,7 +151828,7 @@ index 99039e0..1108443 100644 self.verbose_logger.debug('group time: %0.3f' % (time.time() - group_st)) return self._comps -@@ -868,7 +980,7 @@ class YumBase(depsolve.Depsolve): +@@ -868,7 +982,7 @@ class YumBase(depsolve.Depsolve): # feed it into _tags.add() self._tags.add(repo.id, tag_sqlite) except (Errors.RepoError, Errors.PkgTagsError), e: @@ -151757,7 +151837,7 @@ index 99039e0..1108443 100644 self.logger.critical(msg) -@@ -881,9 +993,18 @@ class YumBase(depsolve.Depsolve): +@@ -881,9 +995,18 @@ class YumBase(depsolve.Depsolve): if self._history is None: pdb_path = self.conf.persistdir + "/history" self._history = yum.history.YumHistory(root=self.conf.installroot, @@ -151777,7 +151857,7 @@ index 99039e0..1108443 100644 # properties so they auto-create themselves with defaults repos = property(fget=lambda self: self._getRepos(), fset=lambda self, value: setattr(self, "_repos", value), -@@ -921,6 +1042,11 @@ class YumBase(depsolve.Depsolve): +@@ -921,6 +1044,11 @@ class YumBase(depsolve.Depsolve): fdel=lambda self: setattr(self, "_history", None), doc="Yum History Object") @@ -151789,7 +151869,7 @@ index 99039e0..1108443 100644 pkgtags = property(fget=lambda self: self._getTags(), fset=lambda self, value: setattr(self, "_tags",value), fdel=lambda self: setattr(self, "_tags", None), -@@ -928,9 +1054,10 @@ class YumBase(depsolve.Depsolve): +@@ -928,9 +1056,10 @@ class YumBase(depsolve.Depsolve): def doSackFilelistPopulate(self): @@ -151803,7 +151883,7 @@ index 99039e0..1108443 100644 necessary = False # I can't think of a nice way of doing this, we have to have the sack here -@@ -951,8 +1078,12 @@ class YumBase(depsolve.Depsolve): +@@ -951,8 +1080,12 @@ class YumBase(depsolve.Depsolve): self.repos.populateSack(mdtype='filelists') def yumUtilsMsg(self, func, prog): @@ -151818,7 +151898,7 @@ index 99039e0..1108443 100644 if self.rpmdb.contains(name="yum-utils"): return -@@ -964,8 +1095,17 @@ class YumBase(depsolve.Depsolve): +@@ -964,8 +1097,17 @@ class YumBase(depsolve.Depsolve): (hibeg, prog, hiend)) def buildTransaction(self, unfinished_transactions_check=True): @@ -151838,7 +151918,7 @@ index 99039e0..1108443 100644 if (unfinished_transactions_check and misc.find_unfinished_transactions(yumlibpath=self.conf.persistdir)): msg = _('There are unfinished transactions remaining. You might ' \ -@@ -1004,7 +1144,7 @@ class YumBase(depsolve.Depsolve): +@@ -1004,7 +1146,7 @@ class YumBase(depsolve.Depsolve): # If transaction was changed by postresolve plugins then we should run skipbroken again (rescode, restring) = self._doSkipBroken(rescode, restring, clear_skipped=False ) @@ -151847,7 +151927,7 @@ index 99039e0..1108443 100644 self.tsInfo.pkgSack.dropCachedData() # FIXME: This is horrible, see below and yummain. Maybe create a real -@@ -1044,6 +1184,37 @@ class YumBase(depsolve.Depsolve): +@@ -1044,6 +1186,37 @@ class YumBase(depsolve.Depsolve): if first.verEQ(other): continue msg = _('Protected multilib versions: %s != %s') @@ -151885,7 +151965,7 @@ index 99039e0..1108443 100644 xrestring.append(msg % (first, other)) if xrestring: rescode = 1 -@@ -1242,13 +1413,15 @@ class YumBase(depsolve.Depsolve): +@@ -1242,13 +1415,15 @@ class YumBase(depsolve.Depsolve): if None in pkgtup: return None return pkgtup @@ -151905,7 +151985,7 @@ index 99039e0..1108443 100644 if pkgtup is None: return self._not_found_i[pkgtup] = YumNotFoundPackage(pkgtup) -@@ -1454,8 +1627,14 @@ class YumBase(depsolve.Depsolve): +@@ -1454,8 +1629,14 @@ class YumBase(depsolve.Depsolve): return probs def runTransaction(self, cb): @@ -151921,7 +152001,7 @@ index 99039e0..1108443 100644 self.plugins.run('pretrans') # We may want to put this other places, eventually, but for now it's -@@ -1516,10 +1695,23 @@ class YumBase(depsolve.Depsolve): +@@ -1516,10 +1697,23 @@ class YumBase(depsolve.Depsolve): pass self._ts_save_file = None @@ -151945,7 +152025,7 @@ index 99039e0..1108443 100644 # make resultobject - just a plain yumgenericholder object resultobject = misc.GenericHolder() -@@ -1567,13 +1759,24 @@ class YumBase(depsolve.Depsolve): +@@ -1567,13 +1761,24 @@ class YumBase(depsolve.Depsolve): self.plugins.run('posttrans') # sync up what just happened versus what is in the rpmdb if not self.ts.isTsFlagSet(rpm.RPMTRANS_FLAG_TEST): @@ -151975,7 +152055,7 @@ index 99039e0..1108443 100644 # check to see that the rpmdb and the tsInfo roughly matches # push package object metadata outside of rpmdb into yumdb # delete old yumdb metadata entries -@@ -1584,9 +1787,16 @@ class YumBase(depsolve.Depsolve): +@@ -1584,9 +1789,16 @@ class YumBase(depsolve.Depsolve): # that there is not also an install of this pkg in the tsInfo (reinstall) # for any kind of install add from_repo to the yumdb, and the cmdline # and the install reason @@ -151992,7 +152072,7 @@ index 99039e0..1108443 100644 for txmbr in self.tsInfo: if txmbr.output_state in TS_INSTALL_STATES: if not self.rpmdb.contains(po=txmbr.po): -@@ -1596,7 +1806,9 @@ class YumBase(depsolve.Depsolve): +@@ -1596,7 +1808,9 @@ class YumBase(depsolve.Depsolve): ' but is not!' % txmbr.po)) # Note: Get Panu to do te.Failed() so we don't have to txmbr.output_state = TS_FAILED @@ -152002,7 +152082,7 @@ index 99039e0..1108443 100644 po = self.getInstalledPackageObject(txmbr.pkgtup) rpo = txmbr.po po.yumdb_info.from_repo = rpo.repoid -@@ -1630,6 +1842,10 @@ class YumBase(depsolve.Depsolve): +@@ -1630,6 +1844,10 @@ class YumBase(depsolve.Depsolve): if md: po.yumdb_info.from_repo_timestamp = str(md.timestamp) @@ -152013,7 +152093,7 @@ index 99039e0..1108443 100644 loginuid = misc.getloginuid() if txmbr.updates or txmbr.downgrades or txmbr.reinstall: if txmbr.updates: -@@ -1640,11 +1856,16 @@ class YumBase(depsolve.Depsolve): +@@ -1640,11 +1858,16 @@ class YumBase(depsolve.Depsolve): opo = po if 'installed_by' in opo.yumdb_info: po.yumdb_info.installed_by = opo.yumdb_info.installed_by @@ -152030,7 +152110,7 @@ index 99039e0..1108443 100644 # Remove old ones after installing new ones, so we can copy values. for txmbr in self.tsInfo: if txmbr.output_state in TS_INSTALL_STATES: -@@ -1662,10 +1883,13 @@ class YumBase(depsolve.Depsolve): +@@ -1662,10 +1885,13 @@ class YumBase(depsolve.Depsolve): ' but is not!' % txmbr.po)) # Note: Get Panu to do te.Failed() so we don't have to txmbr.output_state = TS_FAILED @@ -152044,7 +152124,7 @@ index 99039e0..1108443 100644 self.verbose_logger.log(logginglevels.DEBUG_2, 'What is this? %s' % txmbr.po) self.plugins.run('postverifytrans') -@@ -1680,10 +1904,11 @@ class YumBase(depsolve.Depsolve): +@@ -1680,10 +1906,11 @@ class YumBase(depsolve.Depsolve): self.verbose_logger.debug('VerifyTransaction time: %0.3f' % (time.time() - vt_st)) def costExcludePackages(self): @@ -152060,7 +152140,7 @@ index 99039e0..1108443 100644 # if all the repo.costs are equal then don't bother running things costs = {} for r in self.repos.listEnabled(): -@@ -1705,10 +1930,12 @@ class YumBase(depsolve.Depsolve): +@@ -1705,10 +1932,12 @@ class YumBase(depsolve.Depsolve): done = True def excludePackages(self, repo=None): @@ -152076,7 +152156,7 @@ index 99039e0..1108443 100644 if "all" in self.conf.disable_excludes: return -@@ -1735,9 +1962,11 @@ class YumBase(depsolve.Depsolve): +@@ -1735,9 +1964,11 @@ class YumBase(depsolve.Depsolve): self.pkgSack.addPackageExcluder(repoid, exid,'exclude.match', match) def includePackages(self, repo): @@ -152091,7 +152171,7 @@ index 99039e0..1108443 100644 includelist = repo.getIncludePkgList() if len(includelist) == 0: -@@ -1757,8 +1986,11 @@ class YumBase(depsolve.Depsolve): +@@ -1757,8 +1988,11 @@ class YumBase(depsolve.Depsolve): self.pkgSack.addPackageExcluder(repo.id, exid, 'exclude.marked') def doLock(self, lockfile = YUM_PID_FILE): @@ -152105,7 +152185,7 @@ index 99039e0..1108443 100644 if self.conf.uid != 0: # If we are a user, assume we are using the root cache ... so don't # bother locking. -@@ -1774,38 +2006,26 @@ class YumBase(depsolve.Depsolve): +@@ -1774,38 +2008,26 @@ class YumBase(depsolve.Depsolve): mypid=str(os.getpid()) while not self._lock(lockfile, mypid, 0644): @@ -152159,7 +152239,7 @@ index 99039e0..1108443 100644 # if we're not root then we don't lock - just return nicely # Note that we can get here from __del__, so if we haven't created # YumBase.conf we don't want to do so here as creating stuff inside -@@ -1830,31 +2050,69 @@ class YumBase(depsolve.Depsolve): +@@ -1830,31 +2052,69 @@ class YumBase(depsolve.Depsolve): self._unlock(lockfile) self._lockfile = None @@ -152239,7 +152319,7 @@ index 99039e0..1108443 100644 failed = False if type(fo) is types.InstanceType: -@@ -1894,9 +2152,16 @@ class YumBase(depsolve.Depsolve): +@@ -1894,9 +2154,16 @@ class YumBase(depsolve.Depsolve): def verifyChecksum(self, fo, checksumType, csum): @@ -152259,7 +152339,7 @@ index 99039e0..1108443 100644 try: filesum = misc.checksum(checksumType, fo) except Errors.MiscError, e: -@@ -1908,6 +2173,17 @@ class YumBase(depsolve.Depsolve): +@@ -1908,6 +2175,17 @@ class YumBase(depsolve.Depsolve): return 0 def downloadPkgs(self, pkglist, callback=None, callback_total=None): @@ -152277,7 +152357,7 @@ index 99039e0..1108443 100644 def mediasort(apo, bpo): # FIXME: we should probably also use the mediaid; else we # could conceivably ping-pong between different disc1's -@@ -1979,8 +2255,9 @@ class YumBase(depsolve.Depsolve): +@@ -1979,8 +2257,9 @@ class YumBase(depsolve.Depsolve): urlgrabber.progress.text_meter_total_size(remote_size) beg_download = time.time() i = 0 @@ -152288,7 +152368,7 @@ index 99039e0..1108443 100644 for po in remote_pkgs: # Recheck if the file is there, works around a couple of weird # edge cases. -@@ -1992,52 +2269,47 @@ class YumBase(depsolve.Depsolve): +@@ -1992,52 +2271,47 @@ class YumBase(depsolve.Depsolve): remote_size -= po.size if hasattr(urlgrabber.progress, 'text_meter_total_size'): urlgrabber.progress.text_meter_total_size(remote_size, @@ -152367,7 +152447,7 @@ index 99039e0..1108443 100644 if hasattr(urlgrabber.progress, 'text_meter_total_size'): urlgrabber.progress.text_meter_total_size(0) if callback_total is not None and not errors: -@@ -2052,7 +2324,22 @@ class YumBase(depsolve.Depsolve): +@@ -2052,7 +2326,22 @@ class YumBase(depsolve.Depsolve): return errors def verifyHeader(self, fo, po, raiseError): @@ -152391,7 +152471,7 @@ index 99039e0..1108443 100644 if type(fo) is types.InstanceType: fo = fo.filename -@@ -2076,9 +2363,12 @@ class YumBase(depsolve.Depsolve): +@@ -2076,9 +2365,12 @@ class YumBase(depsolve.Depsolve): return 1 def downloadHeader(self, po): @@ -152406,7 +152486,7 @@ index 99039e0..1108443 100644 if hasattr(po, 'pkgtype') and po.pkgtype == 'local': return -@@ -2122,15 +2412,17 @@ class YumBase(depsolve.Depsolve): +@@ -2122,15 +2414,17 @@ class YumBase(depsolve.Depsolve): return def sigCheckPkg(self, po): @@ -152432,7 +152512,7 @@ index 99039e0..1108443 100644 if self._override_sigchecks: check = False hasgpgkey = 0 -@@ -2181,6 +2473,9 @@ class YumBase(depsolve.Depsolve): +@@ -2181,6 +2475,9 @@ class YumBase(depsolve.Depsolve): return result, msg def cleanUsedHeadersPackages(self): @@ -152442,7 +152522,7 @@ index 99039e0..1108443 100644 filelist = [] for txmbr in self.tsInfo: if txmbr.po.state not in TS_INSTALL_STATES: -@@ -2218,27 +2513,42 @@ class YumBase(depsolve.Depsolve): +@@ -2218,27 +2515,42 @@ class YumBase(depsolve.Depsolve): _('%s removed'), fn) def cleanHeaders(self): @@ -152487,7 +152567,7 @@ index 99039e0..1108443 100644 cachedir = self.conf.persistdir + "/rpmdb-indexes/" if not os.path.exists(cachedir): filelist = [] -@@ -2272,8 +2582,29 @@ class YumBase(depsolve.Depsolve): +@@ -2272,8 +2584,29 @@ class YumBase(depsolve.Depsolve): def doPackageLists(self, pkgnarrow='all', patterns=None, showdups=None, ignore_case=False): @@ -152519,7 +152599,7 @@ index 99039e0..1108443 100644 if showdups is None: showdups = self.conf.showdupesfromrepos ygh = misc.GenericHolder(iter=pkgnarrow) -@@ -2323,10 +2654,22 @@ class YumBase(depsolve.Depsolve): +@@ -2323,10 +2656,22 @@ class YumBase(depsolve.Depsolve): key = (pkg.name, pkg.arch) if pkg.pkgtup in dinst: reinstall_available.append(pkg) @@ -152545,7 +152625,7 @@ index 99039e0..1108443 100644 # produce the updates list of tuples elif pkgnarrow == 'updates': -@@ -2461,14 +2804,13 @@ class YumBase(depsolve.Depsolve): +@@ -2461,14 +2806,13 @@ class YumBase(depsolve.Depsolve): def findDeps(self, pkgs): @@ -152565,7 +152645,7 @@ index 99039e0..1108443 100644 results = {} for pkg in pkgs: -@@ -2495,10 +2837,22 @@ class YumBase(depsolve.Depsolve): +@@ -2495,10 +2839,22 @@ class YumBase(depsolve.Depsolve): # pre 3.2.10 API used to always showdups, so that's the default atm. def searchGenerator(self, fields, criteria, showdups=True, keys=False, searchtags=True, searchrpmdb=True): @@ -152592,7 +152672,7 @@ index 99039e0..1108443 100644 sql_fields = [] for f in fields: sql_fields.append(RPM_TO_SQLITE.get(f, f)) -@@ -2661,6 +3015,14 @@ class YumBase(depsolve.Depsolve): +@@ -2661,6 +3017,14 @@ class YumBase(depsolve.Depsolve): yield (po, vs) def searchPackageTags(self, criteria): @@ -152607,7 +152687,7 @@ index 99039e0..1108443 100644 results = {} # name = [(criteria, taglist)] for c in criteria: c = c.lower() -@@ -2677,11 +3039,16 @@ class YumBase(depsolve.Depsolve): +@@ -2677,11 +3041,16 @@ class YumBase(depsolve.Depsolve): return results def searchPackages(self, fields, criteria, callback=None): @@ -152629,7 +152709,7 @@ index 99039e0..1108443 100644 warnings.warn(_('searchPackages() will go away in a future version of Yum.\ Use searchGenerator() instead. \n'), Errors.YumFutureDeprecationWarning, stacklevel=2) -@@ -2700,13 +3067,23 @@ class YumBase(depsolve.Depsolve): +@@ -2700,13 +3069,23 @@ class YumBase(depsolve.Depsolve): def searchPackageProvides(self, args, callback=None, callback_has_matchfor=False): @@ -152657,7 +152737,7 @@ index 99039e0..1108443 100644 else: isglob = True canBeFile = misc.re_filename(arg) -@@ -2723,7 +3100,7 @@ class YumBase(depsolve.Depsolve): +@@ -2723,7 +3102,7 @@ class YumBase(depsolve.Depsolve): where = self.returnPackagesByDep(arg) else: usedDepString = False @@ -152666,7 +152746,7 @@ index 99039e0..1108443 100644 self.verbose_logger.log(logginglevels.DEBUG_1, P_('Searching %d package', 'Searching %d packages', len(where)), len(where)) -@@ -2817,25 +3194,160 @@ class YumBase(depsolve.Depsolve): +@@ -2817,25 +3196,160 @@ class YumBase(depsolve.Depsolve): return matches @@ -152839,7 +152919,7 @@ index 99039e0..1108443 100644 if uservisible: if grp.user_visible: installed.append(grp) -@@ -2847,34 +3359,98 @@ class YumBase(depsolve.Depsolve): +@@ -2847,34 +3361,98 @@ class YumBase(depsolve.Depsolve): available.append(grp) else: available.append(grp) @@ -152948,7 +153028,7 @@ index 99039e0..1108443 100644 thesegroups = self.comps.return_groups(grpid) if not thesegroups: raise Errors.GroupsError, _("No Group named %s exists") % to_unicode(grpid) -@@ -2898,13 +3474,58 @@ class YumBase(depsolve.Depsolve): +@@ -2898,13 +3476,58 @@ class YumBase(depsolve.Depsolve): self.tsInfo.remove(txmbr.po.pkgtup) @@ -153014,7 +153094,7 @@ index 99039e0..1108443 100644 """ if not self.comps.has_group(grpid): -@@ -2920,6 +3541,9 @@ class YumBase(depsolve.Depsolve): +@@ -2920,6 +3543,9 @@ class YumBase(depsolve.Depsolve): if group_package_types: package_types = group_package_types @@ -153024,7 +153104,7 @@ index 99039e0..1108443 100644 for thisgroup in thesegroups: if thisgroup.selected: continue -@@ -2934,12 +3558,49 @@ class YumBase(depsolve.Depsolve): +@@ -2934,12 +3560,49 @@ class YumBase(depsolve.Depsolve): if 'optional' in package_types: pkgs.extend(thisgroup.optional_packages) @@ -153075,7 +153155,7 @@ index 99039e0..1108443 100644 except Errors.InstallError, e: self.verbose_logger.debug(_('No package named %s available to be installed'), pkg) -@@ -2953,7 +3614,9 @@ class YumBase(depsolve.Depsolve): +@@ -2953,7 +3616,9 @@ class YumBase(depsolve.Depsolve): group_conditionals = enable_group_conditionals count_cond_test = 0 @@ -153086,7 +153166,7 @@ index 99039e0..1108443 100644 for condreq, cond in thisgroup.conditional_packages.iteritems(): if self.isPackageInstalled(cond): try: -@@ -2990,17 +3653,22 @@ class YumBase(depsolve.Depsolve): +@@ -2990,17 +3655,22 @@ class YumBase(depsolve.Depsolve): if cond not in self.tsInfo.conditionals: self.tsInfo.conditionals[cond] = [] self.tsInfo.conditionals[cond].extend(pkgs) @@ -153115,7 +153195,7 @@ index 99039e0..1108443 100644 if not self.comps.has_group(grpid): raise Errors.GroupsError, _("No Group named %s exists") % to_unicode(grpid) -@@ -3008,7 +3676,8 @@ class YumBase(depsolve.Depsolve): +@@ -3008,7 +3678,8 @@ class YumBase(depsolve.Depsolve): thesegroups = self.comps.return_groups(grpid) if not thesegroups: raise Errors.GroupsError, _("No Group named %s exists") % to_unicode(grpid) @@ -153125,7 +153205,7 @@ index 99039e0..1108443 100644 for thisgroup in thesegroups: thisgroup.selected = False -@@ -3034,13 +3703,102 @@ class YumBase(depsolve.Depsolve): +@@ -3034,13 +3705,102 @@ class YumBase(depsolve.Depsolve): for pkg in self.tsInfo.conditionals.get(txmbr.name, []): self.tsInfo.remove(pkg.pkgtup) @@ -153234,7 +153314,7 @@ index 99039e0..1108443 100644 # look it up in the self.localPackages first: for po in self.localPackages: if po.pkgtup == pkgtup: -@@ -3049,7 +3807,7 @@ class YumBase(depsolve.Depsolve): +@@ -3049,7 +3809,7 @@ class YumBase(depsolve.Depsolve): pkgs = self.pkgSack.searchPkgTuple(pkgtup) if len(pkgs) == 0: @@ -153243,7 +153323,7 @@ index 99039e0..1108443 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 +3823,21 @@ class YumBase(depsolve.Depsolve): +@@ -3065,13 +3825,21 @@ class YumBase(depsolve.Depsolve): return result def getInstalledPackageObject(self, pkgtup): @@ -153270,7 +153350,7 @@ index 99039e0..1108443 100644 raise Errors.RpmDBError, _('Package tuple %s could not be found in rpmdb') % str(pkgtup) # Dito. FIXME from getPackageObject() for len() > 1 ... :) -@@ -3079,9 +3845,11 @@ class YumBase(depsolve.Depsolve): +@@ -3079,9 +3847,11 @@ class YumBase(depsolve.Depsolve): return po def gpgKeyCheck(self): @@ -153284,7 +153364,7 @@ index 99039e0..1108443 100644 gpgkeyschecked = self.conf.cachedir + '/.gpgkeyschecked.yum' if os.path.exists(gpgkeyschecked): return 1 -@@ -3106,9 +3874,13 @@ class YumBase(depsolve.Depsolve): +@@ -3106,9 +3876,13 @@ class YumBase(depsolve.Depsolve): return 1 def returnPackagesByDep(self, depstring): @@ -153300,7 +153380,7 @@ index 99039e0..1108443 100644 if not depstring: return [] -@@ -3135,9 +3907,16 @@ class YumBase(depsolve.Depsolve): +@@ -3135,9 +3909,16 @@ class YumBase(depsolve.Depsolve): return self.pkgSack.getProvides(depname, depflags, depver).keys() def returnPackageByDep(self, depstring): @@ -153320,7 +153400,7 @@ index 99039e0..1108443 100644 # we get all sorts of randomness here errstring = depstring if type(depstring) not in types.StringTypes: -@@ -3149,16 +3928,22 @@ class YumBase(depsolve.Depsolve): +@@ -3149,16 +3930,22 @@ class YumBase(depsolve.Depsolve): raise Errors.YumBaseError, _('No Package found for %s') % errstring ps = ListPackageSack(pkglist) @@ -153347,7 +153427,7 @@ index 99039e0..1108443 100644 if not depstring: return [] -@@ -3184,12 +3969,47 @@ class YumBase(depsolve.Depsolve): +@@ -3184,12 +3971,47 @@ class YumBase(depsolve.Depsolve): return self.rpmdb.getProvides(depname, depflags, depver).keys() @@ -153397,7 +153477,7 @@ index 99039e0..1108443 100644 if len(pkglist) == 0: -@@ -3198,14 +4018,23 @@ class YumBase(depsolve.Depsolve): +@@ -3198,14 +4020,23 @@ class YumBase(depsolve.Depsolve): if len(pkglist) == 1: return pkglist[0] @@ -153427,7 +153507,7 @@ index 99039e0..1108443 100644 returnlist = [] compatArchList = self.arch.get_arch_list(arch) multiLib = [] -@@ -3222,9 +4051,9 @@ class YumBase(depsolve.Depsolve): +@@ -3222,9 +4053,9 @@ class YumBase(depsolve.Depsolve): singleLib.append(po) # we now have three lists. find the best package(s) of each @@ -153440,7 +153520,7 @@ index 99039e0..1108443 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 +4067,7 @@ class YumBase(depsolve.Depsolve): +@@ -3238,7 +4069,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: @@ -153449,7 +153529,7 @@ index 99039e0..1108443 100644 if best.arch == "noarch": returnlist.append(no) else: -@@ -3246,7 +4075,7 @@ class YumBase(depsolve.Depsolve): +@@ -3246,7 +4077,7 @@ class YumBase(depsolve.Depsolve): if single: returnlist.append(single) # similar for the non-multilib case elif single: @@ -153458,7 +153538,7 @@ index 99039e0..1108443 100644 if best.arch == "noarch": returnlist.append(no) else: -@@ -3350,28 +4179,58 @@ class YumBase(depsolve.Depsolve): +@@ -3350,28 +4181,58 @@ class YumBase(depsolve.Depsolve): done = True slow = next_func(slow) @@ -153522,7 +153602,7 @@ index 99039e0..1108443 100644 try: txmbrs = self.groupRemove(group_string) except yum.Errors.GroupsError: -@@ -3387,6 +4246,8 @@ class YumBase(depsolve.Depsolve): +@@ -3387,6 +4248,8 @@ class YumBase(depsolve.Depsolve): assert pattern[0] == '@' grpid = pattern[1:] @@ -153531,7 +153611,7 @@ index 99039e0..1108443 100644 thesegroups = self.comps.return_groups(grpid) if not thesegroups: raise Errors.GroupsError, _("No Group named %s exists") % to_unicode(grpid) -@@ -3398,7 +4259,11 @@ class YumBase(depsolve.Depsolve): +@@ -3398,7 +4261,11 @@ class YumBase(depsolve.Depsolve): def _minus_deselect(self, pattern): """ Remove things from the transaction, like kickstart. """ assert pattern[0] == '-' @@ -153544,7 +153624,7 @@ index 99039e0..1108443 100644 if pat and pat[0] == '@': pat = pat[1:] -@@ -3437,14 +4302,61 @@ class YumBase(depsolve.Depsolve): +@@ -3437,14 +4304,61 @@ class YumBase(depsolve.Depsolve): if flag not in self.tsInfo.probFilterFlags: self.tsInfo.probFilterFlags.append(flag) @@ -153612,7 +153692,7 @@ index 99039e0..1108443 100644 pkgs = [] was_pattern = False if po: -@@ -3477,20 +4389,12 @@ class YumBase(depsolve.Depsolve): +@@ -3477,20 +4391,12 @@ class YumBase(depsolve.Depsolve): self.verbose_logger.debug(_('Checking for virtual provide or file-provide for %s'), arg) @@ -153639,7 +153719,7 @@ index 99039e0..1108443 100644 else: nevra_dict = self._nevra_kwarg_parse(kwargs) -@@ -3577,8 +4481,8 @@ class YumBase(depsolve.Depsolve): +@@ -3577,8 +4483,8 @@ class YumBase(depsolve.Depsolve): continue # make sure this shouldn't be passed to update: @@ -153650,7 +153730,7 @@ index 99039e0..1108443 100644 txmbrs = self.update(po=po) tx_return.extend(txmbrs) continue -@@ -3587,7 +4491,7 @@ class YumBase(depsolve.Depsolve): +@@ -3587,7 +4493,7 @@ class YumBase(depsolve.Depsolve): # something else in the repo. Unless there is a obsoletion loop, # at which point ignore everything. obsoleting_pkg = None @@ -153659,7 +153739,7 @@ index 99039e0..1108443 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 +4504,23 @@ class YumBase(depsolve.Depsolve): +@@ -3600,23 +4506,23 @@ class YumBase(depsolve.Depsolve): already_obs = pkgs[0] if already_obs: @@ -153690,7 +153770,7 @@ index 99039e0..1108443 100644 continue # make sure we don't have a name.arch of this already installed -@@ -3630,7 +4534,7 @@ class YumBase(depsolve.Depsolve): +@@ -3630,7 +4536,7 @@ class YumBase(depsolve.Depsolve): found = True break if not found: @@ -153699,7 +153779,7 @@ index 99039e0..1108443 100644 txmbrs = self.update(po=po) tx_return.extend(txmbrs) continue -@@ -3719,19 +4623,47 @@ class YumBase(depsolve.Depsolve): +@@ -3719,19 +4625,47 @@ class YumBase(depsolve.Depsolve): return txmbr def update(self, po=None, requiringPo=None, update_to=False, **kwargs): @@ -153754,7 +153834,7 @@ index 99039e0..1108443 100644 tx_return = [] if not po and not kwargs: # update everything (the easy case) self.verbose_logger.log(logginglevels.DEBUG_2, _('Updating Everything')) -@@ -3765,7 +4697,14 @@ class YumBase(depsolve.Depsolve): +@@ -3765,7 +4699,14 @@ class YumBase(depsolve.Depsolve): if new is None: continue tx_return.extend(self.update(po=new)) @@ -153770,7 +153850,7 @@ index 99039e0..1108443 100644 return tx_return # complications -@@ -3787,7 +4726,7 @@ class YumBase(depsolve.Depsolve): +@@ -3787,7 +4728,7 @@ class YumBase(depsolve.Depsolve): return self._minus_deselect(kwargs['pattern']) if kwargs['pattern'] and kwargs['pattern'][0] == '@': @@ -153779,7 +153859,7 @@ index 99039e0..1108443 100644 arg = kwargs['pattern'] if not update_to: -@@ -3843,7 +4782,7 @@ class YumBase(depsolve.Depsolve): +@@ -3843,7 +4784,7 @@ class YumBase(depsolve.Depsolve): availpkgs = self._compare_providers(availpkgs, requiringPo) availpkgs = map(lambda x: x[0], availpkgs) elif not availpkgs: @@ -153788,7 +153868,7 @@ index 99039e0..1108443 100644 # for any thing specified # get the list of available pkgs matching it (or take the po) -@@ -3920,6 +4859,18 @@ class YumBase(depsolve.Depsolve): +@@ -3920,6 +4861,18 @@ class YumBase(depsolve.Depsolve): tx_return.append(txmbr) for available_pkg in availpkgs: @@ -153807,7 +153887,7 @@ index 99039e0..1108443 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 +4936,18 @@ class YumBase(depsolve.Depsolve): +@@ -3985,11 +4938,18 @@ class YumBase(depsolve.Depsolve): return tx_return def remove(self, po=None, **kwargs): @@ -153831,7 +153911,7 @@ index 99039e0..1108443 100644 if not po and not kwargs: raise Errors.RemoveError, 'Nothing specified to remove' -@@ -4055,17 +5013,19 @@ class YumBase(depsolve.Depsolve): +@@ -4055,17 +5015,19 @@ class YumBase(depsolve.Depsolve): return tx_return def installLocal(self, pkg, po=None, updateonly=False): @@ -153861,7 +153941,7 @@ index 99039e0..1108443 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 +5143,15 @@ class YumBase(depsolve.Depsolve): +@@ -4183,16 +5145,15 @@ class YumBase(depsolve.Depsolve): return tx_return def reinstallLocal(self, pkg, po=None): @@ -153886,7 +153966,7 @@ index 99039e0..1108443 100644 if not po: try: po = YumUrlPackage(self, ts=self.rpmdb.readOnlyTS(), url=pkg, -@@ -4215,9 +5174,19 @@ class YumBase(depsolve.Depsolve): +@@ -4215,9 +5176,19 @@ class YumBase(depsolve.Depsolve): return self.reinstall(po=po) def reinstall(self, po=None, **kwargs): @@ -153909,7 +153989,7 @@ index 99039e0..1108443 100644 self._add_prob_flags(rpm.RPMPROB_FILTER_REPLACEPKG, rpm.RPMPROB_FILTER_REPLACENEWFILES, rpm.RPMPROB_FILTER_REPLACEOLDFILES) -@@ -4259,16 +5228,15 @@ class YumBase(depsolve.Depsolve): +@@ -4259,16 +5230,15 @@ class YumBase(depsolve.Depsolve): return tx_mbrs def downgradeLocal(self, pkg, po=None): @@ -153934,7 +154014,7 @@ index 99039e0..1108443 100644 if not po: try: po = YumUrlPackage(self, ts=self.rpmdb.readOnlyTS(), url=pkg, -@@ -4309,13 +5277,19 @@ class YumBase(depsolve.Depsolve): +@@ -4309,13 +5279,19 @@ class YumBase(depsolve.Depsolve): return False def downgrade(self, po=None, **kwargs): @@ -153961,7 +154041,7 @@ index 99039e0..1108443 100644 if not po and not kwargs: raise Errors.DowngradeError, 'Nothing specified to downgrade' -@@ -4421,6 +5395,9 @@ class YumBase(depsolve.Depsolve): +@@ -4421,6 +5397,9 @@ class YumBase(depsolve.Depsolve): warned_nas.add(na) continue @@ -153971,7 +154051,7 @@ index 99039e0..1108443 100644 if pkg.verGE(lipkg): if na not in warned_nas: msg = _('Only Upgrade available on package: %s') % pkg -@@ -4457,7 +5434,7 @@ class YumBase(depsolve.Depsolve): +@@ -4457,7 +5436,7 @@ class YumBase(depsolve.Depsolve): if e and v and r: evr = '%s:%s-%s' % (e, v, r) elif v and r: @@ -153980,7 +154060,7 @@ index 99039e0..1108443 100644 elif e and v: evr = '%s:%s' % (e, v) elif v: # e and r etc. is just too weird to print -@@ -4500,12 +5477,24 @@ class YumBase(depsolve.Depsolve): +@@ -4500,12 +5479,24 @@ class YumBase(depsolve.Depsolve): return returndict @@ -154008,7 +154088,7 @@ index 99039e0..1108443 100644 old_conf_obs = self.conf.obsoletes self.conf.obsoletes = False done = False -@@ -4515,19 +5504,46 @@ class YumBase(depsolve.Depsolve): +@@ -4515,19 +5506,46 @@ class YumBase(depsolve.Depsolve): done = True for pkg in transaction.trans_data: if pkg.state == 'Downgrade': @@ -154055,7 +154135,7 @@ index 99039e0..1108443 100644 if self.install(pkgtup=pkg.pkgtup): done = True for pkg in transaction.trans_data: -@@ -4538,8 +5554,14 @@ class YumBase(depsolve.Depsolve): +@@ -4538,8 +5556,14 @@ class YumBase(depsolve.Depsolve): return done def history_undo(self, transaction): @@ -154072,7 +154152,7 @@ index 99039e0..1108443 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 +5638,7 @@ class YumBase(depsolve.Depsolve): +@@ -4616,7 +5640,7 @@ class YumBase(depsolve.Depsolve): except urlgrabber.grabber.URLGrabError, e: raise Errors.YumBaseError(_('GPG key retrieval failed: ') + @@ -154081,7 +154161,7 @@ index 99039e0..1108443 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 +5671,7 @@ class YumBase(depsolve.Depsolve): +@@ -4649,7 +5673,7 @@ class YumBase(depsolve.Depsolve): keys_info = misc.getgpgkeyinfo(rawkey, multiple=True) except ValueError, e: raise Errors.YumBaseError(_('Invalid GPG Key from %s: %s') % @@ -154090,7 +154170,7 @@ index 99039e0..1108443 100644 keys = [] for keyinfo in keys_info: thiskey = {} -@@ -4674,39 +5696,49 @@ class YumBase(depsolve.Depsolve): +@@ -4674,39 +5698,49 @@ class YumBase(depsolve.Depsolve): if pkgs: pkgs = sorted(pkgs)[-1] msg = (_('Importing %s key 0x%s:\n' @@ -154158,7 +154238,7 @@ index 99039e0..1108443 100644 user_cb_fail = False for keyurl in keyurls: keys = self._retrievePublicKey(keyurl, repo) -@@ -4725,7 +5757,9 @@ class YumBase(depsolve.Depsolve): +@@ -4725,7 +5759,9 @@ class YumBase(depsolve.Depsolve): # Try installing/updating GPG key self._getKeyImportMessage(info, keyurl) rc = False @@ -154169,7 +154249,7 @@ index 99039e0..1108443 100644 rc = True # grab the .sig/.asc for the keyurl, if it exists -@@ -4751,8 +5785,8 @@ class YumBase(depsolve.Depsolve): +@@ -4751,8 +5787,8 @@ class YumBase(depsolve.Depsolve): ts = self.rpmdb.readOnlyTS() result = ts.pgpImportPubkey(misc.procgpgkey(info['raw_key'])) if result != 0: @@ -154180,7 +154260,7 @@ index 99039e0..1108443 100644 self.logger.info(_('Key imported successfully')) key_installed = True -@@ -4760,18 +5794,20 @@ class YumBase(depsolve.Depsolve): +@@ -4760,18 +5796,20 @@ class YumBase(depsolve.Depsolve): raise Errors.YumBaseError, _("Didn't install any keys") if not key_installed: @@ -154206,7 +154286,7 @@ index 99039e0..1108443 100644 def _getAnyKeyForRepo(self, repo, destdir, keyurl_list, is_cakey=False, callback=None): """ -@@ -4788,6 +5824,18 @@ class YumBase(depsolve.Depsolve): +@@ -4788,6 +5826,18 @@ class YumBase(depsolve.Depsolve): """ key_installed = False @@ -154225,7 +154305,7 @@ index 99039e0..1108443 100644 user_cb_fail = False for keyurl in keyurl_list: keys = self._retrievePublicKey(keyurl, repo, getSig=not is_cakey) -@@ -4819,8 +5867,11 @@ class YumBase(depsolve.Depsolve): +@@ -4819,8 +5869,11 @@ class YumBase(depsolve.Depsolve): if not key_installed: self._getKeyImportMessage(info, keyurl, keytype) rc = False @@ -154238,7 +154318,7 @@ index 99039e0..1108443 100644 elif callback: rc = callback({"repo": repo, "userid": info['userid'], "hexkeyid": info['hexkeyid'], "keyurl": keyurl, -@@ -4835,7 +5886,8 @@ class YumBase(depsolve.Depsolve): +@@ -4835,7 +5888,8 @@ class YumBase(depsolve.Depsolve): # Import the key result = misc.import_key_to_pubring(info['raw_key'], info['hexkeyid'], gpgdir=destdir) if not result: @@ -154248,7 +154328,7 @@ index 99039e0..1108443 100644 self.logger.info(_('Key imported successfully')) key_installed = True # write out the key id to imported_cakeys in the repos basedir -@@ -4851,36 +5903,35 @@ class YumBase(depsolve.Depsolve): +@@ -4851,36 +5905,35 @@ class YumBase(depsolve.Depsolve): pass if not key_installed and user_cb_fail: @@ -154301,7 +154381,7 @@ index 99039e0..1108443 100644 self._getAnyKeyForRepo(repo, repo.gpgcadir, repo.gpgcakey, is_cakey=True, callback=callback) def _limit_installonly_pkgs(self): -@@ -4927,6 +5978,7 @@ class YumBase(depsolve.Depsolve): +@@ -4927,6 +5980,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) @@ -154309,7 +154389,7 @@ index 99039e0..1108443 100644 for m in self.tsInfo.getMembers(): if m.ts_state not in ('i', 'u'): continue -@@ -4937,12 +5989,21 @@ class YumBase(depsolve.Depsolve): +@@ -4937,12 +5991,21 @@ class YumBase(depsolve.Depsolve): if not po_names.intersection(install_only_names): continue @@ -154335,7 +154415,7 @@ index 99039e0..1108443 100644 for po in installed: if (po.version, po.release) == (cur_kernel_v, cur_kernel_r): # don't remove running -@@ -4959,19 +6020,22 @@ class YumBase(depsolve.Depsolve): +@@ -4959,19 +6022,22 @@ class YumBase(depsolve.Depsolve): txmbr.depends_on.append(rel) def processTransaction(self, callback=None,rpmTestDisplay=None, rpmDisplay=None): @@ -154371,7 +154451,7 @@ index 99039e0..1108443 100644 if not callback: callback = callbacks.ProcessTransNoOutputCallback() -@@ -5114,13 +6178,19 @@ class YumBase(depsolve.Depsolve): +@@ -5114,13 +6180,19 @@ class YumBase(depsolve.Depsolve): return results def add_enable_repo(self, repoid, baseurls=[], mirrorlist=None, **kwargs): @@ -154398,7 +154478,7 @@ index 99039e0..1108443 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 +6237,15 @@ class YumBase(depsolve.Depsolve): +@@ -5167,9 +6239,15 @@ class YumBase(depsolve.Depsolve): def setCacheDir(self, force=False, tmpdir=None, reuse=True, suffix='/$basearch/$releasever'): @@ -154417,7 +154497,7 @@ index 99039e0..1108443 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 +6255,7 @@ class YumBase(depsolve.Depsolve): +@@ -5179,7 +6257,7 @@ class YumBase(depsolve.Depsolve): try: cachedir = misc.getCacheDir(tmpdir, reuse) except (IOError, OSError), e: @@ -154426,7 +154506,7 @@ index 99039e0..1108443 100644 cachedir = None if cachedir is None: -@@ -5190,6 +6266,7 @@ class YumBase(depsolve.Depsolve): +@@ -5190,6 +6268,7 @@ class YumBase(depsolve.Depsolve): self.prerepoconf.cachedir = cachedir else: self.repos.setCacheDir(cachedir) @@ -154434,7 +154514,7 @@ index 99039e0..1108443 100644 self.conf.cachedir = cachedir return True # We got a new cache dir -@@ -5220,13 +6297,24 @@ class YumBase(depsolve.Depsolve): +@@ -5220,13 +6299,24 @@ class YumBase(depsolve.Depsolve): self.history.write_addon_data('config-repos', myrepos) def verify_plugins_cb(self, verify_package): @@ -154462,7 +154542,7 @@ index 99039e0..1108443 100644 if self.tsInfo._unresolvedMembers: if auto: self.logger.critical(_("Dependencies not solved. Will not save unresolved transaction.")) -@@ -5234,7 +6322,7 @@ class YumBase(depsolve.Depsolve): +@@ -5234,7 +6324,7 @@ class YumBase(depsolve.Depsolve): raise Errors.YumBaseError(_("Dependencies not solved. Will not save unresolved transaction.")) if not filename: @@ -154471,7 +154551,7 @@ index 99039e0..1108443 100644 fd,filename = tempfile.mkstemp(suffix='.yumtx', prefix=prefix) f = os.fdopen(fd, 'w') else: -@@ -5244,13 +6332,17 @@ class YumBase(depsolve.Depsolve): +@@ -5244,13 +6334,17 @@ class YumBase(depsolve.Depsolve): msg = "%s\n" % self.rpmdb.simpleVersion(main_only=True)[0] msg += "%s\n" % self.ts.getTsFlags() @@ -154492,7 +154572,7 @@ index 99039e0..1108443 100644 msg += "%s\n" % len(self.tsInfo.getMembers()) for txmbr in self.tsInfo.getMembers(): msg += txmbr._dump() -@@ -5260,13 +6352,25 @@ class YumBase(depsolve.Depsolve): +@@ -5260,13 +6354,25 @@ class YumBase(depsolve.Depsolve): except (IOError, OSError), e: self._ts_save_file = None if auto: @@ -154524,7 +154604,7 @@ index 99039e0..1108443 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 +6380,45 @@ class YumBase(depsolve.Depsolve): +@@ -5276,26 +6382,45 @@ class YumBase(depsolve.Depsolve): try: data = open(filename, 'r').readlines() except (IOError, OSError), e: @@ -154572,7 +154652,7 @@ index 99039e0..1108443 100644 if ignorerpm: msg += _(" ignoring, as requested.") self.logger.critical(_(msg)) -@@ -5318,8 +6441,17 @@ class YumBase(depsolve.Depsolve): +@@ -5318,8 +6443,17 @@ class YumBase(depsolve.Depsolve): numrepos = int(data[2].strip()) repos = [] rindex=3+numrepos @@ -154591,7 +154671,7 @@ index 99039e0..1108443 100644 # pkgs/txmbrs numpkgs = int(data[rindex].strip()) -@@ -5329,6 +6461,7 @@ class YumBase(depsolve.Depsolve): +@@ -5329,6 +6463,7 @@ class YumBase(depsolve.Depsolve): pkgcount = 0 pkgprob = False curpkg = None @@ -154599,7 +154679,7 @@ index 99039e0..1108443 100644 for l in data[pkgstart:]: l = l.rstrip() # our main txmbrs -@@ -5438,6 +6571,11 @@ class YumBase(depsolve.Depsolve): +@@ -5438,6 +6573,11 @@ class YumBase(depsolve.Depsolve): msg += _(" aborting.") raise Errors.YumBaseError(msg) @@ -154611,7 +154691,7 @@ index 99039e0..1108443 100644 return self.tsInfo.getMembers() def _remove_old_deps(self): -@@ -5470,18 +6608,6 @@ class YumBase(depsolve.Depsolve): +@@ -5470,18 +6610,6 @@ class YumBase(depsolve.Depsolve): if requiring == required: # if they are self-requiring skip them continue @@ -154630,7 +154710,7 @@ index 99039e0..1108443 100644 #for tbi_pkg in self.tsInfo.getMembersWithState(output_states=TS_INSTALL_STATES): # for reqtuple in tbi_pkg.po.requires: # if required.provides_for(reqtuple): -@@ -5533,7 +6659,24 @@ class YumBase(depsolve.Depsolve): +@@ -5533,7 +6661,24 @@ class YumBase(depsolve.Depsolve): # Debugging output self.verbose_logger.log(logginglevels.DEBUG_2, _("%s has revdep %s which was user-installed."), pkg, curpkg) ok_to_remove[pkg] = False @@ -154655,7 +154735,7 @@ index 99039e0..1108443 100644 visited[curpkg] = True all_leaves_visited = True leaves = curpkg.requiring_packages() -@@ -5547,4 +6690,3 @@ class YumBase(depsolve.Depsolve): +@@ -5547,4 +6692,3 @@ class YumBase(depsolve.Depsolve): # Debugging output self.verbose_logger.log(logginglevels.DEBUG_2, _("%s has no user-installed revdeps."), pkg) return False @@ -155124,7 +155204,7 @@ index 65f6d5e..cf671b6 100755 print category.name for group in category.groups: diff --git a/yum/config.py b/yum/config.py -index d09511f..2bf4f45 100644 +index d09511f..d9e7fc7 100644 --- a/yum/config.py +++ b/yum/config.py @@ -45,15 +45,18 @@ from misc import get_uuid, read_in_items_from_dot_dir @@ -155132,7 +155212,7 @@ index d09511f..2bf4f45 100644 __pkgs_gpgcheck_default__ = False __repo_gpgcheck_default__ = False +__main_multilib_policy_default__ = 'all' -+__main_failovermethod_default__ = 'roundrobin' ++__main_failovermethod_default__ = 'priority' +__main_installonly_limit_default__ = 0 +__group_command_default__ = 'compat' @@ -158612,7 +158692,7 @@ index 31b1080..eb84123 100755 tags += """ \n""" msg += tags diff --git a/yum/repos.py b/yum/repos.py -index 3793bad..97fa71e 100644 +index 3793bad..0014880 100644 --- a/yum/repos.py +++ b/yum/repos.py @@ -22,6 +22,7 @@ import misc @@ -158623,7 +158703,7 @@ index 3793bad..97fa71e 100644 from weakref import proxy as weakref -@@ -67,6 +68,47 @@ class RepoStorage: +@@ -67,6 +68,44 @@ class RepoStorage: self._cache_enabled_repos = [] self.quick_enable_disable = {} @@ -158651,15 +158731,12 @@ index 3793bad..97fa71e 100644 + downloading = repo._commonRetrieveDataMD_list(mdtypes) + repos.append((repo, downloading, [False])) + -+ # with sizes first, then without sizes.. -+ for no_size in (False, True): -+ for repo, downloading, error in repos: -+ def failfunc(obj, error=error): -+ error[0] = True -+ for (ndata, nmdtype) in downloading: -+ if (ndata.size is None) == no_size: -+ repo._retrieveMD(nmdtype, async=True, failfunc=failfunc) -+ urlgrabber.grabber.parallel_wait() ++ for repo, downloading, error in repos: ++ def failfunc(obj, error=error): ++ error[0] = True ++ for (ndata, nmdtype) in downloading: ++ repo._retrieveMD(nmdtype, async=True, failfunc=failfunc) ++ urlgrabber.grabber.parallel_wait() + + # done or revert + for repo, downloading, error in repos: @@ -158671,7 +158748,7 @@ index 3793bad..97fa71e 100644 def doSetup(self, thisrepo = None): self.ayum.plugins.run('prereposetup') -@@ -89,6 +131,7 @@ class RepoStorage: +@@ -89,6 +128,7 @@ class RepoStorage: self.disableRepo(repo.id) self._setup = True @@ -158679,7 +158756,7 @@ index 3793bad..97fa71e 100644 self.ayum.plugins.run('postreposetup') def __str__(self): -@@ -223,8 +266,9 @@ class RepoStorage: +@@ -223,15 +263,16 @@ class RepoStorage: self._cachedir = cachedir for repo in self.repos.values(): @@ -158690,8 +158767,17 @@ index 3793bad..97fa71e 100644 + repo.basecachedir = cachedir - def setProgressBar(self, obj): -@@ -288,6 +332,16 @@ class RepoStorage: +- def setProgressBar(self, obj): ++ def setProgressBar(self, obj, multi_obj=None): + """sets the progress bar for downloading files from repos""" + + for repo in self.repos.values(): +- repo.setCallback(obj) ++ repo.setCallback(obj, multi_obj) + + def setFailureCallback(self, obj): + """sets the failure callback for all repos""" +@@ -288,6 +329,16 @@ class RepoStorage: else: data = [ mdtype ] @@ -159114,7 +159200,7 @@ index 2cb1acb..7da6a08 100644 self._md[item] = val diff --git a/yum/yumRepo.py b/yum/yumRepo.py -index e5e9ece..f831f23 100644 +index e5e9ece..e60fc20 100644 --- a/yum/yumRepo.py +++ b/yum/yumRepo.py @@ -20,10 +20,12 @@ import time @@ -159258,7 +159344,7 @@ index e5e9ece..f831f23 100644 if os.path.exists(db_un_fn): if skip_old_DBMD_check and repo._using_old_MD: return db_un_fn -@@ -260,7 +313,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -260,10 +313,11 @@ class YumRepository(Repository, config.RepoConf): self.copy_local = 0 # holder for stuff we've grabbed self.retrieved = { 'primary':0, 'filelists':0, 'other':0, 'group':0, @@ -159267,7 +159353,11 @@ index e5e9ece..f831f23 100644 # callbacks self.callback = None # for the grabber -@@ -285,6 +338,7 @@ class YumRepository(Repository, config.RepoConf): ++ self.multi_callback = None + self.failure_obj = None + self.mirror_failure_obj = None + self.interrupt_callback = None +@@ -285,6 +339,7 @@ class YumRepository(Repository, config.RepoConf): self._grabfunc = None self._grab = None @@ -159275,7 +159365,16 @@ index e5e9ece..f831f23 100644 def __cmp__(self, other): """ Sort yum repos. by cost, and then by alphanumeric on their id. """ -@@ -431,25 +485,18 @@ class YumRepository(Repository, config.RepoConf): +@@ -378,7 +433,7 @@ class YumRepository(Repository, config.RepoConf): + 'basecachedir', 'http_headers', 'metadata_cookie', + 'metadata_cookie_fn', 'quick_enable_disable', + 'repoMDFile', 'timestamp_check', 'urls', 'mirrorurls', +- 'yumvar', 'repofile') ++ 'yumvar', 'repofile', 'multi_callback') + for attr in dir(self): + if attr.startswith('_'): + continue +@@ -431,25 +486,18 @@ class YumRepository(Repository, config.RepoConf): self._proxy_dict = {} # zap it proxy_string = None empty = (None, '_none_', '') @@ -159309,7 +159408,13 @@ index e5e9ece..f831f23 100644 if proxy_string is not None: self._proxy_dict['http'] = proxy_string -@@ -488,8 +535,20 @@ class YumRepository(Repository, config.RepoConf): +@@ -483,13 +531,26 @@ class YumRepository(Repository, config.RepoConf): + + ugopts = self._default_grabopts() + self._grabfunc = URLGrabber(progress_obj=self.callback, ++ multi_progress_obj=self.multi_callback, + failure_callback=self.failure_obj, + interrupt_callback=self.interrupt_callback, copy_local=self.copy_local, reget='simple', **ugopts) @@ -159331,7 +159436,7 @@ index e5e9ece..f831f23 100644 failure_callback=self.mirror_failure_obj) def _default_grabopts(self, cache=True): -@@ -499,6 +558,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -499,6 +560,7 @@ class YumRepository(Repository, config.RepoConf): 'throttle': self.throttle, 'proxies': self.proxy_dict, 'timeout': self.timeout, @@ -159339,7 +159444,7 @@ index e5e9ece..f831f23 100644 'http_headers': tuple(self.__headersListFromDict(cache=cache)), 'ssl_verify_peer': self.sslverify, 'ssl_verify_host': self.sslverify, -@@ -714,7 +774,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -714,7 +776,7 @@ class YumRepository(Repository, config.RepoConf): local = self.metalink_filename + '.tmp' if not self._metalinkCurrent(): url = misc.to_utf8(self.metalink) @@ -159348,7 +159453,7 @@ index e5e9ece..f831f23 100644 try: ug = URLGrabber(progress_obj = self.callback, **ugopts) result = ug.urlgrab(url, local, text=self.id + "/metalink") -@@ -751,7 +811,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -751,7 +813,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', @@ -159357,7 +159462,7 @@ index e5e9ece..f831f23 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 +856,16 @@ class YumRepository(Repository, config.RepoConf): +@@ -796,6 +858,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,)) @@ -159374,7 +159479,19 @@ index e5e9ece..f831f23 100644 if url and scheme != "media": ugopts = self._default_grabopts(cache=cache) ug = URLGrabber(progress_obj = self.callback, -@@ -835,7 +905,8 @@ class YumRepository(Repository, config.RepoConf): +@@ -819,10 +891,7 @@ class YumRepository(Repository, config.RepoConf): + if self.mirrorurls: + errstr +="\n You could try running: yum clean expire-cache" + errstr +="\n To get a new set of mirrors." +- if e.errno == 256: +- raise Errors.NoMoreMirrorsRepoError, errstr +- else: +- raise Errors.RepoError, errstr ++ raise Errors.RepoError, errstr + + + else: +@@ -835,19 +904,18 @@ class YumRepository(Repository, config.RepoConf): reget = reget, checkfunc=checkfunc, http_headers=headers, @@ -159384,7 +159501,13 @@ index e5e9ece..f831f23 100644 ) except URLGrabError, e: errstr = "failure: %s from %s: %s" % (relative, self.id, e) -@@ -847,7 +918,7 @@ class YumRepository(Repository, config.RepoConf): +- if e.errno == 256: +- raise Errors.NoMoreMirrorsRepoError, errstr +- else: +- raise Errors.RepoError, errstr ++ errors = getattr(e, 'errors', None) ++ raise Errors.NoMoreMirrorsRepoError(errstr, errors) + return result __get = _getFile @@ -159393,7 +159516,7 @@ index e5e9ece..f831f23 100644 remote = package.relativepath local = package.localPkg() basepath = package.basepath -@@ -857,15 +928,26 @@ class YumRepository(Repository, config.RepoConf): +@@ -857,15 +925,26 @@ class YumRepository(Repository, config.RepoConf): return local misc.unlink_f(local) @@ -159421,7 +159544,7 @@ index e5e9ece..f831f23 100644 def getHeader(self, package, checkfunc = None, reget = 'simple', cache = True): -@@ -1020,7 +1102,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1020,7 +1099,7 @@ class YumRepository(Repository, config.RepoConf): if grab_can_fail: return None raise Errors.RepoError, 'Error downloading file %s: %s' % (local, e) @@ -159430,7 +159553,7 @@ index e5e9ece..f831f23 100644 misc.unlink_f(tfname) if grab_can_fail: return None -@@ -1260,6 +1342,9 @@ class YumRepository(Repository, config.RepoConf): +@@ -1260,6 +1339,9 @@ class YumRepository(Repository, config.RepoConf): return True def _check_db_version(self, mdtype, repoXML=None): @@ -159440,7 +159563,7 @@ index e5e9ece..f831f23 100644 if repoXML is None: repoXML = self.repoXML if mdtype in repoXML.repoData: -@@ -1277,11 +1362,11 @@ class YumRepository(Repository, config.RepoConf): +@@ -1277,11 +1359,11 @@ class YumRepository(Repository, config.RepoConf): return None if not file_check: @@ -159455,7 +159578,7 @@ index e5e9ece..f831f23 100644 if not os.path.exists(local): local = misc.decompress(local, fn_only=True) compressed = True -@@ -1302,6 +1387,17 @@ class YumRepository(Repository, config.RepoConf): +@@ -1302,6 +1384,17 @@ class YumRepository(Repository, config.RepoConf): into the delete list, this means metadata can change filename without us leaking it. """ @@ -159473,7 +159596,7 @@ index e5e9ece..f831f23 100644 def _mdtype_eq(omdtype, odata, nmdtype, ndata): """ Check if two returns from _get_mdtype_data() are equal. """ if ndata is None: -@@ -1321,6 +1417,14 @@ class YumRepository(Repository, config.RepoConf): +@@ -1321,6 +1414,14 @@ class YumRepository(Repository, config.RepoConf): return True all_mdtypes = self.retrieved.keys() @@ -159488,7 +159611,7 @@ index e5e9ece..f831f23 100644 if mdtypes is None: mdtypes = all_mdtypes -@@ -1333,8 +1437,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1333,8 +1434,7 @@ class YumRepository(Repository, config.RepoConf): # Inited twice atm. ... sue me self._oldRepoMDData['new_MD_files'] = [] @@ -159498,7 +159621,7 @@ index e5e9ece..f831f23 100644 for mdtype in all_mdtypes: (nmdtype, ndata) = self._get_mdtype_data(mdtype) -@@ -1371,43 +1474,16 @@ class YumRepository(Repository, config.RepoConf): +@@ -1371,43 +1471,16 @@ class YumRepository(Repository, config.RepoConf): # No old repomd data, but we might still have uncompressed MD if self._groupCheckDataMDValid(ndata, nmdtype, mdtype): continue @@ -159513,9 +159636,7 @@ index e5e9ece..f831f23 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... @@ -159532,7 +159653,9 @@ index e5e9ece..f831f23 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) @@ -159547,7 +159670,7 @@ index e5e9ece..f831f23 100644 def _groupLoadRepoXML(self, text=None, mdtypes=None): """ Retrieve the new repomd.xml from the repository, then check it -@@ -1421,7 +1497,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1421,7 +1494,7 @@ class YumRepository(Repository, config.RepoConf): self._commonRetrieveDataMD(mdtypes) def _mdpolicy2mdtypes(self): @@ -159556,7 +159679,7 @@ index e5e9ece..f831f23 100644 'group:primary' : ['primary'], 'group:small' : ["primary", "updateinfo"], 'group:main' : ["primary", "group", "filelists", -@@ -1436,6 +1512,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1436,6 +1509,7 @@ class YumRepository(Repository, config.RepoConf): if not mdtypes or 'group:all' in mdtypes: mdtypes = None else: @@ -159564,7 +159687,7 @@ index e5e9ece..f831f23 100644 mdtypes = sorted(list(mdtypes)) return mdtypes -@@ -1451,12 +1528,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1451,12 +1525,7 @@ class YumRepository(Repository, config.RepoConf): def _getRepoXML(self): if self._repoXML: return self._repoXML @@ -159578,7 +159701,7 @@ index e5e9ece..f831f23 100644 return self._repoXML -@@ -1514,7 +1586,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1514,7 +1583,7 @@ class YumRepository(Repository, config.RepoConf): return self._checkMD(fn, mdtype, openchecksum) def _checkMD(self, fn, mdtype, openchecksum=False, @@ -159587,7 +159710,7 @@ index e5e9ece..f831f23 100644 """ Internal function, use .checkMD() from outside yum. """ thisdata = data # So the argument name is nicer -@@ -1537,6 +1609,18 @@ class YumRepository(Repository, config.RepoConf): +@@ -1537,6 +1606,18 @@ class YumRepository(Repository, config.RepoConf): if size is not None: size = int(size) @@ -159606,7 +159729,7 @@ index e5e9ece..f831f23 100644 try: # get the local checksum l_csum = self._checksum(r_ctype, file, datasize=size) except Errors.RepoError, e: -@@ -1551,15 +1635,13 @@ class YumRepository(Repository, config.RepoConf): +@@ -1551,15 +1632,13 @@ class YumRepository(Repository, config.RepoConf): return None raise URLGrabError(-1, 'Metadata file does not match checksum') @@ -159623,7 +159746,7 @@ index e5e9ece..f831f23 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 +1679,9 @@ class YumRepository(Repository, config.RepoConf): +@@ -1597,7 +1676,9 @@ class YumRepository(Repository, config.RepoConf): return local # it's the same return the local one try: @@ -159634,7 +159757,7 @@ index e5e9ece..f831f23 100644 text = "%s/%s" % (self.id, mdtype) if thisdata.size is None: reget = None -@@ -1613,8 +1697,9 @@ class YumRepository(Repository, config.RepoConf): +@@ -1613,8 +1694,9 @@ class YumRepository(Repository, config.RepoConf): checkfunc=checkfunc, text=text, cache=self.http_caching == 'all', @@ -159646,7 +159769,7 @@ index e5e9ece..f831f23 100644 if retrieve_can_fail: return None raise -@@ -1624,7 +1709,6 @@ class YumRepository(Repository, config.RepoConf): +@@ -1624,7 +1706,6 @@ class YumRepository(Repository, config.RepoConf): raise Errors.RepoError, \ "Could not retrieve %s matching remote checksum from %s" % (local, self) else: @@ -159654,7 +159777,7 @@ index e5e9ece..f831f23 100644 return local -@@ -1646,9 +1730,16 @@ class YumRepository(Repository, config.RepoConf): +@@ -1646,13 +1727,21 @@ class YumRepository(Repository, config.RepoConf): def getGroups(self): """gets groups and returns group file path for the repository, if there @@ -159672,8 +159795,14 @@ index e5e9ece..f831f23 100644 + return fn return self._retrieveMD('group', retrieve_can_fail=True) - def setCallback(self, callback): -@@ -1681,7 +1772,7 @@ class YumRepository(Repository, config.RepoConf): +- def setCallback(self, callback): ++ def setCallback(self, callback, multi_callback=None): + self.callback = callback ++ self.multi_callback = multi_callback + self._callbacks_changed = True + + def setFailureObj(self, failure_obj): +@@ -1681,7 +1770,7 @@ class YumRepository(Repository, config.RepoConf): print "Could not read mirrorlist %s, error was \n%s" %(url, e) content = [] for line in content: diff --git a/yum-completion-helper.patch b/yum-completion-helper.patch new file mode 100644 index 0000000..44e6c73 --- /dev/null +++ b/yum-completion-helper.patch @@ -0,0 +1,11 @@ +diff -up yum-3.4.3/completion-helper.py.old yum-3.4.3/completion-helper.py +--- yum-3.4.3/completion-helper.py.old 2012-08-22 17:00:47.444104234 +0200 ++++ yum-3.4.3/completion-helper.py 2012-08-22 17:00:57.954647525 +0200 +@@ -70,6 +70,7 @@ def get_pattern(extcmds): + + def main(args): + base = cli.YumBaseCli() ++ base.setCacheDir = lambda *x: True # use the system cachedir + base.yum_cli_commands.clear() + base.registerCommand(GroupsCompletionCommand()) + base.registerCommand(ListCompletionCommand()) diff --git a/yum.spec b/yum.spec index f15fa3d..e1453c2 100644 --- a/yum.spec +++ b/yum.spec @@ -18,7 +18,7 @@ Summary: RPM package installer/updater/manager Name: yum Version: 3.4.3 -Release: 33%{?dist} +Release: 34%{?dist} License: GPLv2+ Group: System Environment/Base Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz @@ -31,6 +31,7 @@ Patch6: yum-HEAD.patch Patch7: yum-ppc64-preferred.patch Patch8: BZ-803346-no-only-update.patch Patch20: yum-manpage-files.patch +Patch21: yum-completion-helper.patch URL: http://yum.baseurl.org/ BuildArchitectures: noarch @@ -139,6 +140,7 @@ Install this package if you want auto yum updates nightly via cron. %patch7 -p1 %patch8 -p1 %patch20 -p1 +%patch21 -p1 %patch1 -p1 %build @@ -313,6 +315,11 @@ exit 0 %endif %changelog +* Mon Aug 27 2012 Zdenek Pavlas - 3.4.3-34 +- update to latest HEAD. +- customized multi_progress_obj option +- improved reporting of mirror group failures + * Wed Aug 22 2012 Zdenek Pavlas - 3.4.3-33 - Fix a typo in checkfunc. BZ 850550 From d98eeee7d817b6c257da5724e0f92288d45d3c5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zden=C4=9Bk=20Pavlas?= Date: Mon, 27 Aug 2012 11:41:07 +0200 Subject: [PATCH 04/24] Drop a local uncommited change from the previous commit --- yum-HEAD.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yum-HEAD.patch b/yum-HEAD.patch index 3a05bc9..56d0066 100644 --- a/yum-HEAD.patch +++ b/yum-HEAD.patch @@ -155204,7 +155204,7 @@ index 65f6d5e..cf671b6 100755 print category.name for group in category.groups: diff --git a/yum/config.py b/yum/config.py -index d09511f..d9e7fc7 100644 +index d09511f..2bf4f45 100644 --- a/yum/config.py +++ b/yum/config.py @@ -45,15 +45,18 @@ from misc import get_uuid, read_in_items_from_dot_dir @@ -155212,7 +155212,7 @@ index d09511f..d9e7fc7 100644 __pkgs_gpgcheck_default__ = False __repo_gpgcheck_default__ = False +__main_multilib_policy_default__ = 'all' -+__main_failovermethod_default__ = 'priority' ++__main_failovermethod_default__ = 'roundrobin' +__main_installonly_limit_default__ = 0 +__group_command_default__ = 'compat' From 75057add795952495200ee07be9cda1b676dcf8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zden=C4=9Bk=20Pavlas?= Date: Wed, 29 Aug 2012 17:40:49 +0200 Subject: [PATCH 05/24] Update to latest HEAD --- yum-HEAD.patch | 95 +++++++++++++++++++++++++++----------------------- yum.spec | 7 +++- 2 files changed, 57 insertions(+), 45 deletions(-) diff --git a/yum-HEAD.patch b/yum-HEAD.patch index 05b65b1..359fa4e 100644 --- a/yum-HEAD.patch +++ b/yum-HEAD.patch @@ -157642,7 +157642,7 @@ index 0000000..6a04f3a + + return returns.values() diff --git a/yum/metalink.py b/yum/metalink.py -index aaa4f25..51895fd 100755 +index aaa4f25..61aa586 100755 --- a/yum/metalink.py +++ b/yum/metalink.py @@ -180,6 +180,7 @@ class MetaLinkRepoMD: @@ -157670,12 +157670,12 @@ index aaa4f25..51895fd 100755 + if host in self._host2mc: continue - hosts.add(host) -+ self._host2mc[host] = mirror.max_connections ++ self._host2mc[host] = mirror else: continue diff --git a/yum/misc.py b/yum/misc.py -index 2f6ddfe..4cae42b 100644 +index 2f6ddfe..a39a222 100644 --- a/yum/misc.py +++ b/yum/misc.py @@ -8,6 +8,7 @@ import os @@ -157721,16 +157721,19 @@ index 2f6ddfe..4cae42b 100644 except KeyError: return None # if it returns None then, well, it's bollocksed -@@ -746,6 +761,8 @@ def _decompress_chunked(source, dest, ztype): +@@ -744,8 +759,9 @@ def _decompress_chunked(source, dest, ztype): + while True: + try: data = s_fn.read(1024000) - except IOError: - break -+ except EOFError: -+ break +- except IOError: +- break ++ except (OSError, IOError, EOFError), e: ++ msg = "Error reading from file %s: %s" % (source, str(e)) ++ raise Errors.MiscError, msg if not data: break -@@ -940,14 +957,16 @@ def unlink_f(filename): +@@ -940,14 +956,16 @@ def unlink_f(filename): if e.errno != errno.ENOENT: raise @@ -157751,7 +157754,7 @@ index 2f6ddfe..4cae42b 100644 def _getloginuid(): """ Get the audit-uid/login-uid, if available. None is returned if there -@@ -992,9 +1011,17 @@ def setup_locale(override_codecs=True, override_time=False): +@@ -992,9 +1010,17 @@ def setup_locale(override_codecs=True, override_time=False): locale.setlocale(locale.LC_ALL, 'C') if override_codecs: @@ -157772,7 +157775,7 @@ index 2f6ddfe..4cae42b 100644 def get_my_lang_code(): -@@ -1105,17 +1132,28 @@ def decompress(filename, dest=None, fn_only=False, check_timestamps=False): +@@ -1105,17 +1131,28 @@ def decompress(filename, dest=None, fn_only=False, check_timestamps=False): out = filename.replace('.xz', '') else: @@ -159301,7 +159304,7 @@ index 2cb1acb..0586c1c 100644 for pkg in un['pkglist']: for filedata in pkg['packages']: diff --git a/yum/yumRepo.py b/yum/yumRepo.py -index e5e9ece..fc2614e 100644 +index e5e9ece..bbcb2b8 100644 --- a/yum/yumRepo.py +++ b/yum/yumRepo.py @@ -20,10 +20,12 @@ import time @@ -159554,7 +159557,7 @@ index e5e9ece..fc2614e 100644 if proxy_string is not None: self._proxy_dict['http'] = proxy_string -@@ -483,13 +560,26 @@ class YumRepository(Repository, config.RepoConf): +@@ -483,13 +560,30 @@ class YumRepository(Repository, config.RepoConf): ugopts = self._default_grabopts() self._grabfunc = URLGrabber(progress_obj=self.callback, @@ -159565,12 +159568,16 @@ index e5e9ece..fc2614e 100644 reget='simple', **ugopts) + def add_mc(url): -+ host = urlparse.urlsplit(url).netloc ++ host = urlparse.urlsplit(url).netloc.split('@')[-1] + mc = self.metalink_data._host2mc.get(host) -+ if mc > 0: ++ if mc: + url = { + 'mirror': misc.to_utf8(url), -+ 'kwargs': { 'max_connections': mc }, ++ 'kwargs': { ++ 'max_connections': mc.max_connections, ++ 'preference': mc.preference, ++ 'private': mc.private, ++ }, + } + return url + urls = self.urls @@ -159582,7 +159589,7 @@ index e5e9ece..fc2614e 100644 failure_callback=self.mirror_failure_obj) def _default_grabopts(self, cache=True): -@@ -499,6 +589,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -499,6 +593,7 @@ class YumRepository(Repository, config.RepoConf): 'throttle': self.throttle, 'proxies': self.proxy_dict, 'timeout': self.timeout, @@ -159590,7 +159597,7 @@ index e5e9ece..fc2614e 100644 'http_headers': tuple(self.__headersListFromDict(cache=cache)), 'ssl_verify_peer': self.sslverify, 'ssl_verify_host': self.sslverify, -@@ -714,10 +805,10 @@ class YumRepository(Repository, config.RepoConf): +@@ -714,10 +809,10 @@ class YumRepository(Repository, config.RepoConf): local = self.metalink_filename + '.tmp' if not self._metalinkCurrent(): url = misc.to_utf8(self.metalink) @@ -159599,11 +159606,11 @@ index e5e9ece..fc2614e 100644 try: ug = URLGrabber(progress_obj = self.callback, **ugopts) - result = ug.urlgrab(url, local, text=self.id + "/metalink") -+ result = ug.urlgrab(url, local, text=str(self) +"/metalink") ++ result = ug.urlgrab(url, local, text="%s/metalink" % self) except urlgrabber.grabber.URLGrabError, e: if not os.path.exists(self.metalink_filename): -@@ -751,7 +842,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -751,7 +846,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', @@ -159612,7 +159619,7 @@ index e5e9ece..fc2614e 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""" -@@ -768,7 +859,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -768,7 +863,7 @@ class YumRepository(Repository, config.RepoConf): if local is None or relative is None: raise Errors.RepoError, \ @@ -159621,7 +159628,7 @@ index e5e9ece..fc2614e 100644 if self.cache == 1: if os.path.exists(local): # FIXME - we should figure out a way -@@ -796,6 +887,16 @@ class YumRepository(Repository, config.RepoConf): +@@ -796,6 +891,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,)) @@ -159638,7 +159645,7 @@ index e5e9ece..fc2614e 100644 if url and scheme != "media": ugopts = self._default_grabopts(cache=cache) ug = URLGrabber(progress_obj = self.callback, -@@ -815,14 +916,11 @@ class YumRepository(Repository, config.RepoConf): +@@ -815,14 +920,11 @@ class YumRepository(Repository, config.RepoConf): range=(start, end), ) except URLGrabError, e: @@ -159655,7 +159662,7 @@ index e5e9ece..fc2614e 100644 else: -@@ -835,19 +933,18 @@ class YumRepository(Repository, config.RepoConf): +@@ -835,19 +937,18 @@ class YumRepository(Repository, config.RepoConf): reget = reget, checkfunc=checkfunc, http_headers=headers, @@ -159681,7 +159688,7 @@ index e5e9ece..fc2614e 100644 remote = package.relativepath local = package.localPkg() basepath = package.basepath -@@ -857,15 +954,26 @@ class YumRepository(Repository, config.RepoConf): +@@ -857,15 +958,26 @@ class YumRepository(Repository, config.RepoConf): return local misc.unlink_f(local) @@ -159709,7 +159716,7 @@ index e5e9ece..fc2614e 100644 def getHeader(self, package, checkfunc = None, reget = 'simple', cache = True): -@@ -1020,7 +1128,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1020,7 +1132,7 @@ class YumRepository(Repository, config.RepoConf): if grab_can_fail: return None raise Errors.RepoError, 'Error downloading file %s: %s' % (local, e) @@ -159718,7 +159725,7 @@ index e5e9ece..fc2614e 100644 misc.unlink_f(tfname) if grab_can_fail: return None -@@ -1260,6 +1368,9 @@ class YumRepository(Repository, config.RepoConf): +@@ -1260,6 +1372,9 @@ class YumRepository(Repository, config.RepoConf): return True def _check_db_version(self, mdtype, repoXML=None): @@ -159728,7 +159735,7 @@ index e5e9ece..fc2614e 100644 if repoXML is None: repoXML = self.repoXML if mdtype in repoXML.repoData: -@@ -1277,11 +1388,11 @@ class YumRepository(Repository, config.RepoConf): +@@ -1277,11 +1392,11 @@ class YumRepository(Repository, config.RepoConf): return None if not file_check: @@ -159743,7 +159750,7 @@ index e5e9ece..fc2614e 100644 if not os.path.exists(local): local = misc.decompress(local, fn_only=True) compressed = True -@@ -1302,6 +1413,17 @@ class YumRepository(Repository, config.RepoConf): +@@ -1302,6 +1417,17 @@ class YumRepository(Repository, config.RepoConf): into the delete list, this means metadata can change filename without us leaking it. """ @@ -159761,7 +159768,7 @@ index e5e9ece..fc2614e 100644 def _mdtype_eq(omdtype, odata, nmdtype, ndata): """ Check if two returns from _get_mdtype_data() are equal. """ if ndata is None: -@@ -1321,6 +1443,14 @@ class YumRepository(Repository, config.RepoConf): +@@ -1321,6 +1447,14 @@ class YumRepository(Repository, config.RepoConf): return True all_mdtypes = self.retrieved.keys() @@ -159776,7 +159783,7 @@ index e5e9ece..fc2614e 100644 if mdtypes is None: mdtypes = all_mdtypes -@@ -1333,8 +1463,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1333,8 +1467,7 @@ class YumRepository(Repository, config.RepoConf): # Inited twice atm. ... sue me self._oldRepoMDData['new_MD_files'] = [] @@ -159786,7 +159793,7 @@ index e5e9ece..fc2614e 100644 for mdtype in all_mdtypes: (nmdtype, ndata) = self._get_mdtype_data(mdtype) -@@ -1371,43 +1500,16 @@ class YumRepository(Repository, config.RepoConf): +@@ -1371,43 +1504,16 @@ class YumRepository(Repository, config.RepoConf): # No old repomd data, but we might still have uncompressed MD if self._groupCheckDataMDValid(ndata, nmdtype, mdtype): continue @@ -159835,7 +159842,7 @@ index e5e9ece..fc2614e 100644 def _groupLoadRepoXML(self, text=None, mdtypes=None): """ Retrieve the new repomd.xml from the repository, then check it -@@ -1421,7 +1523,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1421,7 +1527,7 @@ class YumRepository(Repository, config.RepoConf): self._commonRetrieveDataMD(mdtypes) def _mdpolicy2mdtypes(self): @@ -159844,7 +159851,7 @@ index e5e9ece..fc2614e 100644 'group:primary' : ['primary'], 'group:small' : ["primary", "updateinfo"], 'group:main' : ["primary", "group", "filelists", -@@ -1436,6 +1538,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1436,6 +1542,7 @@ class YumRepository(Repository, config.RepoConf): if not mdtypes or 'group:all' in mdtypes: mdtypes = None else: @@ -159852,7 +159859,7 @@ index e5e9ece..fc2614e 100644 mdtypes = sorted(list(mdtypes)) return mdtypes -@@ -1451,12 +1554,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1451,12 +1558,7 @@ class YumRepository(Repository, config.RepoConf): def _getRepoXML(self): if self._repoXML: return self._repoXML @@ -159866,7 +159873,7 @@ index e5e9ece..fc2614e 100644 return self._repoXML -@@ -1480,7 +1578,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1480,7 +1582,7 @@ class YumRepository(Repository, config.RepoConf): result = self._getFile(relative='repodata/repomd.xml.asc', copy_local=1, local = sigfile, @@ -159875,7 +159882,7 @@ index e5e9ece..fc2614e 100644 reget=None, checkfunc=None, cache=self.http_caching == 'all', -@@ -1514,7 +1612,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1514,7 +1616,7 @@ class YumRepository(Repository, config.RepoConf): return self._checkMD(fn, mdtype, openchecksum) def _checkMD(self, fn, mdtype, openchecksum=False, @@ -159884,7 +159891,7 @@ index e5e9ece..fc2614e 100644 """ Internal function, use .checkMD() from outside yum. """ thisdata = data # So the argument name is nicer -@@ -1537,6 +1635,18 @@ class YumRepository(Repository, config.RepoConf): +@@ -1537,6 +1639,18 @@ class YumRepository(Repository, config.RepoConf): if size is not None: size = int(size) @@ -159903,7 +159910,7 @@ index e5e9ece..fc2614e 100644 try: # get the local checksum l_csum = self._checksum(r_ctype, file, datasize=size) except Errors.RepoError, e: -@@ -1551,15 +1661,13 @@ class YumRepository(Repository, config.RepoConf): +@@ -1551,15 +1665,13 @@ class YumRepository(Repository, config.RepoConf): return None raise URLGrabError(-1, 'Metadata file does not match checksum') @@ -159920,7 +159927,7 @@ index e5e9ece..fc2614e 100644 """ Internal function, use .retrieveMD() from outside yum. """ # Note that this can raise Errors.RepoMDError if mdtype doesn't exist # for this repo. -@@ -1597,8 +1705,10 @@ class YumRepository(Repository, config.RepoConf): +@@ -1597,8 +1709,10 @@ class YumRepository(Repository, config.RepoConf): return local # it's the same return the local one try: @@ -159933,7 +159940,7 @@ index e5e9ece..fc2614e 100644 if thisdata.size is None: reget = None else: -@@ -1613,8 +1723,9 @@ class YumRepository(Repository, config.RepoConf): +@@ -1613,8 +1727,9 @@ class YumRepository(Repository, config.RepoConf): checkfunc=checkfunc, text=text, cache=self.http_caching == 'all', @@ -159945,7 +159952,7 @@ index e5e9ece..fc2614e 100644 if retrieve_can_fail: return None raise -@@ -1624,7 +1735,6 @@ class YumRepository(Repository, config.RepoConf): +@@ -1624,7 +1739,6 @@ class YumRepository(Repository, config.RepoConf): raise Errors.RepoError, \ "Could not retrieve %s matching remote checksum from %s" % (local, self) else: @@ -159953,7 +159960,7 @@ index e5e9ece..fc2614e 100644 return local -@@ -1646,13 +1756,21 @@ class YumRepository(Repository, config.RepoConf): +@@ -1646,13 +1760,21 @@ class YumRepository(Repository, config.RepoConf): def getGroups(self): """gets groups and returns group file path for the repository, if there @@ -159978,7 +159985,7 @@ index e5e9ece..fc2614e 100644 self._callbacks_changed = True def setFailureObj(self, failure_obj): -@@ -1681,7 +1799,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1681,7 +1803,7 @@ class YumRepository(Repository, config.RepoConf): print "Could not read mirrorlist %s, error was \n%s" %(url, e) content = [] for line in content: diff --git a/yum.spec b/yum.spec index 95847ec..3cf250a 100644 --- a/yum.spec +++ b/yum.spec @@ -18,7 +18,7 @@ Summary: RPM package installer/updater/manager Name: yum Version: 3.4.3 -Release: 37%{?dist} +Release: 38%{?dist} License: GPLv2+ Group: System Environment/Base Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz @@ -315,6 +315,11 @@ exit 0 %endif %changelog +* Wed Aug 29 2012 Zdenek Pavlas - 3.4.3-38 +- update to latest HEAD. +- fix a race in group_gz download +- send 'private' mirror flags to urlgrabber. + * Wed Aug 29 2012 James Antill - 3.4.3-37 - update to latest HEAD. - Fix problem on metalink downloads due to weird python issue. From ddff029bb3cc91ee9410641b92eb737316459055 Mon Sep 17 00:00:00 2001 From: James Antill Date: Thu, 30 Aug 2012 10:38:16 -0400 Subject: [PATCH 06/24] update to latest HEAD. - Fix rel-eng problems when repo.repofile is None. --- yum-HEAD.patch | 60 +++++++++++++++++++++++++++++++++++++------------- yum.spec | 6 ++++- 2 files changed, 50 insertions(+), 16 deletions(-) diff --git a/yum-HEAD.patch b/yum-HEAD.patch index 359fa4e..4026087 100644 --- a/yum-HEAD.patch +++ b/yum-HEAD.patch @@ -2553,7 +2553,7 @@ index 1a8202a..15a8345 100644 .IP "\fB\-\-setopt=option=value\fP" Set any config option in yum config or repo files. For options in the global diff --git a/docs/yum.conf.5 b/docs/yum.conf.5 -index 515aa73..b456074 100644 +index 515aa73..01facf8 100644 --- a/docs/yum.conf.5 +++ b/docs/yum.conf.5 @@ -114,15 +114,27 @@ are causing problems from the transaction. @@ -2665,7 +2665,27 @@ index 515aa73..b456074 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 -@@ -593,8 +654,50 @@ See color_list_installed_older for possible values. +@@ -480,6 +541,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 ++\fBmddownloadpolicy \fR ++You can select which kinds of repodata you would prefer yum to download: ++ ++`sqlite' - Download the .sqlite files, if available. This is currently slightly ++faster, once they are downloaded. However these files tend to be bigger, and ++thus. take longer to download. ++ ++`sqlite' - Download the .XML files, which yum will do anyway as a fallback on ++the other options. These files tend to be smaller, but they require ++parsing/converting locally after download and some aditional checks are ++performed on them each time they are used. ++ ++.IP + \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, +@@ -593,8 +667,50 @@ See color_list_installed_older for possible values. When removing packages (by removal, update or obsoletion) go through each package's dependencies. If any of them are no longer required by any other package then also mark them to be removed. @@ -2716,7 +2736,7 @@ index 515aa73..b456074 100644 .SH "[repository] OPTIONS" -@@ -755,6 +858,11 @@ repository. +@@ -755,6 +871,11 @@ repository. Overrides the \fBbandwidth\fR option from the [main] section for this repository. @@ -2728,7 +2748,7 @@ index 515aa73..b456074 100644 .IP \fBsslcacert \fR -@@ -776,6 +884,10 @@ repository. +@@ -776,6 +897,10 @@ repository. Overrides the \fBsslclientkey\fR option from the [main] section for this repository. @@ -2739,7 +2759,7 @@ index 515aa73..b456074 100644 .IP \fBmetadata_expire \fR -@@ -824,7 +936,11 @@ as greater/less than any other. defaults to 1000 +@@ -824,7 +949,11 @@ 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. @@ -155222,7 +155242,7 @@ index 65f6d5e..08e66b9 100755 print category.name for group in category.groups: diff --git a/yum/config.py b/yum/config.py -index d09511f..b81020f 100644 +index d09511f..74be397 100644 --- a/yum/config.py +++ b/yum/config.py @@ -45,15 +45,18 @@ from misc import get_uuid, read_in_items_from_dot_dir @@ -155493,12 +155513,12 @@ index d09511f..b81020f 100644 class PositiveIntOption(IntOption): - +- """ +- An option representing a positive integer value, where 0 can have a special +- represention. + """An option representing a positive integer value, where 0 can + have a special representation. """ -- An option representing a positive integer value, where 0 can have a special -- represention. -- """ - def __init__(self, default=None, range_min=0, range_max=None, names_of_0=None): @@ -155689,11 +155709,11 @@ index d09511f..b81020f 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* @@ -156185,7 +156205,7 @@ index d09511f..b81020f 100644 try: val = conf.get(section, name) except (NoSectionError, NoOptionError): -@@ -1028,23 +1159,19 @@ def _getsysver(installroot, distroverpkg): +@@ -1028,25 +1159,28 @@ def _getsysver(installroot, distroverpkg): if idx.count() == 0: releasever = '$releasever' else: @@ -156212,10 +156232,20 @@ index d09511f..b81020f 100644 if not _use_iniparse: - return + return None ++ ++ if not hasattr(repo, 'repofile') or not repo.repofile: ++ return None ++ ++ try: ++ ini = INIConfig(open(repo.repofile)) ++ except: ++ return None - ini = INIConfig(open(repo.repofile)) +- ini = INIConfig(open(repo.repofile)) # b/c repoids can have $values in them we need to map both ways to figure -@@ -1054,6 +1181,19 @@ def writeRawRepoFile(repo,only=None): + # out which one is which + section_id = repo.id +@@ -1054,6 +1188,19 @@ def writeRawRepoFile(repo,only=None): for sect in ini._sections.keys(): if varReplace(sect, repo.yumvar) == repo.id: section_id = sect @@ -156235,7 +156265,7 @@ index d09511f..b81020f 100644 # Updated the ConfigParser with the changed values cfgOptions = repo.cfg.options(repo.id) -@@ -1069,7 +1209,7 @@ def writeRawRepoFile(repo,only=None): +@@ -1069,7 +1216,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 diff --git a/yum.spec b/yum.spec index 3cf250a..dcc9544 100644 --- a/yum.spec +++ b/yum.spec @@ -18,7 +18,7 @@ Summary: RPM package installer/updater/manager Name: yum Version: 3.4.3 -Release: 38%{?dist} +Release: 39%{?dist} License: GPLv2+ Group: System Environment/Base Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz @@ -315,6 +315,10 @@ exit 0 %endif %changelog +* Thu Aug 30 2012 James Antill - 3.4.3-39 +- update to latest HEAD. +- Fix rel-eng problems when repo.repofile is None. + * Wed Aug 29 2012 Zdenek Pavlas - 3.4.3-38 - update to latest HEAD. - fix a race in group_gz download From 270f3be860ee15da7be1346647c72e9e7f83e975 Mon Sep 17 00:00:00 2001 From: James Antill Date: Thu, 30 Aug 2012 16:15:43 -0400 Subject: [PATCH 07/24] update to latest HEAD. - Fix rel-eng problems when repo.repofile is None. - Remove statvfs check for local files when we don't copy. --- yum-HEAD.patch | 65 +++++++++++++++++++++++++++++--------------------- yum.spec | 5 ++-- 2 files changed, 41 insertions(+), 29 deletions(-) diff --git a/yum-HEAD.patch b/yum-HEAD.patch index 4026087..39fe263 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..c7d89a1 +index 6056d38..adc3516 --- a/cli.py +++ b/cli.py @@ -25,7 +25,7 @@ import sys @@ -1577,7 +1577,17 @@ index 6056d38..c7d89a1 self._checkAbsInstallRoot(opts) # If the conf file is inside the installroot - use that. # otherwise look for it in the normal root -@@ -1713,6 +2264,10 @@ class YumOptionParser(OptionParser): +@@ -1701,6 +2252,9 @@ class YumOptionParser(OptionParser): + group.add_option("--showduplicates", dest="showdupesfromrepos", + action="store_true", + help=_("show duplicates, in repos, in list/search commands")) ++ group.add_option("--show-duplicates", dest="showdupesfromrepos", ++ action="store_true", ++ help=SUPPRESS_HELP) + group.add_option("-e", "--errorlevel", dest="errorlevel", default=None, + help=_("error output level"), type='int', + metavar='[error level]') +@@ -1713,6 +2267,10 @@ class YumOptionParser(OptionParser): help=_("verbose operation")) group.add_option("-y", "--assumeyes", dest="assumeyes", action="store_true", help=_("answer yes for all questions")) @@ -159334,7 +159344,7 @@ index 2cb1acb..0586c1c 100644 for pkg in un['pkglist']: for filedata in pkg['packages']: diff --git a/yum/yumRepo.py b/yum/yumRepo.py -index e5e9ece..bbcb2b8 100644 +index e5e9ece..f834aec 100644 --- a/yum/yumRepo.py +++ b/yum/yumRepo.py @@ -20,10 +20,12 @@ import time @@ -159658,11 +159668,12 @@ index e5e9ece..bbcb2b8 100644 if self.cache == 1: if os.path.exists(local): # FIXME - we should figure out a way -@@ -796,6 +891,16 @@ class YumRepository(Repository, config.RepoConf): +@@ -796,6 +891,17 @@ 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,)) -+ if size: ++ if size and (self.copy_local or not url or ++ not (url.startswith("/") or url.startswith("file:"))): + dirstat = os.statvfs(os.path.dirname(local)) + avail = dirstat.f_bavail * dirstat.f_bsize + if avail < long(size): @@ -159675,7 +159686,7 @@ index e5e9ece..bbcb2b8 100644 if url and scheme != "media": ugopts = self._default_grabopts(cache=cache) ug = URLGrabber(progress_obj = self.callback, -@@ -815,14 +920,11 @@ class YumRepository(Repository, config.RepoConf): +@@ -815,14 +921,11 @@ class YumRepository(Repository, config.RepoConf): range=(start, end), ) except URLGrabError, e: @@ -159692,7 +159703,7 @@ index e5e9ece..bbcb2b8 100644 else: -@@ -835,19 +937,18 @@ class YumRepository(Repository, config.RepoConf): +@@ -835,19 +938,18 @@ class YumRepository(Repository, config.RepoConf): reget = reget, checkfunc=checkfunc, http_headers=headers, @@ -159718,7 +159729,7 @@ index e5e9ece..bbcb2b8 100644 remote = package.relativepath local = package.localPkg() basepath = package.basepath -@@ -857,15 +958,26 @@ class YumRepository(Repository, config.RepoConf): +@@ -857,15 +959,26 @@ class YumRepository(Repository, config.RepoConf): return local misc.unlink_f(local) @@ -159746,7 +159757,7 @@ index e5e9ece..bbcb2b8 100644 def getHeader(self, package, checkfunc = None, reget = 'simple', cache = True): -@@ -1020,7 +1132,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1020,7 +1133,7 @@ class YumRepository(Repository, config.RepoConf): if grab_can_fail: return None raise Errors.RepoError, 'Error downloading file %s: %s' % (local, e) @@ -159755,7 +159766,7 @@ index e5e9ece..bbcb2b8 100644 misc.unlink_f(tfname) if grab_can_fail: return None -@@ -1260,6 +1372,9 @@ class YumRepository(Repository, config.RepoConf): +@@ -1260,6 +1373,9 @@ class YumRepository(Repository, config.RepoConf): return True def _check_db_version(self, mdtype, repoXML=None): @@ -159765,7 +159776,7 @@ index e5e9ece..bbcb2b8 100644 if repoXML is None: repoXML = self.repoXML if mdtype in repoXML.repoData: -@@ -1277,11 +1392,11 @@ class YumRepository(Repository, config.RepoConf): +@@ -1277,11 +1393,11 @@ class YumRepository(Repository, config.RepoConf): return None if not file_check: @@ -159780,7 +159791,7 @@ index e5e9ece..bbcb2b8 100644 if not os.path.exists(local): local = misc.decompress(local, fn_only=True) compressed = True -@@ -1302,6 +1417,17 @@ class YumRepository(Repository, config.RepoConf): +@@ -1302,6 +1418,17 @@ class YumRepository(Repository, config.RepoConf): into the delete list, this means metadata can change filename without us leaking it. """ @@ -159798,7 +159809,7 @@ index e5e9ece..bbcb2b8 100644 def _mdtype_eq(omdtype, odata, nmdtype, ndata): """ Check if two returns from _get_mdtype_data() are equal. """ if ndata is None: -@@ -1321,6 +1447,14 @@ class YumRepository(Repository, config.RepoConf): +@@ -1321,6 +1448,14 @@ class YumRepository(Repository, config.RepoConf): return True all_mdtypes = self.retrieved.keys() @@ -159813,7 +159824,7 @@ index e5e9ece..bbcb2b8 100644 if mdtypes is None: mdtypes = all_mdtypes -@@ -1333,8 +1467,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1333,8 +1468,7 @@ class YumRepository(Repository, config.RepoConf): # Inited twice atm. ... sue me self._oldRepoMDData['new_MD_files'] = [] @@ -159823,7 +159834,7 @@ index e5e9ece..bbcb2b8 100644 for mdtype in all_mdtypes: (nmdtype, ndata) = self._get_mdtype_data(mdtype) -@@ -1371,43 +1504,16 @@ class YumRepository(Repository, config.RepoConf): +@@ -1371,43 +1505,16 @@ class YumRepository(Repository, config.RepoConf): # No old repomd data, but we might still have uncompressed MD if self._groupCheckDataMDValid(ndata, nmdtype, mdtype): continue @@ -159872,7 +159883,7 @@ index e5e9ece..bbcb2b8 100644 def _groupLoadRepoXML(self, text=None, mdtypes=None): """ Retrieve the new repomd.xml from the repository, then check it -@@ -1421,7 +1527,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1421,7 +1528,7 @@ class YumRepository(Repository, config.RepoConf): self._commonRetrieveDataMD(mdtypes) def _mdpolicy2mdtypes(self): @@ -159881,7 +159892,7 @@ index e5e9ece..bbcb2b8 100644 'group:primary' : ['primary'], 'group:small' : ["primary", "updateinfo"], 'group:main' : ["primary", "group", "filelists", -@@ -1436,6 +1542,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1436,6 +1543,7 @@ class YumRepository(Repository, config.RepoConf): if not mdtypes or 'group:all' in mdtypes: mdtypes = None else: @@ -159889,7 +159900,7 @@ index e5e9ece..bbcb2b8 100644 mdtypes = sorted(list(mdtypes)) return mdtypes -@@ -1451,12 +1558,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1451,12 +1559,7 @@ class YumRepository(Repository, config.RepoConf): def _getRepoXML(self): if self._repoXML: return self._repoXML @@ -159903,7 +159914,7 @@ index e5e9ece..bbcb2b8 100644 return self._repoXML -@@ -1480,7 +1582,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1480,7 +1583,7 @@ class YumRepository(Repository, config.RepoConf): result = self._getFile(relative='repodata/repomd.xml.asc', copy_local=1, local = sigfile, @@ -159912,7 +159923,7 @@ index e5e9ece..bbcb2b8 100644 reget=None, checkfunc=None, cache=self.http_caching == 'all', -@@ -1514,7 +1616,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1514,7 +1617,7 @@ class YumRepository(Repository, config.RepoConf): return self._checkMD(fn, mdtype, openchecksum) def _checkMD(self, fn, mdtype, openchecksum=False, @@ -159921,7 +159932,7 @@ index e5e9ece..bbcb2b8 100644 """ Internal function, use .checkMD() from outside yum. """ thisdata = data # So the argument name is nicer -@@ -1537,6 +1639,18 @@ class YumRepository(Repository, config.RepoConf): +@@ -1537,6 +1640,18 @@ class YumRepository(Repository, config.RepoConf): if size is not None: size = int(size) @@ -159940,7 +159951,7 @@ index e5e9ece..bbcb2b8 100644 try: # get the local checksum l_csum = self._checksum(r_ctype, file, datasize=size) except Errors.RepoError, e: -@@ -1551,15 +1665,13 @@ class YumRepository(Repository, config.RepoConf): +@@ -1551,15 +1666,13 @@ class YumRepository(Repository, config.RepoConf): return None raise URLGrabError(-1, 'Metadata file does not match checksum') @@ -159957,7 +159968,7 @@ index e5e9ece..bbcb2b8 100644 """ Internal function, use .retrieveMD() from outside yum. """ # Note that this can raise Errors.RepoMDError if mdtype doesn't exist # for this repo. -@@ -1597,8 +1709,10 @@ class YumRepository(Repository, config.RepoConf): +@@ -1597,8 +1710,10 @@ class YumRepository(Repository, config.RepoConf): return local # it's the same return the local one try: @@ -159970,7 +159981,7 @@ index e5e9ece..bbcb2b8 100644 if thisdata.size is None: reget = None else: -@@ -1613,8 +1727,9 @@ class YumRepository(Repository, config.RepoConf): +@@ -1613,8 +1728,9 @@ class YumRepository(Repository, config.RepoConf): checkfunc=checkfunc, text=text, cache=self.http_caching == 'all', @@ -159982,7 +159993,7 @@ index e5e9ece..bbcb2b8 100644 if retrieve_can_fail: return None raise -@@ -1624,7 +1739,6 @@ class YumRepository(Repository, config.RepoConf): +@@ -1624,7 +1740,6 @@ class YumRepository(Repository, config.RepoConf): raise Errors.RepoError, \ "Could not retrieve %s matching remote checksum from %s" % (local, self) else: @@ -159990,7 +160001,7 @@ index e5e9ece..bbcb2b8 100644 return local -@@ -1646,13 +1760,21 @@ class YumRepository(Repository, config.RepoConf): +@@ -1646,13 +1761,21 @@ class YumRepository(Repository, config.RepoConf): def getGroups(self): """gets groups and returns group file path for the repository, if there @@ -160015,7 +160026,7 @@ index e5e9ece..bbcb2b8 100644 self._callbacks_changed = True def setFailureObj(self, failure_obj): -@@ -1681,7 +1803,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1681,7 +1804,7 @@ class YumRepository(Repository, config.RepoConf): print "Could not read mirrorlist %s, error was \n%s" %(url, e) content = [] for line in content: diff --git a/yum.spec b/yum.spec index dcc9544..be1eee9 100644 --- a/yum.spec +++ b/yum.spec @@ -18,7 +18,7 @@ Summary: RPM package installer/updater/manager Name: yum Version: 3.4.3 -Release: 39%{?dist} +Release: 40%{?dist} License: GPLv2+ Group: System Environment/Base Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz @@ -315,9 +315,10 @@ exit 0 %endif %changelog -* Thu Aug 30 2012 James Antill - 3.4.3-39 +* Thu Aug 30 2012 James Antill - 3.4.3-40 - update to latest HEAD. - Fix rel-eng problems when repo.repofile is None. +- Remove statvfs check for local files when we don't copy. * Wed Aug 29 2012 Zdenek Pavlas - 3.4.3-38 - update to latest HEAD. From 583723b96a91eda9c72c3736bfb8de7b5d1e8e10 Mon Sep 17 00:00:00 2001 From: James Antill Date: Fri, 31 Aug 2012 17:09:40 -0400 Subject: [PATCH 08/24] update to latest HEAD. - Don't statvfs when we aren't going to copy, and using relative. --- yum-HEAD.patch | 70 ++++++++++++++++++++++++++++++-------------------- yum.spec | 6 ++++- 2 files changed, 47 insertions(+), 29 deletions(-) diff --git a/yum-HEAD.patch b/yum-HEAD.patch index 39fe263..e3296f4 100644 --- a/yum-HEAD.patch +++ b/yum-HEAD.patch @@ -159344,7 +159344,7 @@ index 2cb1acb..0586c1c 100644 for pkg in un['pkglist']: for filedata in pkg['packages']: diff --git a/yum/yumRepo.py b/yum/yumRepo.py -index e5e9ece..f834aec 100644 +index e5e9ece..7c55353 100644 --- a/yum/yumRepo.py +++ b/yum/yumRepo.py @@ -20,10 +20,12 @@ import time @@ -159650,8 +159650,23 @@ index e5e9ece..f834aec 100644 except urlgrabber.grabber.URLGrabError, e: if not os.path.exists(self.metalink_filename): -@@ -751,7 +846,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -749,9 +844,22 @@ class YumRepository(Repository, config.RepoConf): + value), + fdel=lambda self: setattr(self, "_metalink", None)) ++ def _all_urls_are_files(self, url): ++ if url: ++ return url.startswith("/") or url.startswith("file:") ++ ++ if not self.urls: # WTF ... but whatever. ++ return False ++ ++ # Not an explicit url ... so make sure all mirrors/etc. are file:// ++ for url in self.urls: ++ if not self._all_urls_are_files(url): ++ return False ++ return True ++ def _getFile(self, url=None, relative=None, local=None, start=None, end=None, copy_local=None, checkfunc=None, text=None, reget='simple', - cache=True, size=None): @@ -159659,7 +159674,7 @@ index e5e9ece..f834aec 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""" -@@ -768,7 +863,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -768,7 +876,7 @@ class YumRepository(Repository, config.RepoConf): if local is None or relative is None: raise Errors.RepoError, \ @@ -159668,12 +159683,11 @@ index e5e9ece..f834aec 100644 if self.cache == 1: if os.path.exists(local): # FIXME - we should figure out a way -@@ -796,6 +891,17 @@ class YumRepository(Repository, config.RepoConf): +@@ -796,6 +904,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,)) -+ if size and (self.copy_local or not url or -+ not (url.startswith("/") or url.startswith("file:"))): ++ if size and (copy_local or not _all_urls_are_files(url)): + dirstat = os.statvfs(os.path.dirname(local)) + avail = dirstat.f_bavail * dirstat.f_bsize + if avail < long(size): @@ -159686,7 +159700,7 @@ index e5e9ece..f834aec 100644 if url and scheme != "media": ugopts = self._default_grabopts(cache=cache) ug = URLGrabber(progress_obj = self.callback, -@@ -815,14 +921,11 @@ class YumRepository(Repository, config.RepoConf): +@@ -815,14 +933,11 @@ class YumRepository(Repository, config.RepoConf): range=(start, end), ) except URLGrabError, e: @@ -159703,7 +159717,7 @@ index e5e9ece..f834aec 100644 else: -@@ -835,19 +938,18 @@ class YumRepository(Repository, config.RepoConf): +@@ -835,19 +950,18 @@ class YumRepository(Repository, config.RepoConf): reget = reget, checkfunc=checkfunc, http_headers=headers, @@ -159729,7 +159743,7 @@ index e5e9ece..f834aec 100644 remote = package.relativepath local = package.localPkg() basepath = package.basepath -@@ -857,15 +959,26 @@ class YumRepository(Repository, config.RepoConf): +@@ -857,15 +971,26 @@ class YumRepository(Repository, config.RepoConf): return local misc.unlink_f(local) @@ -159757,7 +159771,7 @@ index e5e9ece..f834aec 100644 def getHeader(self, package, checkfunc = None, reget = 'simple', cache = True): -@@ -1020,7 +1133,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1020,7 +1145,7 @@ class YumRepository(Repository, config.RepoConf): if grab_can_fail: return None raise Errors.RepoError, 'Error downloading file %s: %s' % (local, e) @@ -159766,7 +159780,7 @@ index e5e9ece..f834aec 100644 misc.unlink_f(tfname) if grab_can_fail: return None -@@ -1260,6 +1373,9 @@ class YumRepository(Repository, config.RepoConf): +@@ -1260,6 +1385,9 @@ class YumRepository(Repository, config.RepoConf): return True def _check_db_version(self, mdtype, repoXML=None): @@ -159776,7 +159790,7 @@ index e5e9ece..f834aec 100644 if repoXML is None: repoXML = self.repoXML if mdtype in repoXML.repoData: -@@ -1277,11 +1393,11 @@ class YumRepository(Repository, config.RepoConf): +@@ -1277,11 +1405,11 @@ class YumRepository(Repository, config.RepoConf): return None if not file_check: @@ -159791,7 +159805,7 @@ index e5e9ece..f834aec 100644 if not os.path.exists(local): local = misc.decompress(local, fn_only=True) compressed = True -@@ -1302,6 +1418,17 @@ class YumRepository(Repository, config.RepoConf): +@@ -1302,6 +1430,17 @@ class YumRepository(Repository, config.RepoConf): into the delete list, this means metadata can change filename without us leaking it. """ @@ -159809,7 +159823,7 @@ index e5e9ece..f834aec 100644 def _mdtype_eq(omdtype, odata, nmdtype, ndata): """ Check if two returns from _get_mdtype_data() are equal. """ if ndata is None: -@@ -1321,6 +1448,14 @@ class YumRepository(Repository, config.RepoConf): +@@ -1321,6 +1460,14 @@ class YumRepository(Repository, config.RepoConf): return True all_mdtypes = self.retrieved.keys() @@ -159824,7 +159838,7 @@ index e5e9ece..f834aec 100644 if mdtypes is None: mdtypes = all_mdtypes -@@ -1333,8 +1468,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1333,8 +1480,7 @@ class YumRepository(Repository, config.RepoConf): # Inited twice atm. ... sue me self._oldRepoMDData['new_MD_files'] = [] @@ -159834,7 +159848,7 @@ index e5e9ece..f834aec 100644 for mdtype in all_mdtypes: (nmdtype, ndata) = self._get_mdtype_data(mdtype) -@@ -1371,43 +1505,16 @@ class YumRepository(Repository, config.RepoConf): +@@ -1371,43 +1517,16 @@ class YumRepository(Repository, config.RepoConf): # No old repomd data, but we might still have uncompressed MD if self._groupCheckDataMDValid(ndata, nmdtype, mdtype): continue @@ -159883,7 +159897,7 @@ index e5e9ece..f834aec 100644 def _groupLoadRepoXML(self, text=None, mdtypes=None): """ Retrieve the new repomd.xml from the repository, then check it -@@ -1421,7 +1528,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1421,7 +1540,7 @@ class YumRepository(Repository, config.RepoConf): self._commonRetrieveDataMD(mdtypes) def _mdpolicy2mdtypes(self): @@ -159892,7 +159906,7 @@ index e5e9ece..f834aec 100644 'group:primary' : ['primary'], 'group:small' : ["primary", "updateinfo"], 'group:main' : ["primary", "group", "filelists", -@@ -1436,6 +1543,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1436,6 +1555,7 @@ class YumRepository(Repository, config.RepoConf): if not mdtypes or 'group:all' in mdtypes: mdtypes = None else: @@ -159900,7 +159914,7 @@ index e5e9ece..f834aec 100644 mdtypes = sorted(list(mdtypes)) return mdtypes -@@ -1451,12 +1559,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1451,12 +1571,7 @@ class YumRepository(Repository, config.RepoConf): def _getRepoXML(self): if self._repoXML: return self._repoXML @@ -159914,7 +159928,7 @@ index e5e9ece..f834aec 100644 return self._repoXML -@@ -1480,7 +1583,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1480,7 +1595,7 @@ class YumRepository(Repository, config.RepoConf): result = self._getFile(relative='repodata/repomd.xml.asc', copy_local=1, local = sigfile, @@ -159923,7 +159937,7 @@ index e5e9ece..f834aec 100644 reget=None, checkfunc=None, cache=self.http_caching == 'all', -@@ -1514,7 +1617,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1514,7 +1629,7 @@ class YumRepository(Repository, config.RepoConf): return self._checkMD(fn, mdtype, openchecksum) def _checkMD(self, fn, mdtype, openchecksum=False, @@ -159932,7 +159946,7 @@ index e5e9ece..f834aec 100644 """ Internal function, use .checkMD() from outside yum. """ thisdata = data # So the argument name is nicer -@@ -1537,6 +1640,18 @@ class YumRepository(Repository, config.RepoConf): +@@ -1537,6 +1652,18 @@ class YumRepository(Repository, config.RepoConf): if size is not None: size = int(size) @@ -159951,7 +159965,7 @@ index e5e9ece..f834aec 100644 try: # get the local checksum l_csum = self._checksum(r_ctype, file, datasize=size) except Errors.RepoError, e: -@@ -1551,15 +1666,13 @@ class YumRepository(Repository, config.RepoConf): +@@ -1551,15 +1678,13 @@ class YumRepository(Repository, config.RepoConf): return None raise URLGrabError(-1, 'Metadata file does not match checksum') @@ -159968,7 +159982,7 @@ index e5e9ece..f834aec 100644 """ Internal function, use .retrieveMD() from outside yum. """ # Note that this can raise Errors.RepoMDError if mdtype doesn't exist # for this repo. -@@ -1597,8 +1710,10 @@ class YumRepository(Repository, config.RepoConf): +@@ -1597,8 +1722,10 @@ class YumRepository(Repository, config.RepoConf): return local # it's the same return the local one try: @@ -159981,7 +159995,7 @@ index e5e9ece..f834aec 100644 if thisdata.size is None: reget = None else: -@@ -1613,8 +1728,9 @@ class YumRepository(Repository, config.RepoConf): +@@ -1613,8 +1740,9 @@ class YumRepository(Repository, config.RepoConf): checkfunc=checkfunc, text=text, cache=self.http_caching == 'all', @@ -159993,7 +160007,7 @@ index e5e9ece..f834aec 100644 if retrieve_can_fail: return None raise -@@ -1624,7 +1740,6 @@ class YumRepository(Repository, config.RepoConf): +@@ -1624,7 +1752,6 @@ class YumRepository(Repository, config.RepoConf): raise Errors.RepoError, \ "Could not retrieve %s matching remote checksum from %s" % (local, self) else: @@ -160001,7 +160015,7 @@ index e5e9ece..f834aec 100644 return local -@@ -1646,13 +1761,21 @@ class YumRepository(Repository, config.RepoConf): +@@ -1646,13 +1773,21 @@ class YumRepository(Repository, config.RepoConf): def getGroups(self): """gets groups and returns group file path for the repository, if there @@ -160026,7 +160040,7 @@ index e5e9ece..f834aec 100644 self._callbacks_changed = True def setFailureObj(self, failure_obj): -@@ -1681,7 +1804,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1681,7 +1816,7 @@ class YumRepository(Repository, config.RepoConf): print "Could not read mirrorlist %s, error was \n%s" %(url, e) content = [] for line in content: diff --git a/yum.spec b/yum.spec index be1eee9..ff07313 100644 --- a/yum.spec +++ b/yum.spec @@ -18,7 +18,7 @@ Summary: RPM package installer/updater/manager Name: yum Version: 3.4.3 -Release: 40%{?dist} +Release: 41%{?dist} License: GPLv2+ Group: System Environment/Base Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz @@ -315,6 +315,10 @@ exit 0 %endif %changelog +* Fri Aug 31 2012 James Antill - 3.4.3-41 +- update to latest HEAD. +- Don't statvfs when we aren't going to copy, and using relative. + * Thu Aug 30 2012 James Antill - 3.4.3-40 - update to latest HEAD. - Fix rel-eng problems when repo.repofile is None. From 26a29d4ff7c98a4e491f8a0f61179c0fbc462600 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Fri, 31 Aug 2012 15:51:18 -0700 Subject: [PATCH 09/24] Fix the patch from HEAD, missing self. --- yum-HEAD.patch | 2 +- yum.spec | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/yum-HEAD.patch b/yum-HEAD.patch index e3296f4..1328cb1 100644 --- a/yum-HEAD.patch +++ b/yum-HEAD.patch @@ -159687,7 +159687,7 @@ index e5e9ece..7c55353 100644 except Errors.MediaError, e: verbose_logger.log(logginglevels.DEBUG_2, "Error getting package from media; falling back to url %s" %(e,)) -+ if size and (copy_local or not _all_urls_are_files(url)): ++ if size and (copy_local or not self._all_urls_are_files(url)): + dirstat = os.statvfs(os.path.dirname(local)) + avail = dirstat.f_bavail * dirstat.f_bsize + if avail < long(size): diff --git a/yum.spec b/yum.spec index ff07313..96d15fd 100644 --- a/yum.spec +++ b/yum.spec @@ -18,7 +18,7 @@ Summary: RPM package installer/updater/manager Name: yum Version: 3.4.3 -Release: 41%{?dist} +Release: 42%{?dist} License: GPLv2+ Group: System Environment/Base Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz @@ -315,6 +315,9 @@ exit 0 %endif %changelog +* Fri Aug 31 2012 Jesse Keating - 3.4.3-42 +- Fix HEAD patch, add a self. to function call + * Fri Aug 31 2012 James Antill - 3.4.3-41 - update to latest HEAD. - Don't statvfs when we aren't going to copy, and using relative. From e33be8cea50556046a862f8017e79e1fd8fda653 Mon Sep 17 00:00:00 2001 From: James Antill Date: Fri, 7 Sep 2012 16:04:30 -0400 Subject: [PATCH 10/24] update to latest HEAD. - Use .ui_id explicitly for backcompat. on strings, *sigh*. --- yum-HEAD.patch | 328 +++++++++++++++++++++++++++++++++++-------------- yum.spec | 6 +- 2 files changed, 240 insertions(+), 94 deletions(-) diff --git a/yum-HEAD.patch b/yum-HEAD.patch index 1328cb1..e4c51b8 100644 --- a/yum-HEAD.patch +++ b/yum-HEAD.patch @@ -2293,7 +2293,7 @@ index 0000000..d2a0ed1 +if __name__ == "__main__": + generateAll(os.getcwd(), os.getcwd()) diff --git a/docs/yum.8 b/docs/yum.8 -index 1a8202a..15a8345 100644 +index 1a8202a..dab01f6 100644 --- a/docs/yum.8 +++ b/docs/yum.8 @@ -52,6 +52,7 @@ gnome\-packagekit application\&. @@ -2304,8 +2304,12 @@ index 1a8202a..15a8345 100644 .br .I \fR * localinstall rpmfile1 [rpmfile2] [\&.\&.\&.] (maintained for legacy reasons only - use install) -@@ -69,7 +70,9 @@ gnome\-packagekit application\&. +@@ -67,9 +68,13 @@ gnome\-packagekit application\&. .br + .I \fR * repolist [all|enabled|disabled] + .br ++.I \fR * repoinfo [all|enabled|disabled] ++.br .I \fR * version [ all | installed | available | group-* | nogroups* | grouplist | groupinfo ] .br -.I \fR * history [info|list|packages-list|summary|addon-info|redo|undo|rollback|new] @@ -2315,7 +2319,7 @@ index 1a8202a..15a8345 100644 .br .I \fR * check .br -@@ -86,14 +89,20 @@ Is used to install the latest version of a package or +@@ -86,14 +91,20 @@ Is used to install the latest version of a package or group of packages while ensuring that all dependencies are satisfied\&. (See \fBSpecifying package names\fP for more information) If no package matches the given package name(s), they are assumed to be a shell @@ -2340,7 +2344,7 @@ index 1a8202a..15a8345 100644 .IP .IP "\fBupdate\fP" If run without any packages, update will update every currently -@@ -111,7 +120,7 @@ changes, for example: upgrading from somelinux 8.0 to somelinux 9. +@@ -111,7 +122,7 @@ changes, for example: upgrading from somelinux 8.0 to somelinux 9. Note that "\fBupdate\fP" works on installed packages first, and only if there are no matches does it look for available packages. The difference is most @@ -2349,7 +2353,7 @@ index 1a8202a..15a8345 100644 "\fBupdate\fP foo" if foo-1-2 is installed. You can use the "\fBupdate-to\fP" if you'd prefer that nothing happen in the above case. .IP -@@ -158,6 +167,11 @@ the "install" command\&.(See \fBSpecifying package names\fP for more information +@@ -158,6 +169,11 @@ the "install" command\&.(See \fBSpecifying package names\fP for more information Note that "yum" is included in the protected_packages configuration, by default. So you can't accidentally remove yum itself. @@ -2361,7 +2365,7 @@ index 1a8202a..15a8345 100644 .IP .IP "\fBlist\fP" Is used to list various information about available -@@ -209,10 +223,12 @@ installed. +@@ -209,10 +225,12 @@ installed. "\fBgroup list\fP" is used to list the available groups from all \fByum\fP repos. Groups are marked as "installed" if all mandatory packages are installed, or if a group doesn't have any mandatory packages then it is installed if any of the optional or @@ -2378,7 +2382,7 @@ index 1a8202a..15a8345 100644 "\fBgroup remove\fP" is used to remove all of the packages in a group, unlike "groupinstall" this will remove everything regardless of group_package_types. It is worth pointing -@@ -224,10 +240,37 @@ to only remove packages which aren't required by something else. +@@ -224,10 +242,37 @@ to only remove packages which aren't required by something else. "\fBgroup info\fP" is used to give the description and package list of a group (and which type those packages are marked as). Note that you can use the yum-filter-data and @@ -2417,7 +2421,7 @@ index 1a8202a..15a8345 100644 .IP .IP "\fBshell\fP" Is used to enter the 'yum shell', when a filename is specified the contents of -@@ -235,12 +278,13 @@ that file is executed in yum shell mode. See \fIyum-shell(8)\fP for more info +@@ -235,12 +280,13 @@ that file is executed in yum shell mode. See \fIyum-shell(8)\fP for more info .IP .IP "\fBresolvedep\fP" Is used to list packages providing the specified dependencies, at most one @@ -2433,7 +2437,7 @@ index 1a8202a..15a8345 100644 reasons only. .IP .IP "\fBlocalupdate\fP" -@@ -248,7 +292,7 @@ Is used to update the system by specifying local rpm files. Only the specified +@@ -248,7 +294,7 @@ Is used to update the system by specifying local rpm files. Only the specified rpm files of which an older version is already installed will be installed, the remaining specified packages will be ignored. If required the enabled repositories will be used to resolve dependencies. Note @@ -2442,7 +2446,7 @@ index 1a8202a..15a8345 100644 legacy reasons only. .IP .IP "\fBreinstall\fP" -@@ -260,7 +304,7 @@ on groups, files, provides and filelists just like the "install" command\&. +@@ -260,7 +306,7 @@ on groups, files, provides and filelists just like the "install" command\&. Will try and downgrade a package from the version currently installed to the previously highest version (or the specified version). The depsolver will not necessarily work, but if you specify all the packages it @@ -2451,7 +2455,14 @@ index 1a8202a..15a8345 100644 work for "installonly" packages, like Kernels. downgrade operates on groups, files, provides, filelists and rpm files just like the "install" command\&. .IP -@@ -294,8 +338,8 @@ package counts/etc. will be zeroed out). +@@ -291,11 +337,15 @@ then yum will ignore any repo errors and output the information it can get + (Eg. "yum clean all; yum -C repolist" will output something, although the + package counts/etc. will be zeroed out). + .IP ++.IP "\fBrepoinfo\fP" ++.IP ++This ocmmand works exactly like repolist -v. ++.IP .IP "\fBversion\fP" Produces a "version" of the rpmdb, and of the enabled repositories if "all" is given as the first argument. You can also specify version groups in the @@ -2462,7 +2473,7 @@ index 1a8202a..15a8345 100644 packages (in sorted order), and the checksum_type/checksum_data entries from the yumdb. Note that this rpmdb version is now also used significantly within yum (esp. in yum history). -@@ -321,26 +365,33 @@ and so takes sub-commands: +@@ -321,26 +371,33 @@ and so takes sub-commands: .IP "\fBhistory\fP" The history command allows the user to view what has happened in past transactions (assuming the history_record config. option is set). You can use @@ -2502,7 +2513,7 @@ index 1a8202a..15a8345 100644 A (if it is not still installed), and "rollback 1" will try to remove packages B and C. Note that after a "rollback 1" you will have a fourth transaction, although the ending rpmdb version (see: yum version) should be the same in -@@ -349,6 +400,12 @@ transactions 1 and 4. +@@ -349,6 +406,12 @@ transactions 1 and 4. The addon-info command takes a transaction ID, and the packages-list command takes a package (with wildcards). @@ -2515,7 +2526,7 @@ index 1a8202a..15a8345 100644 In "history list" you can change the behaviour of the 2nd column via. the configuration option history_list_view. -@@ -371,6 +428,15 @@ end of the package column in the packages-list command). +@@ -371,6 +434,15 @@ end of the package column in the packages-list command). .I \fBs\fR - The transaction completed fine, but --skip-broken was enabled and had to skip some packages. .br @@ -2531,7 +2542,7 @@ index 1a8202a..15a8345 100644 .IP .IP "\fBcheck\fP" Checks the local rpmdb and produces information on any problems it finds. You -@@ -401,6 +467,11 @@ Assume yes; assume that the answer to any question which would be asked +@@ -401,6 +473,11 @@ Assume yes; assume that the answer to any question which would be asked is yes\&. .br Configuration Option: \fBassumeyes\fP @@ -2543,7 +2554,7 @@ index 1a8202a..15a8345 100644 .IP "\fB\-c, \-\-config=[config file]\fP" Specifies the config file location - can take HTTP and FTP URLs and local file paths\&. -@@ -420,7 +491,7 @@ Sets the error level to [number] Practical range 0 \- 10. 0 means print only cri +@@ -420,7 +497,7 @@ Sets the error level to [number] Practical range 0 \- 10. 0 means print only cri .br Configuration Option: \fBerrorlevel\fP .IP "\fB\-\-rpmverbosity=[name]\fP" @@ -2552,7 +2563,7 @@ index 1a8202a..15a8345 100644 options are: 'critical', 'emergency', 'error', 'warn' and 'debug'. .br Configuration Option: \fBrpmverbosity\fP -@@ -506,7 +577,8 @@ option will corrupt your cache (and you can use $releasever in your cachedir +@@ -506,7 +583,8 @@ option will corrupt your cache (and you can use $releasever in your cachedir configuration to stop this). .PP .IP "\fB\-t, \-\-tolerant\fP" @@ -3471,7 +3482,7 @@ index f1e06e8..b21c594 100644 complete -F _yum -o filenames yum yummain.py diff --git a/output.py b/output.py -index b6aa277..caac21a 100755 +index b6aa277..05b255e 100755 --- a/output.py +++ b/output.py @@ -1,6 +1,6 @@ @@ -3901,6 +3912,15 @@ index b6aa277..caac21a 100755 (hibeg, hiend) = self._highlight(highlight) print _("Name : %s%s%s") % (hibeg, to_unicode(pkg.name), hiend) print _("Arch : %s") % to_unicode(pkg.arch) +@@ -585,7 +820,7 @@ class YumOutput: + print _("Version : %s") % to_unicode(pkg.version) + print _("Release : %s") % to_unicode(pkg.release) + print _("Size : %s") % self.format_number(float(pkg.size)) +- print _("Repo : %s") % to_unicode(pkg.repoid) ++ print _("Repo : %s") % to_unicode(pkg.repo.ui_id) + if pkg.repoid == 'installed' and 'from_repo' in pkg.yumdb_info: + print _("From repo : %s") % to_unicode(pkg.yumdb_info.from_repo) + if self.verbose_logger.isEnabledFor(logginglevels.DEBUG_3): @@ -617,9 +852,22 @@ class YumOutput: print "" @@ -157874,7 +157894,7 @@ index 4af563a..47832fc 100644 self.obsoletes = {} #obs[obsoletename] = [pkg1, pkg2, pkg3] #the package lists are packages that obsolete the key name diff --git a/yum/packages.py b/yum/packages.py -index 5ef9951..f67169f 100644 +index 5ef9951..07c555c 100644 --- a/yum/packages.py +++ b/yum/packages.py @@ -106,14 +106,16 @@ def buildPkgRefDict(pkgs, casematch=True): @@ -157896,7 +157916,18 @@ index 5ef9951..f67169f 100644 exactmatch = [] matched = [] unmatched = [] -@@ -243,34 +245,87 @@ class PackageObject(object): +@@ -223,6 +225,10 @@ class FakeRepository: + def __str__(self): + return self.id + ++ def _ui_id(self): ++ return self.id ++ ui_id = property(fget=lambda self: self._ui_id()) ++ + + # Goal for the below is to have a packageobject that can be used by generic + # functions independent of the type of package - ie: installed or available +@@ -243,34 +249,87 @@ class PackageObject(object): def _ui_envra(self): if self.epoch == '0': @@ -158004,7 +158035,7 @@ index 5ef9951..f67169f 100644 def __str__(self): return self.ui_envra -@@ -481,15 +536,14 @@ class RpmBase(object): +@@ -481,15 +540,14 @@ class RpmBase(object): if prcotuple in self._prco_lookup[prcotype]: return 1 @@ -158028,7 +158059,7 @@ index 5ef9951..f67169f 100644 return 0 -@@ -611,15 +665,18 @@ class RpmBase(object): +@@ -611,15 +669,18 @@ class RpmBase(object): dirlist = property(fget=lambda self: self.returnFileEntries(ftype='dir')) ghostlist = property(fget=lambda self: self.returnFileEntries(ftype='ghost')) requires = property(fget=lambda self: self.returnPrco('requires')) @@ -158047,7 +158078,7 @@ index 5ef9951..f67169f 100644 conflicts_print = property(fget=lambda self: self.returnPrco('conflicts', True)) obsoletes_print = property(fget=lambda self: self.returnPrco('obsoletes', True)) changelog = property(fget=lambda self: self.returnChangelog()) -@@ -1083,7 +1140,7 @@ class YumAvailablePackage(PackageObject, RpmBase): +@@ -1083,7 +1144,7 @@ class YumAvailablePackage(PackageObject, RpmBase): misc.to_unicode(misc.to_xml(self.summary)), misc.to_unicode(misc.to_xml(self.description)), packager, url, self.filetime, @@ -158056,7 +158087,7 @@ index 5ef9951..f67169f 100644 msg += self._return_remote_location() return msg -@@ -1133,7 +1190,7 @@ class YumAvailablePackage(PackageObject, RpmBase): +@@ -1133,7 +1194,7 @@ class YumAvailablePackage(PackageObject, RpmBase): msg = "" mylist = getattr(self, pcotype) if mylist: msg = "\n \n" % pcotype @@ -158065,7 +158096,7 @@ index 5ef9951..f67169f 100644 pcostring = ''' %s\n""" % misc.to_xml(fn) return msg -@@ -1194,8 +1251,8 @@ class YumAvailablePackage(PackageObject, RpmBase): +@@ -1194,8 +1255,8 @@ class YumAvailablePackage(PackageObject, RpmBase): continue newlist.append(i) mylist = newlist @@ -158091,7 +158122,7 @@ index 5ef9951..f67169f 100644 if name.startswith('rpmlib('): continue # this drops out requires that the pkg provides for itself. -@@ -1217,13 +1274,16 @@ class YumAvailablePackage(PackageObject, RpmBase): +@@ -1217,13 +1278,16 @@ class YumAvailablePackage(PackageObject, RpmBase): prcostring += ''' ver="%s"''' % misc.to_xml(v, attrib=True) if r: prcostring += ''' rel="%s"''' % misc.to_xml(r, attrib=True) @@ -158110,7 +158141,7 @@ index 5ef9951..f67169f 100644 return msg def _dump_changelog(self, clog_limit): -@@ -1272,6 +1332,13 @@ class YumAvailablePackage(PackageObject, RpmBase): +@@ -1272,6 +1336,13 @@ class YumAvailablePackage(PackageObject, RpmBase): return misc.to_utf8(msg) @@ -158124,7 +158155,7 @@ index 5ef9951..f67169f 100644 # This is a tweak on YumAvailablePackage() and is a base class for packages # which are actual rpms. -@@ -1299,7 +1366,8 @@ class YumHeaderPackage(YumAvailablePackage): +@@ -1299,7 +1370,8 @@ class YumHeaderPackage(YumAvailablePackage): self.pkgid = self.hdr[rpm.RPMTAG_SHA1HEADER] if not self.pkgid: self.pkgid = "%s.%s" %(self.hdr['name'], self.hdr['buildtime']) @@ -158134,7 +158165,7 @@ index 5ef9951..f67169f 100644 self.__mode_cache = {} self.__prcoPopulated = False -@@ -1353,6 +1421,12 @@ class YumHeaderPackage(YumAvailablePackage): +@@ -1353,6 +1425,12 @@ class YumHeaderPackage(YumAvailablePackage): continue lst = hdr[getattr(rpm, 'RPMTAG_%sFLAGS' % tag)] @@ -158147,7 +158178,7 @@ index 5ef9951..f67169f 100644 flag = map(rpmUtils.miscutils.flagToString, lst) flag = map(misc.share_data, flag) -@@ -1363,6 +1437,10 @@ class YumHeaderPackage(YumAvailablePackage): +@@ -1363,6 +1441,10 @@ class YumHeaderPackage(YumAvailablePackage): prcotype = tag2prco[tag] self.prco[prcotype] = map(misc.share_data, zip(name,flag,vers)) @@ -158158,7 +158189,7 @@ index 5ef9951..f67169f 100644 def tagByName(self, tag): warnings.warn("tagByName() will go away in a furture version of Yum.\n", -@@ -1447,7 +1525,7 @@ class YumHeaderPackage(YumAvailablePackage): +@@ -1447,7 +1529,7 @@ class YumHeaderPackage(YumAvailablePackage): raise NotImplementedError() def _size(self): @@ -159078,9 +159109,27 @@ index 9b265f9..61c9a0e 100644 + + self.display.verify_txmbr(self.base, txmbr, count) diff --git a/yum/sqlitesack.py b/yum/sqlitesack.py -index 8a6f6f3..ba929de 100644 +index 8a6f6f3..ed57408 100644 --- a/yum/sqlitesack.py +++ b/yum/sqlitesack.py +@@ -69,7 +69,7 @@ def _parse_pkg_n(match, regexp_match, n): + if not regexp_match: + return False + +- if (match and n and match[0] not in ('?', '*') and match[0] != n[0]): ++ if (match and n and match[0] not in ('?', '*', '[') and match[0] != n[0]): + return False + if regexp_match(n): + return True +@@ -82,7 +82,7 @@ def _parse_pkg(match, regexp_match, data, e,v,r,a): + # Worthless speed hacks? + if match == n: + return True +- if (match and n and match[0] not in ('?', '*') and ++ if (match and n and match[0] not in ('?', '*', '[') and + match[0] != n[0] and match[0] != e[0]): + return False + @@ -382,6 +382,10 @@ class YumAvailablePackageSqlite(YumAvailablePackage, PackageObject, RpmBase): def returnPrco(self, prcotype, printable=False): @@ -159344,7 +159393,7 @@ index 2cb1acb..0586c1c 100644 for pkg in un['pkglist']: for filedata in pkg['packages']: diff --git a/yum/yumRepo.py b/yum/yumRepo.py -index e5e9ece..7c55353 100644 +index e5e9ece..21f65f7 100644 --- a/yum/yumRepo.py +++ b/yum/yumRepo.py @@ -20,10 +20,12 @@ import time @@ -159368,6 +159417,15 @@ index e5e9ece..7c55353 100644 from constants import * import metalink +@@ -104,7 +107,7 @@ class YumPackageSack(packageSack.PackageSack): + if repo in self.added: + if 'metadata' not in self.added[repo]: + raise Errors.RepoError, '%s md for %s imported before primary' \ +- % (datatype, repo.id) ++ % (datatype, repo.ui_id) + current = 0 + for pkgid in dataobj: + current += 1 @@ -121,6 +124,25 @@ class YumPackageSack(packageSack.PackageSack): # umm, wtf? pass @@ -159545,16 +159603,18 @@ index e5e9ece..7c55353 100644 def close(self): if self._sack is not None: self.sack.close() -@@ -350,7 +434,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -350,6 +434,10 @@ class YumRepository(Repository, config.RepoConf): return thisdata.location def __str__(self): -- return self.id -+ return self.ui_id ++ # Note: You might expect this to be .ui_id, except people got used to ++ # the fact that str(repo) == repo.id and used the former instead of ++ # the later when they wanted just the .id. So we have to live with it ++ # and use .ui_id explicitly. + return self.id def _checksum(self, sumtype, file, CHUNK=2**16, checksum_can_fail=False, - datasize=None): -@@ -378,7 +462,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -378,7 +466,7 @@ class YumRepository(Repository, config.RepoConf): 'basecachedir', 'http_headers', 'metadata_cookie', 'metadata_cookie_fn', 'quick_enable_disable', 'repoMDFile', 'timestamp_check', 'urls', 'mirrorurls', @@ -159563,7 +159623,16 @@ index e5e9ece..7c55353 100644 for attr in dir(self): if attr.startswith('_'): continue -@@ -431,25 +515,18 @@ class YumRepository(Repository, config.RepoConf): +@@ -422,7 +510,7 @@ class YumRepository(Repository, config.RepoConf): + on then raise a repo error""" + if len(self._urls) < 1 and not self.mediaid: + raise Errors.RepoError, \ +- 'Cannot find a valid baseurl for repo: %s' % self.id ++ 'Cannot find a valid baseurl for repo: %s' % self.ui_id + + def doProxyDict(self): + if self._proxy_dict: +@@ -431,25 +519,18 @@ class YumRepository(Repository, config.RepoConf): self._proxy_dict = {} # zap it proxy_string = None empty = (None, '_none_', '') @@ -159597,7 +159666,7 @@ index e5e9ece..7c55353 100644 if proxy_string is not None: self._proxy_dict['http'] = proxy_string -@@ -483,13 +560,30 @@ class YumRepository(Repository, config.RepoConf): +@@ -483,13 +564,30 @@ class YumRepository(Repository, config.RepoConf): ugopts = self._default_grabopts() self._grabfunc = URLGrabber(progress_obj=self.callback, @@ -159629,7 +159698,7 @@ index e5e9ece..7c55353 100644 failure_callback=self.mirror_failure_obj) def _default_grabopts(self, cache=True): -@@ -499,6 +593,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -499,6 +597,7 @@ class YumRepository(Repository, config.RepoConf): 'throttle': self.throttle, 'proxies': self.proxy_dict, 'timeout': self.timeout, @@ -159637,7 +159706,7 @@ index e5e9ece..7c55353 100644 'http_headers': tuple(self.__headersListFromDict(cache=cache)), 'ssl_verify_peer': self.sslverify, 'ssl_verify_host': self.sslverify, -@@ -714,10 +809,10 @@ class YumRepository(Repository, config.RepoConf): +@@ -714,15 +813,15 @@ class YumRepository(Repository, config.RepoConf): local = self.metalink_filename + '.tmp' if not self._metalinkCurrent(): url = misc.to_utf8(self.metalink) @@ -159646,11 +159715,17 @@ index e5e9ece..7c55353 100644 try: ug = URLGrabber(progress_obj = self.callback, **ugopts) - result = ug.urlgrab(url, local, text=self.id + "/metalink") -+ result = ug.urlgrab(url, local, text="%s/metalink" % self) ++ result = ug.urlgrab(url, local, text="%s/metalink" % self.ui_id) except urlgrabber.grabber.URLGrabError, e: if not os.path.exists(self.metalink_filename): -@@ -749,9 +844,22 @@ class YumRepository(Repository, config.RepoConf): + msg = ("Cannot retrieve metalink for repository: %s. " +- "Please verify its path and try again" % self ) ++ "Please verify its path and try again" % self.ui_id ) + raise Errors.RepoError, msg + # Now, we have an old usable metalink, so we can't move to + # a newer repomd.xml ... or checksums won't match. +@@ -749,9 +848,22 @@ class YumRepository(Repository, config.RepoConf): value), fdel=lambda self: setattr(self, "_metalink", None)) @@ -159674,16 +159749,25 @@ index e5e9ece..7c55353 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""" -@@ -768,7 +876,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -768,7 +880,7 @@ class YumRepository(Repository, config.RepoConf): if local is None or relative is None: raise Errors.RepoError, \ - "get request for Repo %s, gave no source or dest" % self.id -+ "get request for Repo %s, gave no source or dest" % self ++ "get request for Repo %s, gave no source or dest" % self.ui_id if self.cache == 1: if os.path.exists(local): # FIXME - we should figure out a way -@@ -796,6 +904,16 @@ class YumRepository(Repository, config.RepoConf): +@@ -778,7 +890,7 @@ class YumRepository(Repository, config.RepoConf): + raise Errors.RepoError, \ + "Caching enabled but no local cache of %s from %s" % (local, + +- self) ++ self.ui_id) + + if url: + (scheme, netloc, path, query, fragid) = urlparse.urlsplit(url) +@@ -796,6 +908,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,)) @@ -159700,7 +159784,7 @@ index e5e9ece..7c55353 100644 if url and scheme != "media": ugopts = self._default_grabopts(cache=cache) ug = URLGrabber(progress_obj = self.callback, -@@ -815,14 +933,11 @@ class YumRepository(Repository, config.RepoConf): +@@ -815,14 +937,11 @@ class YumRepository(Repository, config.RepoConf): range=(start, end), ) except URLGrabError, e: @@ -159717,7 +159801,7 @@ index e5e9ece..7c55353 100644 else: -@@ -835,19 +950,18 @@ class YumRepository(Repository, config.RepoConf): +@@ -835,19 +954,18 @@ class YumRepository(Repository, config.RepoConf): reget = reget, checkfunc=checkfunc, http_headers=headers, @@ -159743,7 +159827,7 @@ index e5e9ece..7c55353 100644 remote = package.relativepath local = package.localPkg() basepath = package.basepath -@@ -857,15 +971,26 @@ class YumRepository(Repository, config.RepoConf): +@@ -857,15 +975,26 @@ class YumRepository(Repository, config.RepoConf): return local misc.unlink_f(local) @@ -159771,7 +159855,16 @@ index e5e9ece..7c55353 100644 def getHeader(self, package, checkfunc = None, reget = 'simple', cache = True): -@@ -1020,7 +1145,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -991,7 +1120,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): +- raise Errors.RepoError, 'Cannot find repomd.xml file for %s' % self ++ raise Errors.RepoError, 'Cannot find repomd.xml file for %s' % self.ui_id + if self.cache or self.metadataCurrent(): + return True + return False +@@ -1020,7 +1149,7 @@ class YumRepository(Repository, config.RepoConf): if grab_can_fail: return None raise Errors.RepoError, 'Error downloading file %s: %s' % (local, e) @@ -159780,7 +159873,25 @@ index e5e9ece..7c55353 100644 misc.unlink_f(tfname) if grab_can_fail: return None -@@ -1260,6 +1385,9 @@ class YumRepository(Repository, config.RepoConf): +@@ -1047,7 +1176,7 @@ class YumRepository(Repository, config.RepoConf): + parse_can_fail = 'old_repo_XML' in self._oldRepoMDData + if parse_can_fail: + return None +- raise Errors.RepoError, 'Error importing repomd.xml from %s: %s' % (self, e) ++ raise Errors.RepoError, 'Error importing repomd.xml from %s: %s' % (self.ui_id, e) + + def _saveOldRepoXML(self, local): + """ If we have an older repomd.xml file available, save it out. """ +@@ -1074,7 +1203,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: +- raise Errors.RepoError, "Can't download or revert repomd.xml" ++ raise Errors.RepoError, "Can't download or revert repomd.xml for:" % self.ui_id + + if 'old_repo_XML' not in self._oldRepoMDData: + self._oldRepoMDData = {} +@@ -1260,6 +1389,9 @@ class YumRepository(Repository, config.RepoConf): return True def _check_db_version(self, mdtype, repoXML=None): @@ -159790,7 +159901,7 @@ index e5e9ece..7c55353 100644 if repoXML is None: repoXML = self.repoXML if mdtype in repoXML.repoData: -@@ -1277,11 +1405,11 @@ class YumRepository(Repository, config.RepoConf): +@@ -1277,11 +1409,11 @@ class YumRepository(Repository, config.RepoConf): return None if not file_check: @@ -159805,7 +159916,7 @@ index e5e9ece..7c55353 100644 if not os.path.exists(local): local = misc.decompress(local, fn_only=True) compressed = True -@@ -1302,6 +1430,17 @@ class YumRepository(Repository, config.RepoConf): +@@ -1302,6 +1434,17 @@ class YumRepository(Repository, config.RepoConf): into the delete list, this means metadata can change filename without us leaking it. """ @@ -159823,7 +159934,7 @@ index e5e9ece..7c55353 100644 def _mdtype_eq(omdtype, odata, nmdtype, ndata): """ Check if two returns from _get_mdtype_data() are equal. """ if ndata is None: -@@ -1321,6 +1460,14 @@ class YumRepository(Repository, config.RepoConf): +@@ -1321,6 +1464,14 @@ class YumRepository(Repository, config.RepoConf): return True all_mdtypes = self.retrieved.keys() @@ -159838,7 +159949,7 @@ index e5e9ece..7c55353 100644 if mdtypes is None: mdtypes = all_mdtypes -@@ -1333,8 +1480,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1333,8 +1484,7 @@ class YumRepository(Repository, config.RepoConf): # Inited twice atm. ... sue me self._oldRepoMDData['new_MD_files'] = [] @@ -159848,7 +159959,7 @@ index e5e9ece..7c55353 100644 for mdtype in all_mdtypes: (nmdtype, ndata) = self._get_mdtype_data(mdtype) -@@ -1371,43 +1517,16 @@ class YumRepository(Repository, config.RepoConf): +@@ -1371,43 +1521,16 @@ class YumRepository(Repository, config.RepoConf): # No old repomd data, but we might still have uncompressed MD if self._groupCheckDataMDValid(ndata, nmdtype, mdtype): continue @@ -159897,7 +160008,7 @@ index e5e9ece..7c55353 100644 def _groupLoadRepoXML(self, text=None, mdtypes=None): """ Retrieve the new repomd.xml from the repository, then check it -@@ -1421,7 +1540,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1421,7 +1544,7 @@ class YumRepository(Repository, config.RepoConf): self._commonRetrieveDataMD(mdtypes) def _mdpolicy2mdtypes(self): @@ -159906,7 +160017,7 @@ index e5e9ece..7c55353 100644 'group:primary' : ['primary'], 'group:small' : ["primary", "updateinfo"], 'group:main' : ["primary", "group", "filelists", -@@ -1436,6 +1555,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1436,6 +1559,7 @@ class YumRepository(Repository, config.RepoConf): if not mdtypes or 'group:all' in mdtypes: mdtypes = None else: @@ -159914,7 +160025,13 @@ index e5e9ece..7c55353 100644 mdtypes = sorted(list(mdtypes)) return mdtypes -@@ -1451,12 +1571,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1446,17 +1570,12 @@ class YumRepository(Repository, config.RepoConf): + except KeyboardInterrupt: + self._revertOldRepoXML() # Undo metadata cookie? + raise +- raise Errors.RepoError, 'Bad loadRepoXML policy: %s' % (self.mdpolicy) ++ raise Errors.RepoError, 'Bad loadRepoXML policy (for %s): %s' % (self.ui_id, self.mdpolicy) + def _getRepoXML(self): if self._repoXML: return self._repoXML @@ -159924,20 +160041,20 @@ index e5e9ece..7c55353 100644 - msg = ("Cannot retrieve repository metadata (repomd.xml) for repository: %s. " - "Please verify its path and try again" % self ) - raise Errors.RepoError, msg -+ self._loadRepoXML(text=self) ++ self._loadRepoXML(text=self.ui_id) return self._repoXML -@@ -1480,7 +1595,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1480,7 +1599,7 @@ class YumRepository(Repository, config.RepoConf): result = self._getFile(relative='repodata/repomd.xml.asc', copy_local=1, local = sigfile, - text='%s/signature' % self.id, -+ text='%s/signature' % self, ++ text='%s/signature' % self.ui_id, reget=None, checkfunc=None, cache=self.http_caching == 'all', -@@ -1514,7 +1629,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1514,7 +1633,7 @@ class YumRepository(Repository, config.RepoConf): return self._checkMD(fn, mdtype, openchecksum) def _checkMD(self, fn, mdtype, openchecksum=False, @@ -159946,7 +160063,7 @@ index e5e9ece..7c55353 100644 """ Internal function, use .checkMD() from outside yum. """ thisdata = data # So the argument name is nicer -@@ -1537,6 +1652,18 @@ class YumRepository(Repository, config.RepoConf): +@@ -1537,6 +1656,18 @@ class YumRepository(Repository, config.RepoConf): if size is not None: size = int(size) @@ -159965,7 +160082,7 @@ index e5e9ece..7c55353 100644 try: # get the local checksum l_csum = self._checksum(r_ctype, file, datasize=size) except Errors.RepoError, e: -@@ -1551,15 +1678,13 @@ class YumRepository(Repository, config.RepoConf): +@@ -1551,15 +1682,13 @@ class YumRepository(Repository, config.RepoConf): return None raise URLGrabError(-1, 'Metadata file does not match checksum') @@ -159982,7 +160099,16 @@ index e5e9ece..7c55353 100644 """ Internal function, use .retrieveMD() from outside yum. """ # Note that this can raise Errors.RepoMDError if mdtype doesn't exist # for this repo. -@@ -1597,8 +1722,10 @@ class YumRepository(Repository, config.RepoConf): +@@ -1588,7 +1717,7 @@ class YumRepository(Repository, config.RepoConf): + else: # ain't there - raise + raise Errors.RepoError, \ + "Caching enabled but no local cache of %s from %s" % (local, +- self) ++ self.ui_id) + + if (os.path.exists(local) or + self._preload_md_from_system_cache(os.path.basename(local))): +@@ -1597,8 +1726,10 @@ class YumRepository(Repository, config.RepoConf): return local # it's the same return the local one try: @@ -159995,7 +160121,7 @@ index e5e9ece..7c55353 100644 if thisdata.size is None: reget = None else: -@@ -1613,8 +1740,9 @@ class YumRepository(Repository, config.RepoConf): +@@ -1613,8 +1744,9 @@ class YumRepository(Repository, config.RepoConf): checkfunc=checkfunc, text=text, cache=self.http_caching == 'all', @@ -160007,15 +160133,18 @@ index e5e9ece..7c55353 100644 if retrieve_can_fail: return None raise -@@ -1624,7 +1752,6 @@ class YumRepository(Repository, config.RepoConf): +@@ -1622,9 +1754,8 @@ class YumRepository(Repository, config.RepoConf): + if retrieve_can_fail: + return None raise Errors.RepoError, \ - "Could not retrieve %s matching remote checksum from %s" % (local, self) +- "Could not retrieve %s matching remote checksum from %s" % (local, self) ++ "Could not retrieve %s matching remote checksum from %s" % (local, self.ui_id) else: - self.retrieved[mdtype] = 1 return local -@@ -1646,13 +1773,21 @@ class YumRepository(Repository, config.RepoConf): +@@ -1646,13 +1777,21 @@ class YumRepository(Repository, config.RepoConf): def getGroups(self): """gets groups and returns group file path for the repository, if there @@ -160040,7 +160169,7 @@ index e5e9ece..7c55353 100644 self._callbacks_changed = True def setFailureObj(self, failure_obj): -@@ -1681,7 +1816,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1681,7 +1820,7 @@ class YumRepository(Repository, config.RepoConf): print "Could not read mirrorlist %s, error was \n%s" %(url, e) content = [] for line in content: @@ -160050,7 +160179,7 @@ index e5e9ece..7c55353 100644 mirror = line.rstrip() # no more trailing \n's mirror = mirror.replace('$ARCH', '$BASEARCH') diff --git a/yumcommands.py b/yumcommands.py -index 4dcbea7..52c3127 100644 +index 4dcbea7..a2e0b1b 100644 --- a/yumcommands.py +++ b/yumcommands.py @@ -29,7 +29,7 @@ import operator @@ -161742,12 +161871,13 @@ index 4dcbea7..52c3127 100644 + """ def getNames(self): +- return ('repolist',) + """Return a list containing the names of this command. This + command can be called from the command line by using any of these names. + + :return: a list containing the names of this command + """ - return ('repolist',) ++ return ('repolist', 'repoinfo') def getUsage(self): + """Return a usage string for this command. @@ -161780,7 +161910,19 @@ index 4dcbea7..52c3127 100644 def _repo_size(repo): ret = 0 for pkg in repo.sack.returnPackages(): -@@ -866,6 +1902,13 @@ class RepoListCommand(YumCommand): +@@ -857,7 +1893,10 @@ class RepoListCommand(YumCommand): + arg = 'enabled' + extcmds = map(lambda x: x.lower(), extcmds) + +- verbose = base.verbose_logger.isEnabledFor(logginglevels.DEBUG_3) ++ if basecmd == 'repoinfo': ++ verbose = True ++ else: ++ verbose = base.verbose_logger.isEnabledFor(logginglevels.DEBUG_3) + if arg != 'disabled' or extcmds: + try: + # Setup so len(repo.sack) is correct +@@ -866,6 +1905,13 @@ class RepoListCommand(YumCommand): except yum.Errors.RepoError: if verbose: raise @@ -161794,7 +161936,7 @@ index 4dcbea7..52c3127 100644 repos = base.repos.repos.values() repos.sort() -@@ -924,111 +1967,108 @@ class RepoListCommand(YumCommand): +@@ -924,111 +1970,108 @@ class RepoListCommand(YumCommand): ui_enabled = dhibeg + _('disabled') + hiend ui_endis_wid = utf8_width(_('disabled')) @@ -161808,7 +161950,7 @@ index 4dcbea7..52c3127 100644 - cols.append((rid, repo.name, - (ui_enabled, ui_endis_wid), ui_num)) + if not verbose: -+ rid = str(repo) ++ rid = repo.ui_id # can't use str() + if enabled and repo.metalink: + mdts = repo.metalink_data.repomd.timestamp + if mdts > repo.repoXML.timestamp: @@ -161820,7 +161962,7 @@ index 4dcbea7..52c3127 100644 + md = repo.repoXML else: + md = None -+ out = [base.fmtKeyValFill(_("Repo-id : "), repo), ++ out = [base.fmtKeyValFill(_("Repo-id : "), repo.ui_id), + base.fmtKeyValFill(_("Repo-name : "), repo.name)] + + if force_show or extcmds: @@ -161994,12 +162136,12 @@ index 4dcbea7..52c3127 100644 - base.verbose_logger.log(logginglevels.DEBUG_3, - "%s\n", - "\n".join(map(misc.to_unicode, out))) -+ base.verbose_logger.log(logginglevels.DEBUG_3, "%s\n", ++ base.verbose_logger.info("%s\n", + "\n".join(map(misc.to_unicode, out))) if not verbose and cols: # Work out the first (id) and last (enabled/disalbed/count), -@@ -1088,21 +2128,54 @@ class RepoListCommand(YumCommand): +@@ -1088,21 +2131,54 @@ class RepoListCommand(YumCommand): return 0, ['repolist: ' +to_unicode(locale.format("%d", tot_num, True))] def needTs(self, base, basecmd, extcmds): @@ -162054,7 +162196,7 @@ index 4dcbea7..52c3127 100644 if len(extcmds) == 0: base.usage() raise cli.CliError -@@ -1147,28 +2220,85 @@ class HelpCommand(YumCommand): +@@ -1147,28 +2223,85 @@ class HelpCommand(YumCommand): return help_output def doCommand(self, base, basecmd, extcmds): @@ -162140,7 +162282,7 @@ index 4dcbea7..52c3127 100644 self.doneCommand(base, _("Setting up Reinstall Process")) try: return base.reinstallPkgs(extcmds) -@@ -1177,49 +2307,139 @@ class ReInstallCommand(YumCommand): +@@ -1177,49 +2310,139 @@ class ReInstallCommand(YumCommand): return 1, [to_unicode(e)] def getSummary(self): @@ -162281,7 +162423,7 @@ index 4dcbea7..52c3127 100644 vcmd = 'installed' if extcmds: vcmd = extcmds[0] -@@ -1308,7 +2528,7 @@ class VersionCommand(YumCommand): +@@ -1308,7 +2531,7 @@ class VersionCommand(YumCommand): str(data[2][grp]))) _append_repos(cols, data[3][grp]) except yum.Errors.YumBaseError, e: @@ -162290,7 +162432,7 @@ index 4dcbea7..52c3127 100644 if vcmd in ('available', 'all', 'group-available', 'group-all'): try: data = base.pkgSack.simpleVersion(not verbose, groups=groups) -@@ -1327,7 +2547,7 @@ class VersionCommand(YumCommand): +@@ -1327,7 +2550,7 @@ class VersionCommand(YumCommand): if verbose: _append_repos(cols, data[3][grp]) except yum.Errors.YumBaseError, e: @@ -162299,7 +162441,7 @@ index 4dcbea7..52c3127 100644 data = {'rid' : {}, 'ver' : {}} for (rid, ver) in cols: -@@ -1344,6 +2564,14 @@ class VersionCommand(YumCommand): +@@ -1344,6 +2567,14 @@ class VersionCommand(YumCommand): return 0, ['version'] def needTs(self, base, basecmd, extcmds): @@ -162314,7 +162456,7 @@ index 4dcbea7..52c3127 100644 vcmd = 'installed' if extcmds: vcmd = extcmds[0] -@@ -1354,23 +2582,62 @@ class VersionCommand(YumCommand): +@@ -1354,23 +2585,62 @@ class VersionCommand(YumCommand): class HistoryCommand(YumCommand): @@ -162378,7 +162520,7 @@ index 4dcbea7..52c3127 100644 return 2, ["Repeating transaction %u" % (old.tid,)] def _hcmd_undo(self, base, extcmds): -@@ -1426,12 +2693,57 @@ class HistoryCommand(YumCommand): +@@ -1426,12 +2696,57 @@ class HistoryCommand(YumCommand): def _hcmd_new(self, base, extcmds): base.history._create_db_file() @@ -162437,7 +162579,7 @@ index 4dcbea7..52c3127 100644 if extcmds and extcmds[0] not in cmds: base.logger.critical(_('Invalid history sub-command, use: %s.'), ", ".join(cmds)) -@@ -1444,6 +2756,19 @@ class HistoryCommand(YumCommand): +@@ -1444,6 +2759,19 @@ class HistoryCommand(YumCommand): raise cli.CliError def doCommand(self, base, basecmd, extcmds): @@ -162457,7 +162599,7 @@ index 4dcbea7..52c3127 100644 vcmd = 'list' if extcmds: vcmd = extcmds[0] -@@ -1468,12 +2793,26 @@ class HistoryCommand(YumCommand): +@@ -1468,12 +2796,26 @@ class HistoryCommand(YumCommand): ret = self._hcmd_rollback(base, extcmds) elif vcmd == 'new': ret = self._hcmd_new(base, extcmds) @@ -162484,7 +162626,7 @@ index 4dcbea7..52c3127 100644 vcmd = 'list' if extcmds: vcmd = extcmds[0] -@@ -1481,16 +2820,46 @@ class HistoryCommand(YumCommand): +@@ -1481,16 +2823,46 @@ class HistoryCommand(YumCommand): class CheckRpmdbCommand(YumCommand): @@ -162531,7 +162673,7 @@ index 4dcbea7..52c3127 100644 chkcmd = 'all' if extcmds: chkcmd = extcmds -@@ -1505,19 +2874,57 @@ class CheckRpmdbCommand(YumCommand): +@@ -1505,19 +2877,57 @@ class CheckRpmdbCommand(YumCommand): return rc, ['%s %s' % (basecmd, chkcmd)] def needTs(self, base, basecmd, extcmds): @@ -162589,7 +162731,7 @@ index 4dcbea7..52c3127 100644 if not extcmds: base.logger.critical(_("No saved transaction file specified.")) raise cli.CliError -@@ -1533,5 +2940,13 @@ class LoadTransactionCommand(YumCommand): +@@ -1533,5 +2943,13 @@ class LoadTransactionCommand(YumCommand): def needTs(self, base, basecmd, extcmds): diff --git a/yum.spec b/yum.spec index 96d15fd..440ce8d 100644 --- a/yum.spec +++ b/yum.spec @@ -18,7 +18,7 @@ Summary: RPM package installer/updater/manager Name: yum Version: 3.4.3 -Release: 42%{?dist} +Release: 43%{?dist} License: GPLv2+ Group: System Environment/Base Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz @@ -315,6 +315,10 @@ exit 0 %endif %changelog +* Fri Sep 7 2012 James Antill - 3.4.3-43 +- update to latest HEAD. +- Use .ui_id explicitly for backcompat. on strings, *sigh*. + * Fri Aug 31 2012 Jesse Keating - 3.4.3-42 - Fix HEAD patch, add a self. to function call From ec16d690a46d15ffb7bd30e16d7465a226eaad5f Mon Sep 17 00:00:00 2001 From: James Antill Date: Wed, 12 Sep 2012 08:08:22 -0400 Subject: [PATCH 11/24] update to latest HEAD. - Write out groupid and not optionid, for environment groups. --- yum-HEAD.patch | 52 ++++++++++++++++++++++++++++++++++++++------------ yum.spec | 6 +++++- 2 files changed, 45 insertions(+), 13 deletions(-) diff --git a/yum-HEAD.patch b/yum-HEAD.patch index e4c51b8..41dc2e8 100644 --- a/yum-HEAD.patch +++ b/yum-HEAD.patch @@ -154938,7 +154938,7 @@ index 7ad25ce..a9a8e53 100644 pass diff --git a/yum/comps.py b/yum/comps.py -index 65f6d5e..08e66b9 100755 +index 65f6d5e..4e765ef 100755 --- a/yum/comps.py +++ b/yum/comps.py @@ -43,6 +43,16 @@ class CompsObj(object): @@ -155096,7 +155096,7 @@ index 65f6d5e..08e66b9 100755 + msg += """ \n""" + msg += """ \n""" + for grp in self.options: -+ msg += """ %s\n""" % grp ++ msg += """ %s\n""" % grp + msg += """ \n""" + msg += """ \n""" + @@ -157735,7 +157735,7 @@ index aaa4f25..61aa586 100755 continue diff --git a/yum/misc.py b/yum/misc.py -index 2f6ddfe..a39a222 100644 +index 2f6ddfe..43f34f8 100644 --- a/yum/misc.py +++ b/yum/misc.py @@ -8,6 +8,7 @@ import os @@ -157872,6 +157872,15 @@ index 2f6ddfe..a39a222 100644 return out +@@ -1126,6 +1163,8 @@ def repo_gen_decompress(filename, generated_name, cached=False): + dest = os.path.dirname(filename) + dest += '/gen' + if not os.path.exists(dest): ++ if cached: ++ return None + os.makedirs(dest, mode=0755) + dest += '/' + generated_name + return decompress(filename, dest=dest, check_timestamps=True,fn_only=cached) diff --git a/yum/packageSack.py b/yum/packageSack.py index 4af563a..47832fc 100644 --- a/yum/packageSack.py @@ -159393,7 +159402,7 @@ index 2cb1acb..0586c1c 100644 for pkg in un['pkglist']: for filedata in pkg['packages']: diff --git a/yum/yumRepo.py b/yum/yumRepo.py -index e5e9ece..21f65f7 100644 +index e5e9ece..b057961 100644 --- a/yum/yumRepo.py +++ b/yum/yumRepo.py @@ -20,10 +20,12 @@ import time @@ -159487,7 +159496,7 @@ index e5e9ece..21f65f7 100644 + 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') ++ raise Errors.RepoError, '%s: Check uncompressed DB failed' % repo dobj = repo.cacheHandler.open_database(db_un_fn) @@ -159501,7 +159510,7 @@ index e5e9ece..21f65f7 100644 + gen = mymdtype + '.xml' + ret = misc.repo_gen_decompress(xml, gen, cached=repo.cache) + if not ret: -+ raise URLGrabError(-1, 'Decompress DB failed') ++ raise Errors.RepoError, '%s: Decompress DB failed' % repo + xml = ret + # Convert XML => .sqlite xmldata = repo.repoXML.getData(mymdtype) @@ -159717,7 +159726,8 @@ index e5e9ece..21f65f7 100644 - result = ug.urlgrab(url, local, text=self.id + "/metalink") + result = ug.urlgrab(url, local, text="%s/metalink" % self.ui_id) - except urlgrabber.grabber.URLGrabError, e: +- except urlgrabber.grabber.URLGrabError, e: ++ except URLGrabError, e: if not os.path.exists(self.metalink_filename): msg = ("Cannot retrieve metalink for repository: %s. " - "Please verify its path and try again" % self ) @@ -159974,14 +159984,14 @@ index e5e9ece..21f65f7 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... - remote_size += int(ndata.size) -- ++ def _commonRetrieveDataMD_done(self, downloading): ++ """ Uncompress the downloaded metadata """ + - for (ndata, nmdtype) in downloading_with_size: - urlgrabber.progress.text_meter_total_size(remote_size, local_size) - if not self._retrieveMD(nmdtype, retrieve_can_fail=True): @@ -160155,7 +160165,7 @@ index e5e9ece..21f65f7 100644 + fn = self._retrieveMD('group_gz', retrieve_can_fail=True) + if fn: + try: -+ fn = misc.repo_gen_decompress(fn, 'comps.xml') ++ fn = misc.repo_gen_decompress(fn, 'comps.xml', cached=self.cache) + except IOError, e: + logger.warning(e) + fn = None @@ -160178,6 +160188,24 @@ index e5e9ece..21f65f7 100644 continue mirror = line.rstrip() # no more trailing \n's mirror = mirror.replace('$ARCH', '$BASEARCH') +@@ -1713,7 +1852,7 @@ class YumRepository(Repository, config.RepoConf): + ugopts = self._default_grabopts() + try: + fo = urlgrabber.grabber.urlopen(url, **ugopts) +- except urlgrabber.grabber.URLGrabError, e: ++ except URLGrabError, e: + print "Could not retrieve mirrorlist %s error was\n%s: %s" % (url, e.args[0], misc.to_unicode(e.args[1])) + fo = None + +@@ -1877,7 +2016,7 @@ def getMirrorList(mirrorlist, pdict = None): + + try: + fo = urlresolver.urlopen(url, proxies=pdict) +- except urlgrabber.grabber.URLGrabError, e: ++ except URLGrabError, e: + print "Could not retrieve mirrorlist %s error was\n%s: %s" % (url, e.args[0], misc.to_unicode(e.args[1])) + fo = None + diff --git a/yumcommands.py b/yumcommands.py index 4dcbea7..a2e0b1b 100644 --- a/yumcommands.py diff --git a/yum.spec b/yum.spec index 440ce8d..f432d12 100644 --- a/yum.spec +++ b/yum.spec @@ -18,7 +18,7 @@ Summary: RPM package installer/updater/manager Name: yum Version: 3.4.3 -Release: 43%{?dist} +Release: 44%{?dist} License: GPLv2+ Group: System Environment/Base Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz @@ -315,6 +315,10 @@ exit 0 %endif %changelog +* Wed Sep 12 2012 James Antill - 3.4.3-44 +- update to latest HEAD. +- Write out groupid and not optionid, for environment groups. + * Fri Sep 7 2012 James Antill - 3.4.3-43 - update to latest HEAD. - Use .ui_id explicitly for backcompat. on strings, *sigh*. From d7f313512e616b5f74b443e86526fd1865766ab1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zden=C4=9Bk=20Pavlas?= Date: Tue, 2 Oct 2012 13:24:53 +0200 Subject: [PATCH 12/24] Update to latest HEAD --- yum-HEAD.patch | 450 +++++++++++++++++++++++++++---------------------- yum.spec | 11 +- 2 files changed, 260 insertions(+), 201 deletions(-) diff --git a/yum-HEAD.patch b/yum-HEAD.patch index 41dc2e8..a2b10b9 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..adc3516 +index 6056d38..cf2c369 --- a/cli.py +++ b/cli.py @@ -25,7 +25,7 @@ import sys @@ -384,13 +384,12 @@ index 6056d38..adc3516 stuff_to_download = True po = txmbr.po if po: -@@ -489,9 +536,21 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -489,9 +536,20 @@ class YumBaseCli(yum.YumBase, output.YumOutput): else: self.reportDownloadSize(downloadpkgs, install_only) + cfr = self.tsInfo._check_future_rpmdbv + if (cfr is not None and -+ cfr[0] == self.tsInfo.state_counter and + self.tsInfo.futureRpmDBVersion() != cfr[1]): + msg = _("future rpmdb ver mismatched saved transaction version,") + if cfr[2]: @@ -407,7 +406,7 @@ index 6056d38..adc3516 self.verbose_logger.info(_('Exiting on user Command')) return -1 -@@ -609,12 +668,14 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -609,12 +667,14 @@ class YumBaseCli(yum.YumBase, output.YumOutput): return resultobject.return_code def gpgsigcheck(self, pkgs): @@ -427,7 +426,7 @@ index 6056d38..adc3516 for po in pkgs: result, errmsg = self.sigCheckPkg(po) -@@ -623,7 +684,8 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -623,7 +683,8 @@ class YumBaseCli(yum.YumBase, output.YumOutput): continue elif result == 1: @@ -437,7 +436,7 @@ index 6056d38..adc3516 raise yum.Errors.YumBaseError, \ _('Refusing to automatically import keys when running ' \ 'unattended.\nUse "-y" to override.') -@@ -691,12 +753,62 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -691,12 +752,62 @@ class YumBaseCli(yum.YumBase, output.YumOutput): ", ".join(matches)) self.verbose_logger.log(yum.logginglevels.INFO_2, msg) @@ -506,7 +505,7 @@ index 6056d38..adc3516 # get the list of available packages # iterate over the user's list # add packages to Transaction holding class if they match. -@@ -710,11 +822,36 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -710,11 +821,36 @@ class YumBaseCli(yum.YumBase, output.YumOutput): for arg in userlist: if (arg.endswith('.rpm') and (yum.misc.re_remote_url(arg) or os.path.exists(arg))): @@ -545,7 +544,7 @@ index 6056d38..adc3516 except yum.Errors.InstallError: self.verbose_logger.log(yum.logginglevels.INFO_2, _('No package %s%s%s available.'), -@@ -723,6 +860,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -723,6 +859,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput): self._maybeYouMeant(arg) else: done = True @@ -553,7 +552,7 @@ index 6056d38..adc3516 if len(self.tsInfo) > oldcount: change = len(self.tsInfo) - oldcount return 2, [P_('%d package to install', '%d packages to install', change) % change] -@@ -732,9 +870,27 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -732,9 +869,27 @@ class YumBaseCli(yum.YumBase, output.YumOutput): return 0, [_('Nothing to do')] def updatePkgs(self, userlist, quiet=0, update_to=False): @@ -584,7 +583,7 @@ index 6056d38..adc3516 # if there is no userlist, then do global update below # this is probably 90% of the calls # if there is a userlist then it's for updating pkgs, not obsoleting -@@ -745,21 +901,18 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -745,21 +900,18 @@ class YumBaseCli(yum.YumBase, output.YumOutput): else: # go through the userlist - look for items that are local rpms. If we find them @@ -615,7 +614,7 @@ index 6056d38..adc3516 if len(self.tsInfo) > oldcount: change = len(self.tsInfo) - oldcount -@@ -770,9 +923,24 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -770,9 +922,24 @@ class YumBaseCli(yum.YumBase, output.YumOutput): # Note that we aren't in __init__ yet for a couple of reasons, but we # probably will get there for 3.2.28. def distroSyncPkgs(self, userlist): @@ -643,7 +642,7 @@ index 6056d38..adc3516 level = 'diff' if userlist and userlist[0] in ('full', 'diff', 'different'): -@@ -831,6 +999,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -831,6 +998,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput): continue nayi = napkg.yumdb_info @@ -651,7 +650,7 @@ index 6056d38..adc3516 for apkg in self.pkgSack.searchPkgTuple(napkg.pkgtup): if ('checksum_type' in nayi and 'checksum_data' in nayi and -@@ -865,15 +1034,54 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -865,15 +1033,54 @@ class YumBaseCli(yum.YumBase, output.YumOutput): else: return 0, [_('No Packages marked for Distribution Synchronization')] @@ -712,7 +711,7 @@ index 6056d38..adc3516 if not rms: self._checkMaybeYouMeant(arg, always_output=False, rpmdb_only=True) all_rms.extend(rms) -@@ -884,12 +1092,24 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -884,12 +1091,24 @@ class YumBaseCli(yum.YumBase, output.YumOutput): return 0, [_('No Packages marked for removal')] def downgradePkgs(self, userlist): @@ -740,7 +739,7 @@ index 6056d38..adc3516 for arg in userlist: if (arg.endswith('.rpm') and (yum.misc.re_remote_url(arg) or os.path.exists(arg))): -@@ -905,26 +1125,44 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -905,26 +1124,44 @@ class YumBaseCli(yum.YumBase, output.YumOutput): self.term.MODE['bold'], arg, self.term.MODE['normal']) self._maybeYouMeant(arg) @@ -789,7 +788,7 @@ index 6056d38..adc3516 except yum.Errors.ReinstallRemoveError: self._checkMaybeYouMeant(arg, always_output=False) except yum.Errors.ReinstallInstallError, e: -@@ -940,15 +1178,31 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -940,15 +1177,31 @@ class YumBaseCli(yum.YumBase, output.YumOutput): except yum.Errors.ReinstallError, e: assert False, "Shouldn't happen, but just in case" self.verbose_logger.log(yum.logginglevels.INFO_2, e) @@ -824,7 +823,7 @@ index 6056d38..adc3516 # read in each package into a YumLocalPackage Object # append it to self.localPackages # check if it can be installed or updated based on nevra versus rpmdb -@@ -972,20 +1226,25 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -972,20 +1225,25 @@ class YumBaseCli(yum.YumBase, output.YumOutput): return 0, [_('Nothing to do')] def returnPkgLists(self, extcmds, installed_available=False): @@ -864,7 +863,7 @@ index 6056d38..adc3516 special = ['available', 'installed', 'all', 'extras', 'updates', 'recent', 'obsoletes'] -@@ -1017,8 +1276,25 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -1017,8 +1275,25 @@ class YumBaseCli(yum.YumBase, output.YumOutput): return ypl def search(self, args): @@ -892,7 +891,7 @@ index 6056d38..adc3516 # call the yum module search function with lists of tags to search # and what to search for -@@ -1108,9 +1384,20 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -1108,9 +1383,20 @@ class YumBaseCli(yum.YumBase, output.YumOutput): return 0, matching def deplist(self, args): @@ -915,7 +914,7 @@ index 6056d38..adc3516 pkgs = [] for arg in args: if (arg.endswith('.rpm') and (yum.misc.re_remote_url(arg) or -@@ -1131,10 +1418,19 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -1131,10 +1417,19 @@ class YumBaseCli(yum.YumBase, output.YumOutput): return 0, [] def provides(self, args): @@ -939,7 +938,7 @@ index 6056d38..adc3516 old_sdup = self.conf.showdupesfromrepos # For output, as searchPackageProvides() is always in showdups mode self.conf.showdupesfromrepos = True -@@ -1147,6 +1443,8 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -1147,6 +1442,8 @@ class YumBaseCli(yum.YumBase, output.YumOutput): paths = set(sys.path + os.environ['PATH'].split(':')) nargs = [] for arg in args: @@ -948,7 +947,7 @@ index 6056d38..adc3516 if yum.misc.re_filename(arg) or yum.misc.re_glob(arg): continue for path in paths: -@@ -1163,20 +1461,77 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -1163,20 +1460,77 @@ class YumBaseCli(yum.YumBase, output.YumOutput): return 0, [] def resolveDepCli(self, args): @@ -1031,7 +1030,7 @@ index 6056d38..adc3516 hdrcode = pkgcode = xmlcode = dbcode = expccode = 0 pkgresults = hdrresults = xmlresults = dbresults = expcresults = [] msg = self.fmtKeyValFill(_('Cleaning repos: '), -@@ -1228,130 +1583,257 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -1228,130 +1582,257 @@ class YumBaseCli(yum.YumBase, output.YumOutput): return code, [] def returnGroupLists(self, userlist): @@ -1369,7 +1368,7 @@ index 6056d38..adc3516 except yum.Errors.GroupsError: self.logger.critical(_('Warning: Group %s does not exist.'), group_string) continue -@@ -1368,17 +1850,61 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -1368,17 +1849,61 @@ 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): @@ -1439,7 +1438,7 @@ index 6056d38..adc3516 if not pkgs_used: return 0, [_('No packages to remove from groups')] -@@ -1389,7 +1915,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -1389,7 +1914,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput): def _promptWanted(self): # shortcut for the always-off/always-on options @@ -1448,7 +1447,7 @@ index 6056d38..adc3516 return False if self.conf.alwaysprompt: return True -@@ -1400,7 +1926,6 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -1400,7 +1925,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 \ @@ -1456,7 +1455,7 @@ index 6056d38..adc3516 txmbr.name not in self.extcmds: return True -@@ -1408,11 +1933,11 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -1408,11 +1932,11 @@ class YumBaseCli(yum.YumBase, output.YumOutput): return False def usage(self): @@ -1470,7 +1469,7 @@ index 6056d38..adc3516 sys.stdout.write(self.optparser.get_usage()) def _installable(self, pkg, ematch=False): -@@ -1468,9 +1993,9 @@ class YumBaseCli(yum.YumBase, output.YumOutput): +@@ -1468,9 +1992,9 @@ class YumBaseCli(yum.YumBase, output.YumOutput): return False class YumOptionParser(OptionParser): @@ -1482,7 +1481,7 @@ index 6056d38..adc3516 def __init__(self,base, **kwargs): # check if this is called with a utils=True/False parameter -@@ -1488,13 +2013,23 @@ class YumOptionParser(OptionParser): +@@ -1488,13 +2012,23 @@ class YumOptionParser(OptionParser): self._addYumBasicOptions() def error(self, msg): @@ -1508,7 +1507,7 @@ index 6056d38..adc3516 try: args = _filtercmdline( ('--noplugins','--version','-q', '-v', "--quiet", "--verbose"), -@@ -1521,7 +2056,15 @@ class YumOptionParser(OptionParser): +@@ -1521,7 +2055,15 @@ class YumOptionParser(OptionParser): return ret def setupYumConfig(self, args=None): @@ -1525,7 +1524,7 @@ index 6056d38..adc3516 if not args: (opts, cmds) = self.parse_args() else: -@@ -1533,16 +2076,20 @@ class YumOptionParser(OptionParser): +@@ -1533,16 +2075,20 @@ class YumOptionParser(OptionParser): try: # config file is parsed and moving us forward # set some things in it. @@ -1551,7 +1550,7 @@ index 6056d38..adc3516 self.base.conf.cache = 1 if opts.obsoletes: -@@ -1610,10 +2157,6 @@ class YumOptionParser(OptionParser): +@@ -1610,10 +2156,6 @@ class YumOptionParser(OptionParser): self.base.usage() sys.exit(1) @@ -1562,7 +1561,7 @@ index 6056d38..adc3516 # Disable all gpg key checking, if requested. if opts.nogpgcheck: # Altering the normal configs. doesn't work too well, esp. with -@@ -1640,6 +2183,14 @@ class YumOptionParser(OptionParser): +@@ -1640,10 +2182,18 @@ class YumOptionParser(OptionParser): sys.exit(1) def getRoot(self,opts): @@ -1577,7 +1576,12 @@ index 6056d38..adc3516 self._checkAbsInstallRoot(opts) # If the conf file is inside the installroot - use that. # otherwise look for it in the normal root -@@ -1701,6 +2252,9 @@ class YumOptionParser(OptionParser): +- if opts.installroot: ++ if opts.installroot and opts.installroot.lstrip('/'): + if os.access(opts.installroot+'/'+opts.conffile, os.R_OK): + opts.conffile = opts.installroot+'/'+opts.conffile + elif opts.conffile == '/etc/yum/yum.conf': +@@ -1701,6 +2251,9 @@ class YumOptionParser(OptionParser): group.add_option("--showduplicates", dest="showdupesfromrepos", action="store_true", help=_("show duplicates, in repos, in list/search commands")) @@ -1587,7 +1591,7 @@ index 6056d38..adc3516 group.add_option("-e", "--errorlevel", dest="errorlevel", default=None, help=_("error output level"), type='int', metavar='[error level]') -@@ -1713,6 +2267,10 @@ class YumOptionParser(OptionParser): +@@ -1713,6 +2266,10 @@ class YumOptionParser(OptionParser): help=_("verbose operation")) group.add_option("-y", "--assumeyes", dest="assumeyes", action="store_true", help=_("answer yes for all questions")) @@ -1600,7 +1604,7 @@ index 6056d38..adc3516 group.add_option("--installroot", help=_("set install root"), diff --git a/completion-helper.py b/completion-helper.py new file mode 100755 -index 0000000..0e4b96b +index 0000000..05801d1 --- /dev/null +++ b/completion-helper.py @@ -0,0 +1,90 @@ @@ -1629,7 +1633,7 @@ index 0000000..0e4b96b + +import cli +import yumcommands -+from yum.Errors import GroupsError ++from yum.Errors import GroupsError, ConfigError + + +class GroupsCompletionCommand(yumcommands.GroupsCommand): @@ -1682,11 +1686,11 @@ index 0000000..0e4b96b + base.registerCommand(RepoListCompletionCommand()) + base.getOptionsConfig(args) + base.parseCommands() -+ for repo in base.repos.listEnabled(): -+ repo.skip_if_unavailable = True + try: ++ for repo in base.repos.listEnabled(): ++ repo.skip_if_unavailable = True + base.doCommands() -+ except GroupsError, e: ++ except (GroupsError, ConfigError), e: + base.logger.error(e) + +if __name__ == "__main__": @@ -2574,7 +2578,7 @@ index 1a8202a..dab01f6 100644 .IP "\fB\-\-setopt=option=value\fP" Set any config option in yum config or repo files. For options in the global diff --git a/docs/yum.conf.5 b/docs/yum.conf.5 -index 515aa73..01facf8 100644 +index 515aa73..029fa75 100644 --- a/docs/yum.conf.5 +++ b/docs/yum.conf.5 @@ -114,15 +114,27 @@ are causing problems from the transaction. @@ -2706,7 +2710,7 @@ index 515aa73..01facf8 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, -@@ -593,8 +667,50 @@ See color_list_installed_older for possible values. +@@ -593,8 +667,53 @@ See color_list_installed_older for possible values. When removing packages (by removal, update or obsoletion) go through each package's dependencies. If any of them are no longer required by any other package then also mark them to be removed. @@ -2739,12 +2743,15 @@ index 515aa73..01facf8 100644 +Should the load-ts command ignore packages that are missing. This includes +packages in the TS to be removed, which aren't installed, and packages in the +TS to be added, which aren't available. ++If this is set to true, and an rpm is missing then loadts_ignorenewrpm is ++automatically set to true. +Boolean (1, 0, True, False, yes, no) Defaults to False + +.IP +\fBloadts_ignorerpm\fR +Should the load-ts command ignore the rpmdb version (yum version nogroups) or +abort if there is a mismatch between the TS file and the current machine. ++If this is set to true, then loadts_ignorenewrpm is automatically set to true. +Boolean (1, 0, True, False, yes, no) Defaults to False + +.IP @@ -2757,7 +2764,7 @@ index 515aa73..01facf8 100644 .SH "[repository] OPTIONS" -@@ -755,6 +871,11 @@ repository. +@@ -755,6 +874,11 @@ repository. Overrides the \fBbandwidth\fR option from the [main] section for this repository. @@ -2769,7 +2776,7 @@ index 515aa73..01facf8 100644 .IP \fBsslcacert \fR -@@ -776,6 +897,10 @@ repository. +@@ -776,6 +900,10 @@ repository. Overrides the \fBsslclientkey\fR option from the [main] section for this repository. @@ -2780,7 +2787,7 @@ index 515aa73..01facf8 100644 .IP \fBmetadata_expire \fR -@@ -824,7 +949,11 @@ as greater/less than any other. defaults to 1000 +@@ -824,7 +952,11 @@ 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. @@ -151392,7 +151399,7 @@ index c1af4ad..e3e3956 100644 pass diff --git a/yum/__init__.py b/yum/__init__.py -index 99039e0..198dc6d 100644 +index 99039e0..a1b045f 100644 --- a/yum/__init__.py +++ b/yum/__init__.py @@ -46,8 +46,13 @@ import operator @@ -151857,7 +151864,16 @@ index 99039e0..198dc6d 100644 warnings.warn(_('doGroupSetup() will go away in a future version of Yum.\n'), Errors.YumFutureDeprecationWarning, stacklevel=2) -@@ -829,7 +940,7 @@ class YumBase(depsolve.Depsolve): +@@ -820,16 +931,10 @@ class YumBase(depsolve.Depsolve): + self.verbose_logger.log(logginglevels.DEBUG_4, + _('Adding group file from repository: %s'), repo) + groupfile = repo.getGroups() +- # open it up as a file object so iterparse can cope with our compressed file +- if groupfile: +- groupfile = misc.repo_gen_decompress(groupfile, 'groups.xml', +- cached=repo.cache) +- # Do we want a RepoError here? +- try: self._comps.add(groupfile) except (Errors.GroupsError,Errors.CompsException), e: @@ -151866,7 +151882,7 @@ index 99039e0..198dc6d 100644 self.logger.critical(msg) else: repo.groups_added = True -@@ -837,7 +948,10 @@ class YumBase(depsolve.Depsolve): +@@ -837,7 +942,10 @@ class YumBase(depsolve.Depsolve): if self._comps.compscount == 0: raise Errors.GroupsError, _('No Groups Available in any repository') @@ -151878,7 +151894,7 @@ index 99039e0..198dc6d 100644 self.verbose_logger.debug('group time: %0.3f' % (time.time() - group_st)) return self._comps -@@ -868,7 +982,7 @@ class YumBase(depsolve.Depsolve): +@@ -868,7 +976,7 @@ class YumBase(depsolve.Depsolve): # feed it into _tags.add() self._tags.add(repo.id, tag_sqlite) except (Errors.RepoError, Errors.PkgTagsError), e: @@ -151887,7 +151903,7 @@ index 99039e0..198dc6d 100644 self.logger.critical(msg) -@@ -881,9 +995,18 @@ class YumBase(depsolve.Depsolve): +@@ -881,9 +989,18 @@ class YumBase(depsolve.Depsolve): if self._history is None: pdb_path = self.conf.persistdir + "/history" self._history = yum.history.YumHistory(root=self.conf.installroot, @@ -151907,7 +151923,7 @@ index 99039e0..198dc6d 100644 # properties so they auto-create themselves with defaults repos = property(fget=lambda self: self._getRepos(), fset=lambda self, value: setattr(self, "_repos", value), -@@ -921,6 +1044,11 @@ class YumBase(depsolve.Depsolve): +@@ -921,6 +1038,11 @@ class YumBase(depsolve.Depsolve): fdel=lambda self: setattr(self, "_history", None), doc="Yum History Object") @@ -151919,7 +151935,7 @@ index 99039e0..198dc6d 100644 pkgtags = property(fget=lambda self: self._getTags(), fset=lambda self, value: setattr(self, "_tags",value), fdel=lambda self: setattr(self, "_tags", None), -@@ -928,9 +1056,10 @@ class YumBase(depsolve.Depsolve): +@@ -928,9 +1050,10 @@ class YumBase(depsolve.Depsolve): def doSackFilelistPopulate(self): @@ -151933,7 +151949,7 @@ index 99039e0..198dc6d 100644 necessary = False # I can't think of a nice way of doing this, we have to have the sack here -@@ -951,8 +1080,12 @@ class YumBase(depsolve.Depsolve): +@@ -951,8 +1074,12 @@ class YumBase(depsolve.Depsolve): self.repos.populateSack(mdtype='filelists') def yumUtilsMsg(self, func, prog): @@ -151948,7 +151964,7 @@ index 99039e0..198dc6d 100644 if self.rpmdb.contains(name="yum-utils"): return -@@ -964,8 +1097,17 @@ class YumBase(depsolve.Depsolve): +@@ -964,8 +1091,17 @@ class YumBase(depsolve.Depsolve): (hibeg, prog, hiend)) def buildTransaction(self, unfinished_transactions_check=True): @@ -151968,7 +151984,7 @@ index 99039e0..198dc6d 100644 if (unfinished_transactions_check and misc.find_unfinished_transactions(yumlibpath=self.conf.persistdir)): msg = _('There are unfinished transactions remaining. You might ' \ -@@ -1004,7 +1146,7 @@ class YumBase(depsolve.Depsolve): +@@ -1004,7 +1140,7 @@ class YumBase(depsolve.Depsolve): # If transaction was changed by postresolve plugins then we should run skipbroken again (rescode, restring) = self._doSkipBroken(rescode, restring, clear_skipped=False ) @@ -151977,7 +151993,7 @@ index 99039e0..198dc6d 100644 self.tsInfo.pkgSack.dropCachedData() # FIXME: This is horrible, see below and yummain. Maybe create a real -@@ -1044,6 +1186,37 @@ class YumBase(depsolve.Depsolve): +@@ -1044,6 +1180,37 @@ class YumBase(depsolve.Depsolve): if first.verEQ(other): continue msg = _('Protected multilib versions: %s != %s') @@ -152015,7 +152031,7 @@ index 99039e0..198dc6d 100644 xrestring.append(msg % (first, other)) if xrestring: rescode = 1 -@@ -1242,13 +1415,15 @@ class YumBase(depsolve.Depsolve): +@@ -1242,13 +1409,15 @@ class YumBase(depsolve.Depsolve): if None in pkgtup: return None return pkgtup @@ -152035,7 +152051,7 @@ index 99039e0..198dc6d 100644 if pkgtup is None: return self._not_found_i[pkgtup] = YumNotFoundPackage(pkgtup) -@@ -1454,8 +1629,14 @@ class YumBase(depsolve.Depsolve): +@@ -1454,8 +1623,14 @@ class YumBase(depsolve.Depsolve): return probs def runTransaction(self, cb): @@ -152051,7 +152067,7 @@ index 99039e0..198dc6d 100644 self.plugins.run('pretrans') # We may want to put this other places, eventually, but for now it's -@@ -1516,10 +1697,23 @@ class YumBase(depsolve.Depsolve): +@@ -1516,10 +1691,23 @@ class YumBase(depsolve.Depsolve): pass self._ts_save_file = None @@ -152075,7 +152091,7 @@ index 99039e0..198dc6d 100644 # make resultobject - just a plain yumgenericholder object resultobject = misc.GenericHolder() -@@ -1567,13 +1761,24 @@ class YumBase(depsolve.Depsolve): +@@ -1567,13 +1755,24 @@ class YumBase(depsolve.Depsolve): self.plugins.run('posttrans') # sync up what just happened versus what is in the rpmdb if not self.ts.isTsFlagSet(rpm.RPMTRANS_FLAG_TEST): @@ -152105,7 +152121,7 @@ index 99039e0..198dc6d 100644 # check to see that the rpmdb and the tsInfo roughly matches # push package object metadata outside of rpmdb into yumdb # delete old yumdb metadata entries -@@ -1584,9 +1789,16 @@ class YumBase(depsolve.Depsolve): +@@ -1584,9 +1783,16 @@ class YumBase(depsolve.Depsolve): # that there is not also an install of this pkg in the tsInfo (reinstall) # for any kind of install add from_repo to the yumdb, and the cmdline # and the install reason @@ -152122,7 +152138,7 @@ index 99039e0..198dc6d 100644 for txmbr in self.tsInfo: if txmbr.output_state in TS_INSTALL_STATES: if not self.rpmdb.contains(po=txmbr.po): -@@ -1596,7 +1808,9 @@ class YumBase(depsolve.Depsolve): +@@ -1596,7 +1802,9 @@ class YumBase(depsolve.Depsolve): ' but is not!' % txmbr.po)) # Note: Get Panu to do te.Failed() so we don't have to txmbr.output_state = TS_FAILED @@ -152132,7 +152148,7 @@ index 99039e0..198dc6d 100644 po = self.getInstalledPackageObject(txmbr.pkgtup) rpo = txmbr.po po.yumdb_info.from_repo = rpo.repoid -@@ -1630,6 +1844,10 @@ class YumBase(depsolve.Depsolve): +@@ -1630,6 +1838,10 @@ class YumBase(depsolve.Depsolve): if md: po.yumdb_info.from_repo_timestamp = str(md.timestamp) @@ -152143,7 +152159,7 @@ index 99039e0..198dc6d 100644 loginuid = misc.getloginuid() if txmbr.updates or txmbr.downgrades or txmbr.reinstall: if txmbr.updates: -@@ -1640,11 +1858,16 @@ class YumBase(depsolve.Depsolve): +@@ -1640,11 +1852,16 @@ class YumBase(depsolve.Depsolve): opo = po if 'installed_by' in opo.yumdb_info: po.yumdb_info.installed_by = opo.yumdb_info.installed_by @@ -152160,7 +152176,7 @@ index 99039e0..198dc6d 100644 # Remove old ones after installing new ones, so we can copy values. for txmbr in self.tsInfo: if txmbr.output_state in TS_INSTALL_STATES: -@@ -1662,10 +1885,13 @@ class YumBase(depsolve.Depsolve): +@@ -1662,10 +1879,13 @@ class YumBase(depsolve.Depsolve): ' but is not!' % txmbr.po)) # Note: Get Panu to do te.Failed() so we don't have to txmbr.output_state = TS_FAILED @@ -152174,7 +152190,7 @@ index 99039e0..198dc6d 100644 self.verbose_logger.log(logginglevels.DEBUG_2, 'What is this? %s' % txmbr.po) self.plugins.run('postverifytrans') -@@ -1680,10 +1906,11 @@ class YumBase(depsolve.Depsolve): +@@ -1680,10 +1900,11 @@ class YumBase(depsolve.Depsolve): self.verbose_logger.debug('VerifyTransaction time: %0.3f' % (time.time() - vt_st)) def costExcludePackages(self): @@ -152190,7 +152206,7 @@ index 99039e0..198dc6d 100644 # if all the repo.costs are equal then don't bother running things costs = {} for r in self.repos.listEnabled(): -@@ -1705,10 +1932,12 @@ class YumBase(depsolve.Depsolve): +@@ -1705,10 +1926,12 @@ class YumBase(depsolve.Depsolve): done = True def excludePackages(self, repo=None): @@ -152206,7 +152222,7 @@ index 99039e0..198dc6d 100644 if "all" in self.conf.disable_excludes: return -@@ -1735,9 +1964,11 @@ class YumBase(depsolve.Depsolve): +@@ -1735,9 +1958,11 @@ class YumBase(depsolve.Depsolve): self.pkgSack.addPackageExcluder(repoid, exid,'exclude.match', match) def includePackages(self, repo): @@ -152221,7 +152237,7 @@ index 99039e0..198dc6d 100644 includelist = repo.getIncludePkgList() if len(includelist) == 0: -@@ -1757,8 +1988,11 @@ class YumBase(depsolve.Depsolve): +@@ -1757,8 +1982,11 @@ class YumBase(depsolve.Depsolve): self.pkgSack.addPackageExcluder(repo.id, exid, 'exclude.marked') def doLock(self, lockfile = YUM_PID_FILE): @@ -152235,7 +152251,7 @@ index 99039e0..198dc6d 100644 if self.conf.uid != 0: # If we are a user, assume we are using the root cache ... so don't # bother locking. -@@ -1774,38 +2008,26 @@ class YumBase(depsolve.Depsolve): +@@ -1774,38 +2002,26 @@ class YumBase(depsolve.Depsolve): mypid=str(os.getpid()) while not self._lock(lockfile, mypid, 0644): @@ -152289,7 +152305,7 @@ index 99039e0..198dc6d 100644 # if we're not root then we don't lock - just return nicely # Note that we can get here from __del__, so if we haven't created # YumBase.conf we don't want to do so here as creating stuff inside -@@ -1830,31 +2052,69 @@ class YumBase(depsolve.Depsolve): +@@ -1830,31 +2046,69 @@ class YumBase(depsolve.Depsolve): self._unlock(lockfile) self._lockfile = None @@ -152369,7 +152385,7 @@ index 99039e0..198dc6d 100644 failed = False if type(fo) is types.InstanceType: -@@ -1894,9 +2154,16 @@ class YumBase(depsolve.Depsolve): +@@ -1894,9 +2148,16 @@ class YumBase(depsolve.Depsolve): def verifyChecksum(self, fo, checksumType, csum): @@ -152389,7 +152405,7 @@ index 99039e0..198dc6d 100644 try: filesum = misc.checksum(checksumType, fo) except Errors.MiscError, e: -@@ -1908,6 +2175,17 @@ class YumBase(depsolve.Depsolve): +@@ -1908,6 +2169,17 @@ class YumBase(depsolve.Depsolve): return 0 def downloadPkgs(self, pkglist, callback=None, callback_total=None): @@ -152407,7 +152423,7 @@ index 99039e0..198dc6d 100644 def mediasort(apo, bpo): # FIXME: we should probably also use the mediaid; else we # could conceivably ping-pong between different disc1's -@@ -1979,8 +2257,9 @@ class YumBase(depsolve.Depsolve): +@@ -1979,8 +2251,9 @@ class YumBase(depsolve.Depsolve): urlgrabber.progress.text_meter_total_size(remote_size) beg_download = time.time() i = 0 @@ -152418,7 +152434,7 @@ index 99039e0..198dc6d 100644 for po in remote_pkgs: # Recheck if the file is there, works around a couple of weird # edge cases. -@@ -1992,52 +2271,47 @@ class YumBase(depsolve.Depsolve): +@@ -1992,52 +2265,47 @@ class YumBase(depsolve.Depsolve): remote_size -= po.size if hasattr(urlgrabber.progress, 'text_meter_total_size'): urlgrabber.progress.text_meter_total_size(remote_size, @@ -152497,7 +152513,7 @@ index 99039e0..198dc6d 100644 if hasattr(urlgrabber.progress, 'text_meter_total_size'): urlgrabber.progress.text_meter_total_size(0) if callback_total is not None and not errors: -@@ -2052,7 +2326,22 @@ class YumBase(depsolve.Depsolve): +@@ -2052,7 +2320,22 @@ class YumBase(depsolve.Depsolve): return errors def verifyHeader(self, fo, po, raiseError): @@ -152521,7 +152537,7 @@ index 99039e0..198dc6d 100644 if type(fo) is types.InstanceType: fo = fo.filename -@@ -2076,9 +2365,12 @@ class YumBase(depsolve.Depsolve): +@@ -2076,9 +2359,12 @@ class YumBase(depsolve.Depsolve): return 1 def downloadHeader(self, po): @@ -152536,7 +152552,7 @@ index 99039e0..198dc6d 100644 if hasattr(po, 'pkgtype') and po.pkgtype == 'local': return -@@ -2122,15 +2414,17 @@ class YumBase(depsolve.Depsolve): +@@ -2122,15 +2408,17 @@ class YumBase(depsolve.Depsolve): return def sigCheckPkg(self, po): @@ -152562,7 +152578,7 @@ index 99039e0..198dc6d 100644 if self._override_sigchecks: check = False hasgpgkey = 0 -@@ -2181,6 +2475,9 @@ class YumBase(depsolve.Depsolve): +@@ -2181,6 +2469,9 @@ class YumBase(depsolve.Depsolve): return result, msg def cleanUsedHeadersPackages(self): @@ -152572,7 +152588,7 @@ index 99039e0..198dc6d 100644 filelist = [] for txmbr in self.tsInfo: if txmbr.po.state not in TS_INSTALL_STATES: -@@ -2218,27 +2515,42 @@ class YumBase(depsolve.Depsolve): +@@ -2218,27 +2509,42 @@ class YumBase(depsolve.Depsolve): _('%s removed'), fn) def cleanHeaders(self): @@ -152617,7 +152633,7 @@ index 99039e0..198dc6d 100644 cachedir = self.conf.persistdir + "/rpmdb-indexes/" if not os.path.exists(cachedir): filelist = [] -@@ -2272,8 +2584,29 @@ class YumBase(depsolve.Depsolve): +@@ -2272,8 +2578,29 @@ class YumBase(depsolve.Depsolve): def doPackageLists(self, pkgnarrow='all', patterns=None, showdups=None, ignore_case=False): @@ -152649,7 +152665,7 @@ index 99039e0..198dc6d 100644 if showdups is None: showdups = self.conf.showdupesfromrepos ygh = misc.GenericHolder(iter=pkgnarrow) -@@ -2323,10 +2656,22 @@ class YumBase(depsolve.Depsolve): +@@ -2323,10 +2650,22 @@ class YumBase(depsolve.Depsolve): key = (pkg.name, pkg.arch) if pkg.pkgtup in dinst: reinstall_available.append(pkg) @@ -152675,7 +152691,7 @@ index 99039e0..198dc6d 100644 # produce the updates list of tuples elif pkgnarrow == 'updates': -@@ -2461,14 +2806,13 @@ class YumBase(depsolve.Depsolve): +@@ -2461,14 +2800,13 @@ class YumBase(depsolve.Depsolve): def findDeps(self, pkgs): @@ -152695,7 +152711,7 @@ index 99039e0..198dc6d 100644 results = {} for pkg in pkgs: -@@ -2495,10 +2839,22 @@ class YumBase(depsolve.Depsolve): +@@ -2495,10 +2833,22 @@ class YumBase(depsolve.Depsolve): # pre 3.2.10 API used to always showdups, so that's the default atm. def searchGenerator(self, fields, criteria, showdups=True, keys=False, searchtags=True, searchrpmdb=True): @@ -152722,7 +152738,7 @@ index 99039e0..198dc6d 100644 sql_fields = [] for f in fields: sql_fields.append(RPM_TO_SQLITE.get(f, f)) -@@ -2661,6 +3017,14 @@ class YumBase(depsolve.Depsolve): +@@ -2661,6 +3011,14 @@ class YumBase(depsolve.Depsolve): yield (po, vs) def searchPackageTags(self, criteria): @@ -152737,7 +152753,7 @@ index 99039e0..198dc6d 100644 results = {} # name = [(criteria, taglist)] for c in criteria: c = c.lower() -@@ -2677,11 +3041,16 @@ class YumBase(depsolve.Depsolve): +@@ -2677,11 +3035,16 @@ class YumBase(depsolve.Depsolve): return results def searchPackages(self, fields, criteria, callback=None): @@ -152759,7 +152775,7 @@ index 99039e0..198dc6d 100644 warnings.warn(_('searchPackages() will go away in a future version of Yum.\ Use searchGenerator() instead. \n'), Errors.YumFutureDeprecationWarning, stacklevel=2) -@@ -2700,13 +3069,23 @@ class YumBase(depsolve.Depsolve): +@@ -2700,13 +3063,23 @@ class YumBase(depsolve.Depsolve): def searchPackageProvides(self, args, callback=None, callback_has_matchfor=False): @@ -152787,7 +152803,7 @@ index 99039e0..198dc6d 100644 else: isglob = True canBeFile = misc.re_filename(arg) -@@ -2723,7 +3102,7 @@ class YumBase(depsolve.Depsolve): +@@ -2723,7 +3096,7 @@ class YumBase(depsolve.Depsolve): where = self.returnPackagesByDep(arg) else: usedDepString = False @@ -152796,7 +152812,7 @@ index 99039e0..198dc6d 100644 self.verbose_logger.log(logginglevels.DEBUG_1, P_('Searching %d package', 'Searching %d packages', len(where)), len(where)) -@@ -2817,25 +3196,160 @@ class YumBase(depsolve.Depsolve): +@@ -2817,25 +3190,160 @@ class YumBase(depsolve.Depsolve): return matches @@ -152969,7 +152985,7 @@ index 99039e0..198dc6d 100644 if uservisible: if grp.user_visible: installed.append(grp) -@@ -2847,34 +3361,98 @@ class YumBase(depsolve.Depsolve): +@@ -2847,34 +3355,98 @@ class YumBase(depsolve.Depsolve): available.append(grp) else: available.append(grp) @@ -153078,7 +153094,7 @@ index 99039e0..198dc6d 100644 thesegroups = self.comps.return_groups(grpid) if not thesegroups: raise Errors.GroupsError, _("No Group named %s exists") % to_unicode(grpid) -@@ -2898,13 +3476,58 @@ class YumBase(depsolve.Depsolve): +@@ -2898,13 +3470,58 @@ class YumBase(depsolve.Depsolve): self.tsInfo.remove(txmbr.po.pkgtup) @@ -153144,7 +153160,7 @@ index 99039e0..198dc6d 100644 """ if not self.comps.has_group(grpid): -@@ -2920,6 +3543,9 @@ class YumBase(depsolve.Depsolve): +@@ -2920,6 +3537,9 @@ class YumBase(depsolve.Depsolve): if group_package_types: package_types = group_package_types @@ -153154,7 +153170,7 @@ index 99039e0..198dc6d 100644 for thisgroup in thesegroups: if thisgroup.selected: continue -@@ -2934,12 +3560,49 @@ class YumBase(depsolve.Depsolve): +@@ -2934,12 +3554,49 @@ class YumBase(depsolve.Depsolve): if 'optional' in package_types: pkgs.extend(thisgroup.optional_packages) @@ -153205,7 +153221,7 @@ index 99039e0..198dc6d 100644 except Errors.InstallError, e: self.verbose_logger.debug(_('No package named %s available to be installed'), pkg) -@@ -2953,7 +3616,9 @@ class YumBase(depsolve.Depsolve): +@@ -2953,7 +3610,9 @@ class YumBase(depsolve.Depsolve): group_conditionals = enable_group_conditionals count_cond_test = 0 @@ -153216,7 +153232,7 @@ index 99039e0..198dc6d 100644 for condreq, cond in thisgroup.conditional_packages.iteritems(): if self.isPackageInstalled(cond): try: -@@ -2990,17 +3655,22 @@ class YumBase(depsolve.Depsolve): +@@ -2990,17 +3649,22 @@ class YumBase(depsolve.Depsolve): if cond not in self.tsInfo.conditionals: self.tsInfo.conditionals[cond] = [] self.tsInfo.conditionals[cond].extend(pkgs) @@ -153245,7 +153261,7 @@ index 99039e0..198dc6d 100644 if not self.comps.has_group(grpid): raise Errors.GroupsError, _("No Group named %s exists") % to_unicode(grpid) -@@ -3008,7 +3678,8 @@ class YumBase(depsolve.Depsolve): +@@ -3008,7 +3672,8 @@ class YumBase(depsolve.Depsolve): thesegroups = self.comps.return_groups(grpid) if not thesegroups: raise Errors.GroupsError, _("No Group named %s exists") % to_unicode(grpid) @@ -153255,7 +153271,7 @@ index 99039e0..198dc6d 100644 for thisgroup in thesegroups: thisgroup.selected = False -@@ -3034,13 +3705,102 @@ class YumBase(depsolve.Depsolve): +@@ -3034,13 +3699,102 @@ class YumBase(depsolve.Depsolve): for pkg in self.tsInfo.conditionals.get(txmbr.name, []): self.tsInfo.remove(pkg.pkgtup) @@ -153364,7 +153380,7 @@ index 99039e0..198dc6d 100644 # look it up in the self.localPackages first: for po in self.localPackages: if po.pkgtup == pkgtup: -@@ -3049,7 +3809,7 @@ class YumBase(depsolve.Depsolve): +@@ -3049,7 +3803,7 @@ class YumBase(depsolve.Depsolve): pkgs = self.pkgSack.searchPkgTuple(pkgtup) if len(pkgs) == 0: @@ -153373,7 +153389,7 @@ index 99039e0..198dc6d 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 +3825,21 @@ class YumBase(depsolve.Depsolve): +@@ -3065,13 +3819,21 @@ class YumBase(depsolve.Depsolve): return result def getInstalledPackageObject(self, pkgtup): @@ -153400,7 +153416,7 @@ index 99039e0..198dc6d 100644 raise Errors.RpmDBError, _('Package tuple %s could not be found in rpmdb') % str(pkgtup) # Dito. FIXME from getPackageObject() for len() > 1 ... :) -@@ -3079,9 +3847,11 @@ class YumBase(depsolve.Depsolve): +@@ -3079,9 +3841,11 @@ class YumBase(depsolve.Depsolve): return po def gpgKeyCheck(self): @@ -153414,7 +153430,7 @@ index 99039e0..198dc6d 100644 gpgkeyschecked = self.conf.cachedir + '/.gpgkeyschecked.yum' if os.path.exists(gpgkeyschecked): return 1 -@@ -3106,9 +3876,13 @@ class YumBase(depsolve.Depsolve): +@@ -3106,9 +3870,13 @@ class YumBase(depsolve.Depsolve): return 1 def returnPackagesByDep(self, depstring): @@ -153430,7 +153446,7 @@ index 99039e0..198dc6d 100644 if not depstring: return [] -@@ -3135,9 +3909,16 @@ class YumBase(depsolve.Depsolve): +@@ -3135,9 +3903,16 @@ class YumBase(depsolve.Depsolve): return self.pkgSack.getProvides(depname, depflags, depver).keys() def returnPackageByDep(self, depstring): @@ -153450,7 +153466,7 @@ index 99039e0..198dc6d 100644 # we get all sorts of randomness here errstring = depstring if type(depstring) not in types.StringTypes: -@@ -3149,16 +3930,22 @@ class YumBase(depsolve.Depsolve): +@@ -3149,16 +3924,22 @@ class YumBase(depsolve.Depsolve): raise Errors.YumBaseError, _('No Package found for %s') % errstring ps = ListPackageSack(pkglist) @@ -153477,7 +153493,7 @@ index 99039e0..198dc6d 100644 if not depstring: return [] -@@ -3184,12 +3971,47 @@ class YumBase(depsolve.Depsolve): +@@ -3184,12 +3965,47 @@ class YumBase(depsolve.Depsolve): return self.rpmdb.getProvides(depname, depflags, depver).keys() @@ -153527,7 +153543,7 @@ index 99039e0..198dc6d 100644 if len(pkglist) == 0: -@@ -3198,14 +4020,23 @@ class YumBase(depsolve.Depsolve): +@@ -3198,14 +4014,23 @@ class YumBase(depsolve.Depsolve): if len(pkglist) == 1: return pkglist[0] @@ -153557,7 +153573,7 @@ index 99039e0..198dc6d 100644 returnlist = [] compatArchList = self.arch.get_arch_list(arch) multiLib = [] -@@ -3222,9 +4053,9 @@ class YumBase(depsolve.Depsolve): +@@ -3222,9 +4047,9 @@ class YumBase(depsolve.Depsolve): singleLib.append(po) # we now have three lists. find the best package(s) of each @@ -153570,7 +153586,7 @@ index 99039e0..198dc6d 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 +4069,7 @@ class YumBase(depsolve.Depsolve): +@@ -3238,7 +4063,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: @@ -153579,7 +153595,7 @@ index 99039e0..198dc6d 100644 if best.arch == "noarch": returnlist.append(no) else: -@@ -3246,7 +4077,7 @@ class YumBase(depsolve.Depsolve): +@@ -3246,7 +4071,7 @@ class YumBase(depsolve.Depsolve): if single: returnlist.append(single) # similar for the non-multilib case elif single: @@ -153588,7 +153604,7 @@ index 99039e0..198dc6d 100644 if best.arch == "noarch": returnlist.append(no) else: -@@ -3350,28 +4181,58 @@ class YumBase(depsolve.Depsolve): +@@ -3350,28 +4175,58 @@ class YumBase(depsolve.Depsolve): done = True slow = next_func(slow) @@ -153652,7 +153668,7 @@ index 99039e0..198dc6d 100644 try: txmbrs = self.groupRemove(group_string) except yum.Errors.GroupsError: -@@ -3387,6 +4248,8 @@ class YumBase(depsolve.Depsolve): +@@ -3387,6 +4242,8 @@ class YumBase(depsolve.Depsolve): assert pattern[0] == '@' grpid = pattern[1:] @@ -153661,7 +153677,7 @@ index 99039e0..198dc6d 100644 thesegroups = self.comps.return_groups(grpid) if not thesegroups: raise Errors.GroupsError, _("No Group named %s exists") % to_unicode(grpid) -@@ -3398,7 +4261,11 @@ class YumBase(depsolve.Depsolve): +@@ -3398,7 +4255,11 @@ class YumBase(depsolve.Depsolve): def _minus_deselect(self, pattern): """ Remove things from the transaction, like kickstart. """ assert pattern[0] == '-' @@ -153674,7 +153690,7 @@ index 99039e0..198dc6d 100644 if pat and pat[0] == '@': pat = pat[1:] -@@ -3437,14 +4304,61 @@ class YumBase(depsolve.Depsolve): +@@ -3437,14 +4298,61 @@ class YumBase(depsolve.Depsolve): if flag not in self.tsInfo.probFilterFlags: self.tsInfo.probFilterFlags.append(flag) @@ -153742,7 +153758,7 @@ index 99039e0..198dc6d 100644 pkgs = [] was_pattern = False if po: -@@ -3477,20 +4391,12 @@ class YumBase(depsolve.Depsolve): +@@ -3477,20 +4385,12 @@ class YumBase(depsolve.Depsolve): self.verbose_logger.debug(_('Checking for virtual provide or file-provide for %s'), arg) @@ -153769,7 +153785,7 @@ index 99039e0..198dc6d 100644 else: nevra_dict = self._nevra_kwarg_parse(kwargs) -@@ -3577,8 +4483,8 @@ class YumBase(depsolve.Depsolve): +@@ -3577,8 +4477,8 @@ class YumBase(depsolve.Depsolve): continue # make sure this shouldn't be passed to update: @@ -153780,7 +153796,7 @@ index 99039e0..198dc6d 100644 txmbrs = self.update(po=po) tx_return.extend(txmbrs) continue -@@ -3587,7 +4493,7 @@ class YumBase(depsolve.Depsolve): +@@ -3587,7 +4487,7 @@ class YumBase(depsolve.Depsolve): # something else in the repo. Unless there is a obsoletion loop, # at which point ignore everything. obsoleting_pkg = None @@ -153789,7 +153805,7 @@ index 99039e0..198dc6d 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 +4506,23 @@ class YumBase(depsolve.Depsolve): +@@ -3600,23 +4500,23 @@ class YumBase(depsolve.Depsolve): already_obs = pkgs[0] if already_obs: @@ -153820,7 +153836,7 @@ index 99039e0..198dc6d 100644 continue # make sure we don't have a name.arch of this already installed -@@ -3630,7 +4536,7 @@ class YumBase(depsolve.Depsolve): +@@ -3630,7 +4530,7 @@ class YumBase(depsolve.Depsolve): found = True break if not found: @@ -153829,7 +153845,7 @@ index 99039e0..198dc6d 100644 txmbrs = self.update(po=po) tx_return.extend(txmbrs) continue -@@ -3719,19 +4625,47 @@ class YumBase(depsolve.Depsolve): +@@ -3719,19 +4619,47 @@ class YumBase(depsolve.Depsolve): return txmbr def update(self, po=None, requiringPo=None, update_to=False, **kwargs): @@ -153884,7 +153900,7 @@ index 99039e0..198dc6d 100644 tx_return = [] if not po and not kwargs: # update everything (the easy case) self.verbose_logger.log(logginglevels.DEBUG_2, _('Updating Everything')) -@@ -3765,7 +4699,14 @@ class YumBase(depsolve.Depsolve): +@@ -3765,7 +4693,14 @@ class YumBase(depsolve.Depsolve): if new is None: continue tx_return.extend(self.update(po=new)) @@ -153900,7 +153916,7 @@ index 99039e0..198dc6d 100644 return tx_return # complications -@@ -3787,7 +4728,7 @@ class YumBase(depsolve.Depsolve): +@@ -3787,7 +4722,7 @@ class YumBase(depsolve.Depsolve): return self._minus_deselect(kwargs['pattern']) if kwargs['pattern'] and kwargs['pattern'][0] == '@': @@ -153909,7 +153925,7 @@ index 99039e0..198dc6d 100644 arg = kwargs['pattern'] if not update_to: -@@ -3843,7 +4784,7 @@ class YumBase(depsolve.Depsolve): +@@ -3843,7 +4778,7 @@ class YumBase(depsolve.Depsolve): availpkgs = self._compare_providers(availpkgs, requiringPo) availpkgs = map(lambda x: x[0], availpkgs) elif not availpkgs: @@ -153918,7 +153934,7 @@ index 99039e0..198dc6d 100644 # for any thing specified # get the list of available pkgs matching it (or take the po) -@@ -3920,6 +4861,18 @@ class YumBase(depsolve.Depsolve): +@@ -3920,6 +4855,18 @@ class YumBase(depsolve.Depsolve): tx_return.append(txmbr) for available_pkg in availpkgs: @@ -153937,7 +153953,7 @@ index 99039e0..198dc6d 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 +4938,18 @@ class YumBase(depsolve.Depsolve): +@@ -3985,11 +4932,18 @@ class YumBase(depsolve.Depsolve): return tx_return def remove(self, po=None, **kwargs): @@ -153961,7 +153977,7 @@ index 99039e0..198dc6d 100644 if not po and not kwargs: raise Errors.RemoveError, 'Nothing specified to remove' -@@ -4055,17 +5015,19 @@ class YumBase(depsolve.Depsolve): +@@ -4055,17 +5009,19 @@ class YumBase(depsolve.Depsolve): return tx_return def installLocal(self, pkg, po=None, updateonly=False): @@ -153991,7 +154007,7 @@ index 99039e0..198dc6d 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 +5145,15 @@ class YumBase(depsolve.Depsolve): +@@ -4183,16 +5139,15 @@ class YumBase(depsolve.Depsolve): return tx_return def reinstallLocal(self, pkg, po=None): @@ -154016,7 +154032,7 @@ index 99039e0..198dc6d 100644 if not po: try: po = YumUrlPackage(self, ts=self.rpmdb.readOnlyTS(), url=pkg, -@@ -4215,9 +5176,19 @@ class YumBase(depsolve.Depsolve): +@@ -4215,9 +5170,19 @@ class YumBase(depsolve.Depsolve): return self.reinstall(po=po) def reinstall(self, po=None, **kwargs): @@ -154039,7 +154055,7 @@ index 99039e0..198dc6d 100644 self._add_prob_flags(rpm.RPMPROB_FILTER_REPLACEPKG, rpm.RPMPROB_FILTER_REPLACENEWFILES, rpm.RPMPROB_FILTER_REPLACEOLDFILES) -@@ -4259,16 +5230,15 @@ class YumBase(depsolve.Depsolve): +@@ -4259,16 +5224,15 @@ class YumBase(depsolve.Depsolve): return tx_mbrs def downgradeLocal(self, pkg, po=None): @@ -154064,7 +154080,7 @@ index 99039e0..198dc6d 100644 if not po: try: po = YumUrlPackage(self, ts=self.rpmdb.readOnlyTS(), url=pkg, -@@ -4309,13 +5279,19 @@ class YumBase(depsolve.Depsolve): +@@ -4309,13 +5273,19 @@ class YumBase(depsolve.Depsolve): return False def downgrade(self, po=None, **kwargs): @@ -154091,7 +154107,7 @@ index 99039e0..198dc6d 100644 if not po and not kwargs: raise Errors.DowngradeError, 'Nothing specified to downgrade' -@@ -4421,6 +5397,9 @@ class YumBase(depsolve.Depsolve): +@@ -4421,6 +5391,9 @@ class YumBase(depsolve.Depsolve): warned_nas.add(na) continue @@ -154101,7 +154117,7 @@ index 99039e0..198dc6d 100644 if pkg.verGE(lipkg): if na not in warned_nas: msg = _('Only Upgrade available on package: %s') % pkg -@@ -4457,7 +5436,7 @@ class YumBase(depsolve.Depsolve): +@@ -4457,7 +5430,7 @@ class YumBase(depsolve.Depsolve): if e and v and r: evr = '%s:%s-%s' % (e, v, r) elif v and r: @@ -154110,7 +154126,7 @@ index 99039e0..198dc6d 100644 elif e and v: evr = '%s:%s' % (e, v) elif v: # e and r etc. is just too weird to print -@@ -4500,12 +5479,24 @@ class YumBase(depsolve.Depsolve): +@@ -4500,12 +5473,24 @@ class YumBase(depsolve.Depsolve): return returndict @@ -154138,7 +154154,7 @@ index 99039e0..198dc6d 100644 old_conf_obs = self.conf.obsoletes self.conf.obsoletes = False done = False -@@ -4515,19 +5506,46 @@ class YumBase(depsolve.Depsolve): +@@ -4515,19 +5500,46 @@ class YumBase(depsolve.Depsolve): done = True for pkg in transaction.trans_data: if pkg.state == 'Downgrade': @@ -154185,7 +154201,7 @@ index 99039e0..198dc6d 100644 if self.install(pkgtup=pkg.pkgtup): done = True for pkg in transaction.trans_data: -@@ -4538,8 +5556,14 @@ class YumBase(depsolve.Depsolve): +@@ -4538,8 +5550,14 @@ class YumBase(depsolve.Depsolve): return done def history_undo(self, transaction): @@ -154202,7 +154218,7 @@ index 99039e0..198dc6d 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 +5640,7 @@ class YumBase(depsolve.Depsolve): +@@ -4616,7 +5634,7 @@ class YumBase(depsolve.Depsolve): except urlgrabber.grabber.URLGrabError, e: raise Errors.YumBaseError(_('GPG key retrieval failed: ') + @@ -154211,7 +154227,7 @@ index 99039e0..198dc6d 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 +5673,7 @@ class YumBase(depsolve.Depsolve): +@@ -4649,7 +5667,7 @@ class YumBase(depsolve.Depsolve): keys_info = misc.getgpgkeyinfo(rawkey, multiple=True) except ValueError, e: raise Errors.YumBaseError(_('Invalid GPG Key from %s: %s') % @@ -154220,7 +154236,7 @@ index 99039e0..198dc6d 100644 keys = [] for keyinfo in keys_info: thiskey = {} -@@ -4674,39 +5698,49 @@ class YumBase(depsolve.Depsolve): +@@ -4674,39 +5692,49 @@ class YumBase(depsolve.Depsolve): if pkgs: pkgs = sorted(pkgs)[-1] msg = (_('Importing %s key 0x%s:\n' @@ -154288,7 +154304,7 @@ index 99039e0..198dc6d 100644 user_cb_fail = False for keyurl in keyurls: keys = self._retrievePublicKey(keyurl, repo) -@@ -4725,7 +5759,9 @@ class YumBase(depsolve.Depsolve): +@@ -4725,7 +5753,9 @@ class YumBase(depsolve.Depsolve): # Try installing/updating GPG key self._getKeyImportMessage(info, keyurl) rc = False @@ -154299,7 +154315,7 @@ index 99039e0..198dc6d 100644 rc = True # grab the .sig/.asc for the keyurl, if it exists -@@ -4751,8 +5787,8 @@ class YumBase(depsolve.Depsolve): +@@ -4751,8 +5781,8 @@ class YumBase(depsolve.Depsolve): ts = self.rpmdb.readOnlyTS() result = ts.pgpImportPubkey(misc.procgpgkey(info['raw_key'])) if result != 0: @@ -154310,7 +154326,7 @@ index 99039e0..198dc6d 100644 self.logger.info(_('Key imported successfully')) key_installed = True -@@ -4760,18 +5796,20 @@ class YumBase(depsolve.Depsolve): +@@ -4760,18 +5790,20 @@ class YumBase(depsolve.Depsolve): raise Errors.YumBaseError, _("Didn't install any keys") if not key_installed: @@ -154336,7 +154352,7 @@ index 99039e0..198dc6d 100644 def _getAnyKeyForRepo(self, repo, destdir, keyurl_list, is_cakey=False, callback=None): """ -@@ -4788,6 +5826,18 @@ class YumBase(depsolve.Depsolve): +@@ -4788,6 +5820,18 @@ class YumBase(depsolve.Depsolve): """ key_installed = False @@ -154355,7 +154371,7 @@ index 99039e0..198dc6d 100644 user_cb_fail = False for keyurl in keyurl_list: keys = self._retrievePublicKey(keyurl, repo, getSig=not is_cakey) -@@ -4819,8 +5869,11 @@ class YumBase(depsolve.Depsolve): +@@ -4819,8 +5863,11 @@ class YumBase(depsolve.Depsolve): if not key_installed: self._getKeyImportMessage(info, keyurl, keytype) rc = False @@ -154368,7 +154384,7 @@ index 99039e0..198dc6d 100644 elif callback: rc = callback({"repo": repo, "userid": info['userid'], "hexkeyid": info['hexkeyid'], "keyurl": keyurl, -@@ -4835,7 +5888,8 @@ class YumBase(depsolve.Depsolve): +@@ -4835,7 +5882,8 @@ class YumBase(depsolve.Depsolve): # Import the key result = misc.import_key_to_pubring(info['raw_key'], info['hexkeyid'], gpgdir=destdir) if not result: @@ -154378,7 +154394,7 @@ index 99039e0..198dc6d 100644 self.logger.info(_('Key imported successfully')) key_installed = True # write out the key id to imported_cakeys in the repos basedir -@@ -4851,36 +5905,35 @@ class YumBase(depsolve.Depsolve): +@@ -4851,36 +5899,35 @@ class YumBase(depsolve.Depsolve): pass if not key_installed and user_cb_fail: @@ -154431,7 +154447,7 @@ index 99039e0..198dc6d 100644 self._getAnyKeyForRepo(repo, repo.gpgcadir, repo.gpgcakey, is_cakey=True, callback=callback) def _limit_installonly_pkgs(self): -@@ -4927,6 +5980,7 @@ class YumBase(depsolve.Depsolve): +@@ -4927,6 +5974,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) @@ -154439,7 +154455,7 @@ index 99039e0..198dc6d 100644 for m in self.tsInfo.getMembers(): if m.ts_state not in ('i', 'u'): continue -@@ -4937,12 +5991,21 @@ class YumBase(depsolve.Depsolve): +@@ -4937,12 +5985,21 @@ class YumBase(depsolve.Depsolve): if not po_names.intersection(install_only_names): continue @@ -154465,7 +154481,7 @@ index 99039e0..198dc6d 100644 for po in installed: if (po.version, po.release) == (cur_kernel_v, cur_kernel_r): # don't remove running -@@ -4959,19 +6022,22 @@ class YumBase(depsolve.Depsolve): +@@ -4959,19 +6016,22 @@ class YumBase(depsolve.Depsolve): txmbr.depends_on.append(rel) def processTransaction(self, callback=None,rpmTestDisplay=None, rpmDisplay=None): @@ -154501,7 +154517,7 @@ index 99039e0..198dc6d 100644 if not callback: callback = callbacks.ProcessTransNoOutputCallback() -@@ -5114,13 +6180,19 @@ class YumBase(depsolve.Depsolve): +@@ -5114,13 +6174,19 @@ class YumBase(depsolve.Depsolve): return results def add_enable_repo(self, repoid, baseurls=[], mirrorlist=None, **kwargs): @@ -154528,7 +154544,7 @@ index 99039e0..198dc6d 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 +6239,15 @@ class YumBase(depsolve.Depsolve): +@@ -5167,9 +6233,15 @@ class YumBase(depsolve.Depsolve): def setCacheDir(self, force=False, tmpdir=None, reuse=True, suffix='/$basearch/$releasever'): @@ -154547,7 +154563,7 @@ index 99039e0..198dc6d 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 +6257,7 @@ class YumBase(depsolve.Depsolve): +@@ -5179,7 +6251,7 @@ class YumBase(depsolve.Depsolve): try: cachedir = misc.getCacheDir(tmpdir, reuse) except (IOError, OSError), e: @@ -154556,7 +154572,7 @@ index 99039e0..198dc6d 100644 cachedir = None if cachedir is None: -@@ -5190,6 +6268,7 @@ class YumBase(depsolve.Depsolve): +@@ -5190,6 +6262,7 @@ class YumBase(depsolve.Depsolve): self.prerepoconf.cachedir = cachedir else: self.repos.setCacheDir(cachedir) @@ -154564,7 +154580,7 @@ index 99039e0..198dc6d 100644 self.conf.cachedir = cachedir return True # We got a new cache dir -@@ -5220,13 +6299,24 @@ class YumBase(depsolve.Depsolve): +@@ -5220,13 +6293,24 @@ class YumBase(depsolve.Depsolve): self.history.write_addon_data('config-repos', myrepos) def verify_plugins_cb(self, verify_package): @@ -154592,7 +154608,7 @@ index 99039e0..198dc6d 100644 if self.tsInfo._unresolvedMembers: if auto: self.logger.critical(_("Dependencies not solved. Will not save unresolved transaction.")) -@@ -5234,7 +6324,7 @@ class YumBase(depsolve.Depsolve): +@@ -5234,7 +6318,7 @@ class YumBase(depsolve.Depsolve): raise Errors.YumBaseError(_("Dependencies not solved. Will not save unresolved transaction.")) if not filename: @@ -154601,7 +154617,7 @@ index 99039e0..198dc6d 100644 fd,filename = tempfile.mkstemp(suffix='.yumtx', prefix=prefix) f = os.fdopen(fd, 'w') else: -@@ -5244,13 +6334,17 @@ class YumBase(depsolve.Depsolve): +@@ -5244,13 +6328,17 @@ class YumBase(depsolve.Depsolve): msg = "%s\n" % self.rpmdb.simpleVersion(main_only=True)[0] msg += "%s\n" % self.ts.getTsFlags() @@ -154622,7 +154638,7 @@ index 99039e0..198dc6d 100644 msg += "%s\n" % len(self.tsInfo.getMembers()) for txmbr in self.tsInfo.getMembers(): msg += txmbr._dump() -@@ -5260,13 +6354,25 @@ class YumBase(depsolve.Depsolve): +@@ -5260,13 +6348,25 @@ class YumBase(depsolve.Depsolve): except (IOError, OSError), e: self._ts_save_file = None if auto: @@ -154654,7 +154670,7 @@ index 99039e0..198dc6d 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 +6382,45 @@ class YumBase(depsolve.Depsolve): +@@ -5276,26 +6376,45 @@ class YumBase(depsolve.Depsolve): try: data = open(filename, 'r').readlines() except (IOError, OSError), e: @@ -154702,7 +154718,7 @@ index 99039e0..198dc6d 100644 if ignorerpm: msg += _(" ignoring, as requested.") self.logger.critical(_(msg)) -@@ -5318,8 +6443,17 @@ class YumBase(depsolve.Depsolve): +@@ -5318,8 +6437,17 @@ class YumBase(depsolve.Depsolve): numrepos = int(data[2].strip()) repos = [] rindex=3+numrepos @@ -154721,7 +154737,7 @@ index 99039e0..198dc6d 100644 # pkgs/txmbrs numpkgs = int(data[rindex].strip()) -@@ -5329,6 +6463,7 @@ class YumBase(depsolve.Depsolve): +@@ -5329,6 +6457,7 @@ class YumBase(depsolve.Depsolve): pkgcount = 0 pkgprob = False curpkg = None @@ -154729,7 +154745,22 @@ index 99039e0..198dc6d 100644 for l in data[pkgstart:]: l = l.rstrip() # our main txmbrs -@@ -5438,6 +6573,11 @@ class YumBase(depsolve.Depsolve): +@@ -5356,6 +6485,7 @@ class YumBase(depsolve.Depsolve): + if not ignoremissing: + raise Errors.YumBaseError(msg) + else: ++ ignorenewrpm = True + self.logger.critical(msg) + else: + pkgcount += 1 +@@ -5432,12 +6562,18 @@ class YumBase(depsolve.Depsolve): + if pkgprob: + msg = _("Transaction members, relations are missing or ts has been modified,") + if ignoremissing: ++ ignorenewrpm = True + msg += _(" ignoring, as requested. You must redepsolve!") + self.logger.critical(msg) + else: msg += _(" aborting.") raise Errors.YumBaseError(msg) @@ -154741,7 +154772,7 @@ index 99039e0..198dc6d 100644 return self.tsInfo.getMembers() def _remove_old_deps(self): -@@ -5470,18 +6610,6 @@ class YumBase(depsolve.Depsolve): +@@ -5470,18 +6606,6 @@ class YumBase(depsolve.Depsolve): if requiring == required: # if they are self-requiring skip them continue @@ -154760,7 +154791,7 @@ index 99039e0..198dc6d 100644 #for tbi_pkg in self.tsInfo.getMembersWithState(output_states=TS_INSTALL_STATES): # for reqtuple in tbi_pkg.po.requires: # if required.provides_for(reqtuple): -@@ -5533,7 +6661,24 @@ class YumBase(depsolve.Depsolve): +@@ -5533,7 +6657,24 @@ class YumBase(depsolve.Depsolve): # Debugging output self.verbose_logger.log(logginglevels.DEBUG_2, _("%s has revdep %s which was user-installed."), pkg, curpkg) ok_to_remove[pkg] = False @@ -154785,7 +154816,7 @@ index 99039e0..198dc6d 100644 visited[curpkg] = True all_leaves_visited = True leaves = curpkg.requiring_packages() -@@ -5547,4 +6692,3 @@ class YumBase(depsolve.Depsolve): +@@ -5547,4 +6688,3 @@ class YumBase(depsolve.Depsolve): # Debugging output self.verbose_logger.log(logginglevels.DEBUG_2, _("%s has no user-installed revdeps."), pkg) return False @@ -157735,7 +157766,7 @@ index aaa4f25..61aa586 100755 continue diff --git a/yum/misc.py b/yum/misc.py -index 2f6ddfe..43f34f8 100644 +index 2f6ddfe..0fd3e90 100644 --- a/yum/misc.py +++ b/yum/misc.py @@ -8,6 +8,7 @@ import os @@ -157872,15 +157903,19 @@ index 2f6ddfe..43f34f8 100644 return out -@@ -1126,6 +1163,8 @@ def repo_gen_decompress(filename, generated_name, cached=False): - dest = os.path.dirname(filename) - dest += '/gen' - if not os.path.exists(dest): -+ if cached: -+ return None - os.makedirs(dest, mode=0755) - dest += '/' + generated_name +@@ -1123,11 +1160,7 @@ 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. """ +- dest = os.path.dirname(filename) +- dest += '/gen' +- if not os.path.exists(dest): +- os.makedirs(dest, mode=0755) +- dest += '/' + generated_name ++ dest = os.path.dirname(filename) + '/gen/' + generated_name return decompress(filename, dest=dest, check_timestamps=True,fn_only=cached) + + def read_in_items_from_dot_dir(thisglob, line_as_list=True): diff --git a/yum/packageSack.py b/yum/packageSack.py index 4af563a..47832fc 100644 --- a/yum/packageSack.py @@ -159046,7 +159081,7 @@ index e289a7a..a4da4ab 100644 raise AttributeError, "%s has no attribute %s" % (self, attr) diff --git a/yum/rpmtrans.py b/yum/rpmtrans.py -index 9b265f9..61c9a0e 100644 +index 9b265f9..74a0f3f 100644 --- a/yum/rpmtrans.py +++ b/yum/rpmtrans.py @@ -119,7 +119,11 @@ class RPMBaseCallback: @@ -159100,8 +159135,11 @@ index 9b265f9..61c9a0e 100644 def _transStart(self, bytes, total, h): -@@ -621,3 +638,16 @@ class RPMTransaction: +@@ -619,5 +636,19 @@ class RPMTransaction: + msg = ("Non-fatal %s scriptlet failure in rpm package %s" % + (scriptlet_name, package_name)) self.display.errorlog(msg) ++ self._scriptout(package_name) # FIXME - what else should we do here? raise a failure and abort? + def _scriptStart(self, bytes, total, h): @@ -159402,7 +159440,7 @@ index 2cb1acb..0586c1c 100644 for pkg in un['pkglist']: for filedata in pkg['packages']: diff --git a/yum/yumRepo.py b/yum/yumRepo.py -index e5e9ece..b057961 100644 +index e5e9ece..9b9cc72 100644 --- a/yum/yumRepo.py +++ b/yum/yumRepo.py @@ -20,10 +20,12 @@ import time @@ -159715,6 +159753,15 @@ index e5e9ece..b057961 100644 'http_headers': tuple(self.__headersListFromDict(cache=cache)), 'ssl_verify_peer': self.sslverify, 'ssl_verify_host': self.sslverify, +@@ -561,7 +660,7 @@ class YumRepository(Repository, config.RepoConf): + cookie = self.cachedir + '/' + self.metadata_cookie_fn + self.setAttribute('_dir_setup_metadata_cookie', cookie) + +- for dir in [self.cachedir, self.pkgdir]: ++ for dir in [self.cachedir, self.cachedir + '/gen', self.pkgdir]: + self._dirSetupMkdir_p(dir) + + # persistdir is really root-only but try the make anyway and just @@ -714,15 +813,15 @@ class YumRepository(Repository, config.RepoConf): local = self.metalink_filename + '.tmp' if not self._metalinkCurrent(): @@ -159837,13 +159884,16 @@ index e5e9ece..b057961 100644 remote = package.relativepath local = package.localPkg() basepath = package.basepath -@@ -857,15 +975,26 @@ class YumRepository(Repository, config.RepoConf): +@@ -857,15 +975,29 @@ class YumRepository(Repository, config.RepoConf): return local misc.unlink_f(local) - return self._getFile(url=basepath, + if checkfunc is None: -+ checkfunc = lambda obj: package.verifyLocalPkg() ++ def checkfunc(obj): ++ if not package.verifyLocalPkg(): ++ misc.unlink_f(local) ++ raise URLGrabError(-1, _('Package does not match intended download.')) + + ret = self._getFile(url=basepath, relative=remote, @@ -159865,7 +159915,7 @@ index e5e9ece..b057961 100644 def getHeader(self, package, checkfunc = None, reget = 'simple', cache = True): -@@ -991,7 +1120,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -991,7 +1123,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): @@ -159874,7 +159924,7 @@ index e5e9ece..b057961 100644 if self.cache or self.metadataCurrent(): return True return False -@@ -1020,7 +1149,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1020,7 +1152,7 @@ class YumRepository(Repository, config.RepoConf): if grab_can_fail: return None raise Errors.RepoError, 'Error downloading file %s: %s' % (local, e) @@ -159883,7 +159933,7 @@ index e5e9ece..b057961 100644 misc.unlink_f(tfname) if grab_can_fail: return None -@@ -1047,7 +1176,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1047,7 +1179,7 @@ class YumRepository(Repository, config.RepoConf): parse_can_fail = 'old_repo_XML' in self._oldRepoMDData if parse_can_fail: return None @@ -159892,7 +159942,7 @@ index e5e9ece..b057961 100644 def _saveOldRepoXML(self, local): """ If we have an older repomd.xml file available, save it out. """ -@@ -1074,7 +1203,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1074,7 +1206,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: @@ -159901,7 +159951,7 @@ index e5e9ece..b057961 100644 if 'old_repo_XML' not in self._oldRepoMDData: self._oldRepoMDData = {} -@@ -1260,6 +1389,9 @@ class YumRepository(Repository, config.RepoConf): +@@ -1260,6 +1392,9 @@ class YumRepository(Repository, config.RepoConf): return True def _check_db_version(self, mdtype, repoXML=None): @@ -159911,7 +159961,7 @@ index e5e9ece..b057961 100644 if repoXML is None: repoXML = self.repoXML if mdtype in repoXML.repoData: -@@ -1277,11 +1409,11 @@ class YumRepository(Repository, config.RepoConf): +@@ -1277,11 +1412,11 @@ class YumRepository(Repository, config.RepoConf): return None if not file_check: @@ -159926,7 +159976,7 @@ index e5e9ece..b057961 100644 if not os.path.exists(local): local = misc.decompress(local, fn_only=True) compressed = True -@@ -1302,6 +1434,17 @@ class YumRepository(Repository, config.RepoConf): +@@ -1302,6 +1437,17 @@ class YumRepository(Repository, config.RepoConf): into the delete list, this means metadata can change filename without us leaking it. """ @@ -159944,7 +159994,7 @@ index e5e9ece..b057961 100644 def _mdtype_eq(omdtype, odata, nmdtype, ndata): """ Check if two returns from _get_mdtype_data() are equal. """ if ndata is None: -@@ -1321,6 +1464,14 @@ class YumRepository(Repository, config.RepoConf): +@@ -1321,6 +1467,14 @@ class YumRepository(Repository, config.RepoConf): return True all_mdtypes = self.retrieved.keys() @@ -159959,7 +160009,7 @@ index e5e9ece..b057961 100644 if mdtypes is None: mdtypes = all_mdtypes -@@ -1333,8 +1484,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1333,8 +1487,7 @@ class YumRepository(Repository, config.RepoConf): # Inited twice atm. ... sue me self._oldRepoMDData['new_MD_files'] = [] @@ -159969,7 +160019,7 @@ index e5e9ece..b057961 100644 for mdtype in all_mdtypes: (nmdtype, ndata) = self._get_mdtype_data(mdtype) -@@ -1371,43 +1521,16 @@ class YumRepository(Repository, config.RepoConf): +@@ -1371,43 +1524,16 @@ class YumRepository(Repository, config.RepoConf): # No old repomd data, but we might still have uncompressed MD if self._groupCheckDataMDValid(ndata, nmdtype, mdtype): continue @@ -160018,7 +160068,7 @@ index e5e9ece..b057961 100644 def _groupLoadRepoXML(self, text=None, mdtypes=None): """ Retrieve the new repomd.xml from the repository, then check it -@@ -1421,7 +1544,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1421,7 +1547,7 @@ class YumRepository(Repository, config.RepoConf): self._commonRetrieveDataMD(mdtypes) def _mdpolicy2mdtypes(self): @@ -160027,7 +160077,7 @@ index e5e9ece..b057961 100644 'group:primary' : ['primary'], 'group:small' : ["primary", "updateinfo"], 'group:main' : ["primary", "group", "filelists", -@@ -1436,6 +1559,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1436,6 +1562,7 @@ class YumRepository(Repository, config.RepoConf): if not mdtypes or 'group:all' in mdtypes: mdtypes = None else: @@ -160035,7 +160085,7 @@ index e5e9ece..b057961 100644 mdtypes = sorted(list(mdtypes)) return mdtypes -@@ -1446,17 +1570,12 @@ class YumRepository(Repository, config.RepoConf): +@@ -1446,17 +1573,12 @@ class YumRepository(Repository, config.RepoConf): except KeyboardInterrupt: self._revertOldRepoXML() # Undo metadata cookie? raise @@ -160055,7 +160105,7 @@ index e5e9ece..b057961 100644 return self._repoXML -@@ -1480,7 +1599,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1480,7 +1602,7 @@ class YumRepository(Repository, config.RepoConf): result = self._getFile(relative='repodata/repomd.xml.asc', copy_local=1, local = sigfile, @@ -160064,7 +160114,7 @@ index e5e9ece..b057961 100644 reget=None, checkfunc=None, cache=self.http_caching == 'all', -@@ -1514,7 +1633,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1514,7 +1636,7 @@ class YumRepository(Repository, config.RepoConf): return self._checkMD(fn, mdtype, openchecksum) def _checkMD(self, fn, mdtype, openchecksum=False, @@ -160073,7 +160123,7 @@ index e5e9ece..b057961 100644 """ Internal function, use .checkMD() from outside yum. """ thisdata = data # So the argument name is nicer -@@ -1537,6 +1656,18 @@ class YumRepository(Repository, config.RepoConf): +@@ -1537,6 +1659,18 @@ class YumRepository(Repository, config.RepoConf): if size is not None: size = int(size) @@ -160092,7 +160142,7 @@ index e5e9ece..b057961 100644 try: # get the local checksum l_csum = self._checksum(r_ctype, file, datasize=size) except Errors.RepoError, e: -@@ -1551,15 +1682,13 @@ class YumRepository(Repository, config.RepoConf): +@@ -1551,15 +1685,13 @@ class YumRepository(Repository, config.RepoConf): return None raise URLGrabError(-1, 'Metadata file does not match checksum') @@ -160109,7 +160159,7 @@ index e5e9ece..b057961 100644 """ Internal function, use .retrieveMD() from outside yum. """ # Note that this can raise Errors.RepoMDError if mdtype doesn't exist # for this repo. -@@ -1588,7 +1717,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1588,7 +1720,7 @@ class YumRepository(Repository, config.RepoConf): else: # ain't there - raise raise Errors.RepoError, \ "Caching enabled but no local cache of %s from %s" % (local, @@ -160118,7 +160168,7 @@ index e5e9ece..b057961 100644 if (os.path.exists(local) or self._preload_md_from_system_cache(os.path.basename(local))): -@@ -1597,8 +1726,10 @@ class YumRepository(Repository, config.RepoConf): +@@ -1597,8 +1729,10 @@ class YumRepository(Repository, config.RepoConf): return local # it's the same return the local one try: @@ -160131,7 +160181,7 @@ index e5e9ece..b057961 100644 if thisdata.size is None: reget = None else: -@@ -1613,8 +1744,9 @@ class YumRepository(Repository, config.RepoConf): +@@ -1613,8 +1747,9 @@ class YumRepository(Repository, config.RepoConf): checkfunc=checkfunc, text=text, cache=self.http_caching == 'all', @@ -160143,7 +160193,7 @@ index e5e9ece..b057961 100644 if retrieve_can_fail: return None raise -@@ -1622,9 +1754,8 @@ class YumRepository(Repository, config.RepoConf): +@@ -1622,9 +1757,8 @@ class YumRepository(Repository, config.RepoConf): if retrieve_can_fail: return None raise Errors.RepoError, \ @@ -160154,7 +160204,7 @@ index e5e9ece..b057961 100644 return local -@@ -1646,13 +1777,21 @@ class YumRepository(Repository, config.RepoConf): +@@ -1646,13 +1780,21 @@ class YumRepository(Repository, config.RepoConf): def getGroups(self): """gets groups and returns group file path for the repository, if there @@ -160179,7 +160229,7 @@ index e5e9ece..b057961 100644 self._callbacks_changed = True def setFailureObj(self, failure_obj): -@@ -1681,7 +1820,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1681,7 +1823,7 @@ class YumRepository(Repository, config.RepoConf): print "Could not read mirrorlist %s, error was \n%s" %(url, e) content = [] for line in content: @@ -160188,7 +160238,7 @@ index e5e9ece..b057961 100644 continue mirror = line.rstrip() # no more trailing \n's mirror = mirror.replace('$ARCH', '$BASEARCH') -@@ -1713,7 +1852,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1713,7 +1855,7 @@ class YumRepository(Repository, config.RepoConf): ugopts = self._default_grabopts() try: fo = urlgrabber.grabber.urlopen(url, **ugopts) @@ -160197,7 +160247,7 @@ index e5e9ece..b057961 100644 print "Could not retrieve mirrorlist %s error was\n%s: %s" % (url, e.args[0], misc.to_unicode(e.args[1])) fo = None -@@ -1877,7 +2016,7 @@ def getMirrorList(mirrorlist, pdict = None): +@@ -1877,7 +2019,7 @@ def getMirrorList(mirrorlist, pdict = None): try: fo = urlresolver.urlopen(url, proxies=pdict) diff --git a/yum.spec b/yum.spec index f432d12..7a6fd86 100644 --- a/yum.spec +++ b/yum.spec @@ -18,7 +18,7 @@ Summary: RPM package installer/updater/manager Name: yum Version: 3.4.3 -Release: 44%{?dist} +Release: 45%{?dist} License: GPLv2+ Group: System Environment/Base Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz @@ -315,6 +315,15 @@ exit 0 %endif %changelog +* Tue Oct 2 2012 Zdenek Pavlas - 3.4.3-45 +- update to latest HEAD. +- Don't skip loadts new rpmdbv check, when transaction changes. BZ 857961 +- Set ignorenewrpm to True, not False, to get it to ignore. BZ 858205. +- Actually use verifyLocalPkg(). Helps BZ 858632. +- Display script output when transaction fails. BZ 856969 +- Avoid mkdir repodir/gen/gen in misc.decompress() +- completion helper: Handle ConfigError. BZ 861264. + * Wed Sep 12 2012 James Antill - 3.4.3-44 - update to latest HEAD. - Write out groupid and not optionid, for environment groups. From 31cab97c3b6cf804dc726c138f591625e0c1bacd Mon Sep 17 00:00:00 2001 From: James Antill Date: Tue, 23 Oct 2012 16:52:56 -0400 Subject: [PATCH 13/24] update to latest HEAD. - Minor upstream fixes, mainly for ppc64p7. --- yum-HEAD.patch | 757 ++++++++++++++++++++++++++++++++++--------------- yum.spec | 12 +- 2 files changed, 540 insertions(+), 229 deletions(-) diff --git a/yum-HEAD.patch b/yum-HEAD.patch index a2b10b9..6aba05e 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..cf2c369 +index 6056d38..4122d5d --- a/cli.py +++ b/cli.py @@ -25,7 +25,7 @@ import sys @@ -1524,7 +1524,7 @@ index 6056d38..cf2c369 if not args: (opts, cmds) = self.parse_args() else: -@@ -1533,16 +2075,20 @@ class YumOptionParser(OptionParser): +@@ -1533,16 +2075,22 @@ class YumOptionParser(OptionParser): try: # config file is parsed and moving us forward # set some things in it. @@ -1535,13 +1535,16 @@ index 6056d38..cf2c369 # Handle remaining options if opts.assumeyes: - self.base.conf.assumeyes =1 -+ self.base.conf.assumeyes = 1 -+ if opts.assumeno: -+ self.base.conf.assumeno = 1 - +- - # Instead of going cache-only for a non-root user, try to use a - # user writable cachedir. If that fails fall back to cache-only. - if opts.cacheonly: ++ self.base.conf.assumeyes = 1 ++ if opts.assumeno: ++ self.base.conf.assumeno = 1 ++ self.base.conf.downloadonly = opts.dlonly ++ self.base.conf.downloaddir = opts.dldir ++ + # Treat users like root as much as possible: + if not self.base.setCacheDir(): self.base.conf.cache = 1 @@ -1550,7 +1553,7 @@ index 6056d38..cf2c369 self.base.conf.cache = 1 if opts.obsoletes: -@@ -1610,10 +2156,6 @@ class YumOptionParser(OptionParser): +@@ -1610,10 +2158,6 @@ class YumOptionParser(OptionParser): self.base.usage() sys.exit(1) @@ -1561,7 +1564,7 @@ index 6056d38..cf2c369 # Disable all gpg key checking, if requested. if opts.nogpgcheck: # Altering the normal configs. doesn't work too well, esp. with -@@ -1640,10 +2182,18 @@ class YumOptionParser(OptionParser): +@@ -1640,10 +2184,18 @@ class YumOptionParser(OptionParser): sys.exit(1) def getRoot(self,opts): @@ -1581,7 +1584,7 @@ index 6056d38..cf2c369 if os.access(opts.installroot+'/'+opts.conffile, os.R_OK): opts.conffile = opts.installroot+'/'+opts.conffile elif opts.conffile == '/etc/yum/yum.conf': -@@ -1701,6 +2251,9 @@ class YumOptionParser(OptionParser): +@@ -1701,6 +2253,9 @@ class YumOptionParser(OptionParser): group.add_option("--showduplicates", dest="showdupesfromrepos", action="store_true", help=_("show duplicates, in repos, in list/search commands")) @@ -1591,7 +1594,7 @@ index 6056d38..cf2c369 group.add_option("-e", "--errorlevel", dest="errorlevel", default=None, help=_("error output level"), type='int', metavar='[error level]') -@@ -1713,6 +2266,10 @@ class YumOptionParser(OptionParser): +@@ -1713,6 +2268,10 @@ class YumOptionParser(OptionParser): help=_("verbose operation")) group.add_option("-y", "--assumeyes", dest="assumeyes", action="store_true", help=_("answer yes for all questions")) @@ -1602,6 +1605,17 @@ index 6056d38..cf2c369 group.add_option("--version", action="store_true", help=_("show Yum version and exit")) group.add_option("--installroot", help=_("set install root"), +@@ -1748,6 +2307,10 @@ class YumOptionParser(OptionParser): + help=_("control whether color is used")) + group.add_option("", "--releasever", dest="releasever", default=None, + help=_("set value of $releasever in yum config and repo files")) ++ group.add_option("--downloadonly", dest="dlonly", action="store_true", ++ help=_("don't update, just download")) ++ group.add_option("--downloaddir", dest="dldir", default=None, ++ help=_("specifies an alternate directory to store packages")) + group.add_option("", "--setopt", dest="setopts", default=[], + action="append", help=_("set arbitrary config and repo options")) + diff --git a/completion-helper.py b/completion-helper.py new file mode 100755 index 0000000..05801d1 @@ -2297,7 +2311,7 @@ index 0000000..d2a0ed1 +if __name__ == "__main__": + generateAll(os.getcwd(), os.getcwd()) diff --git a/docs/yum.8 b/docs/yum.8 -index 1a8202a..dab01f6 100644 +index 1a8202a..65ff448 100644 --- a/docs/yum.8 +++ b/docs/yum.8 @@ -52,6 +52,7 @@ gnome\-packagekit application\&. @@ -2567,13 +2581,19 @@ index 1a8202a..dab01f6 100644 options are: 'critical', 'emergency', 'error', 'warn' and 'debug'. .br Configuration Option: \fBrpmverbosity\fP -@@ -506,7 +583,8 @@ option will corrupt your cache (and you can use $releasever in your cachedir +@@ -506,7 +583,14 @@ option will corrupt your cache (and you can use $releasever in your cachedir configuration to stop this). .PP .IP "\fB\-t, \-\-tolerant\fP" -This option currently does nothing. +This option makes yum go slower, checking for things that shouldn't be possible +making it more tolerant of external errors. ++.br ++.IP "\fB\-\-downloadonly\fP" ++Don't update, just download. ++.br ++.IP "\fB\-\-downloaddir=directory\fP" ++Specifies an alternate directory to store packages. .br .IP "\fB\-\-setopt=option=value\fP" Set any config option in yum config or repo files. For options in the global @@ -3153,7 +3173,7 @@ index c60fa08..0000000 -ts run -exit diff --git a/etc/yum.bash b/etc/yum.bash -index f1e06e8..b21c594 100644 +index f1e06e8..d484f8d 100644 --- a/etc/yum.bash +++ b/etc/yum.bash @@ -1,53 +1,17 @@ @@ -3227,16 +3247,20 @@ index f1e06e8..b21c594 100644 COMPREPLY+=( $( compgen -W '$( command grep -il "^\s*enabled\s*=\s*$val" \ /etc/yum/pluginconf.d/*.conf 2>/dev/null \ | sed -ne "s|^.*/\([^/]\{1,\}\)\.conf$|\1|p" )' -- "$2" ) ) -@@ -75,7 +39,7 @@ _yum_baseopts() +@@ -75,9 +39,10 @@ _yum_baseopts() { local opts='--help --tolerant --cacheonly --config --randomwait --debuglevel --showduplicates --errorlevel --rpmverbosity --quiet - --verbose --assumeyes --version --installroot --enablerepo + --verbose --assumeyes --assumeno --version --installroot --enablerepo --disablerepo --exclude --disableexcludes --obsoletes --noplugins - --nogpgcheck --skip-broken --color --releasever --setopt' +- --nogpgcheck --skip-broken --color --releasever --setopt' ++ --nogpgcheck --skip-broken --color --releasever --setopt --downloadonly ++ --downloaddir' [[ $COMP_LINE == *--noplugins* ]] || \ -@@ -89,6 +53,16 @@ _yum_transactions() + opts+=" --disableplugin --enableplugin" + printf %s "$opts" +@@ -89,6 +54,16 @@ _yum_transactions() sed -ne 's/^[[:space:]]*\([0-9]\{1,\}\).*/\1/p' )" -- "$cur" ) ) } @@ -3253,7 +3277,7 @@ index f1e06e8..b21c594 100644 # arguments: # 1 = current word to be completed # 2 = previous word -@@ -119,17 +93,17 @@ _yum_complete_baseopts() +@@ -119,17 +94,17 @@ _yum_complete_baseopts() ;; --enablerepo) @@ -3274,7 +3298,7 @@ index f1e06e8..b21c594 100644 COMPREPLY=( $( compgen -W '${COMPREPLY[@]} all main' -- "$1" ) ) return 0 ;; -@@ -183,16 +157,16 @@ _yum() +@@ -183,16 +158,16 @@ _yum() # Commands offered as completions local cmds=( check check-update clean deplist distro-sync downgrade @@ -3295,7 +3319,7 @@ index f1e06e8..b21c594 100644 [[ ${words[i]} == $c ]] && cmd=$c && break done done -@@ -205,13 +179,12 @@ _yum() +@@ -205,13 +180,12 @@ _yum() return 0 ;; @@ -3311,7 +3335,7 @@ index f1e06e8..b21c594 100644 COMPREPLY=( $( compgen -W 'expire-cache packages headers metadata cache dbcache all' -- "$cur" ) ) return 0 -@@ -224,59 +197,83 @@ _yum() +@@ -224,59 +198,83 @@ _yum() ;; distro-sync|distribution-synchronization) @@ -3411,7 +3435,7 @@ index f1e06e8..b21c594 100644 ;; esac return 0 -@@ -288,42 +285,56 @@ _yum() +@@ -288,42 +286,56 @@ _yum() ;; install) @@ -3475,7 +3499,7 @@ index f1e06e8..b21c594 100644 COMPREPLY=( $( compgen -W 'all installed available nogroups grouplist groupinfo' -- "$cur" ) ) return 0 -@@ -337,7 +348,11 @@ _yum() +@@ -337,7 +349,11 @@ _yum() $split && return 0 @@ -151105,10 +151129,10 @@ index 1ce4720..25e3022 gobject.threads_init() dbus.glib.threads_init() diff --git a/yum.spec b/yum.spec -index abd203f..65c62a9 100644 +index abd203f..4ad6804 100644 --- a/yum.spec +++ b/yum.spec -@@ -1,24 +1,51 @@ +@@ -1,24 +1,53 @@ -Summary: RPM installer/updater +%define move_yum_conf_back 1 +%define auto_sitelib 1 @@ -151162,11 +151186,13 @@ index abd203f..65c62a9 100644 Requires: yum-metadata-parser >= 1.1.0 -Requires: python-iniparse Requires: pygpgme ++# rawhide is >= 0.5.3-7.fc18 ... as this is added. ++Requires: pyliblzma + Conflicts: rpm >= 5-0 # Zif is a re-implementation of yum in C, however: # -@@ -34,18 +61,26 @@ Conflicts: rpm >= 5-0 +@@ -34,18 +63,28 @@ Conflicts: rpm >= 5-0 # zif experts). # # ...so we have two sane choices: i) Conflict with it. 2) Stop developing yum. @@ -151195,12 +151221,14 @@ index abd203f..65c62a9 100644 +Provides: yum-protect-packages = 1.1.27-0.yum +Provides: yum-plugin-protect-packages = 1.1.27-0.yum +Obsoletes: yum-plugin-download-order <= 0.2-2 ++Obsoletes: yum-plugin-downloadonly <= 1.1.31-6.fc19 ++Provides: yum-plugin-downloadonly = 3.4.3-44.yum +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + %description Yum is a utility that can check for and automatically download and -@@ -58,9 +93,11 @@ Group: Applications/System +@@ -58,9 +97,11 @@ Group: Applications/System Requires: yum = %{version}-%{release} Requires: dbus-python Requires: pygobject2 @@ -151214,7 +151242,7 @@ index abd203f..65c62a9 100644 Requires(postun): /sbin/service -@@ -83,18 +120,46 @@ Requires(postun): /sbin/service +@@ -83,18 +124,46 @@ Requires(postun): /sbin/service These are the files needed to run yum updates as a cron job. Install this package if you want auto yum updates nightly via cron. @@ -151263,7 +151291,7 @@ index abd203f..65c62a9 100644 # Ghost files: mkdir -p $RPM_BUILD_ROOT/var/lib/yum/history -@@ -102,12 +167,18 @@ mkdir -p $RPM_BUILD_ROOT/var/lib/yum/plugins +@@ -102,12 +171,18 @@ mkdir -p $RPM_BUILD_ROOT/var/lib/yum/plugins mkdir -p $RPM_BUILD_ROOT/var/lib/yum/yumdb touch $RPM_BUILD_ROOT/var/lib/yum/uuid @@ -151282,7 +151310,7 @@ index abd203f..65c62a9 100644 %post updatesd /sbin/chkconfig --add yum-updatesd /sbin/service yum-updatesd condrestart >/dev/null 2>&1 -@@ -119,6 +190,7 @@ if [ $1 = 0 ]; then +@@ -119,6 +194,7 @@ if [ $1 = 0 ]; then /sbin/service yum-updatesd stop >/dev/null 2>&1 fi exit 0 @@ -151290,7 +151318,7 @@ index abd203f..65c62a9 100644 %post cron -@@ -165,21 +237,30 @@ exit 0 +@@ -165,21 +241,30 @@ exit 0 %files -f %{name}.lang @@ -151326,7 +151354,7 @@ index abd203f..65c62a9 100644 %dir /var/cache/yum %dir /var/lib/yum %ghost /var/lib/yum/uuid -@@ -188,20 +269,24 @@ exit 0 +@@ -188,20 +273,24 @@ exit 0 %ghost /var/lib/yum/yumdb %{_mandir}/man*/yum.* %{_mandir}/man*/yum-shell* @@ -151358,7 +151386,7 @@ index abd203f..65c62a9 100644 %files updatesd %defattr(-, root, root) %config(noreplace) %{_sysconfdir}/yum/yum-updatesd.conf -@@ -210,8 +295,12 @@ exit 0 +@@ -210,8 +299,12 @@ exit 0 %{_datadir}/yum-cli/yumupd.py* %{_sbindir}/yum-updatesd %{_mandir}/man*/yum-updatesd* @@ -151399,10 +151427,18 @@ index c1af4ad..e3e3956 100644 pass diff --git a/yum/__init__.py b/yum/__init__.py -index 99039e0..a1b045f 100644 +index 99039e0..604ccce 100644 --- a/yum/__init__.py +++ b/yum/__init__.py -@@ -46,8 +46,13 @@ import operator +@@ -21,6 +21,7 @@ The Yum RPM software updater. + import os + import os.path + import rpm ++import sys + + def _rpm_ver_atleast(vertup): + """ Check if rpm is at least the current vertup. Can return False/True/None +@@ -46,8 +47,13 @@ import operator import tempfile import yum.i18n @@ -151418,7 +151454,7 @@ index 99039e0..a1b045f 100644 import config from config import ParsingError, ConfigParser -@@ -73,6 +78,7 @@ import logginglevels +@@ -73,6 +79,7 @@ import logginglevels import yumRepo import callbacks import yum.history @@ -151426,7 +151462,7 @@ index 99039e0..a1b045f 100644 import warnings warnings.simplefilter("ignore", Errors.YumFutureDeprecationWarning) -@@ -82,7 +88,7 @@ from packages import YumAvailablePackage, YumLocalPackage, YumInstalledPackage +@@ -82,7 +89,7 @@ from packages import YumAvailablePackage, YumLocalPackage, YumInstalledPackage from packages import YumUrlPackage, YumNotFoundPackage from constants import * from yum.rpmtrans import RPMTransaction,SimpleCliCallBack @@ -151435,7 +151471,7 @@ index 99039e0..a1b045f 100644 import string import StringIO -@@ -102,10 +108,12 @@ default_grabber.opts.user_agent += " yum/" + __version__ +@@ -102,10 +109,12 @@ default_grabber.opts.user_agent += " yum/" + __version__ class _YumPreBaseConf: @@ -151452,7 +151488,7 @@ index 99039e0..a1b045f 100644 def __init__(self): self.fn = '/etc/yum/yum.conf' self.root = '/' -@@ -125,12 +133,15 @@ class _YumPreBaseConf: +@@ -125,12 +134,15 @@ class _YumPreBaseConf: class _YumPreRepoConf: @@ -151472,7 +151508,7 @@ index 99039e0..a1b045f 100644 self.callback = None self.failure_callback = None self.interrupt_callback = None -@@ -164,11 +175,11 @@ class _YumCostExclude: +@@ -164,11 +176,11 @@ class _YumCostExclude: return False class YumBase(depsolve.Depsolve): @@ -151489,7 +151525,7 @@ index 99039e0..a1b045f 100644 def __init__(self): depsolve.Depsolve.__init__(self) self._conf = None -@@ -177,6 +188,7 @@ class YumBase(depsolve.Depsolve): +@@ -177,6 +189,7 @@ class YumBase(depsolve.Depsolve): self._up = None self._comps = None self._history = None @@ -151497,7 +151533,7 @@ index 99039e0..a1b045f 100644 self._pkgSack = None self._lockfile = None self._tags = None -@@ -204,6 +216,7 @@ class YumBase(depsolve.Depsolve): +@@ -204,6 +217,7 @@ class YumBase(depsolve.Depsolve): self.run_with_package_names = set() self._cleanup = [] @@ -151505,7 +151541,7 @@ index 99039e0..a1b045f 100644 def __del__(self): self.close() -@@ -213,10 +226,15 @@ class YumBase(depsolve.Depsolve): +@@ -213,10 +227,15 @@ class YumBase(depsolve.Depsolve): for cb in self._cleanup: cb() def close(self): @@ -151521,7 +151557,7 @@ index 99039e0..a1b045f 100644 if self._repos: self._repos.close() -@@ -225,15 +243,33 @@ class YumBase(depsolve.Depsolve): +@@ -225,15 +244,33 @@ class YumBase(depsolve.Depsolve): return transactioninfo.TransactionData() def doGenericSetup(self, cache=0): @@ -151557,7 +151593,7 @@ index 99039e0..a1b045f 100644 warnings.warn(_('doConfigSetup() will go away in a future version of Yum.\n'), Errors.YumFutureDeprecationWarning, stacklevel=2) -@@ -297,15 +333,17 @@ class YumBase(depsolve.Depsolve): +@@ -297,15 +334,17 @@ class YumBase(depsolve.Depsolve): # Try the old default fn = '/etc/yum.conf' @@ -151578,7 +151614,7 @@ index 99039e0..a1b045f 100644 if debuglevel != None: startupconf.debuglevel = debuglevel -@@ -336,6 +374,12 @@ class YumBase(depsolve.Depsolve): +@@ -336,6 +375,12 @@ class YumBase(depsolve.Depsolve): self._conf = config.readMainConfig(startupconf) @@ -151591,7 +151627,7 @@ index 99039e0..a1b045f 100644 # We don't want people accessing/altering preconf after it becomes # worthless. So we delete it, and thus. it'll raise AttributeError del self.preconf -@@ -367,22 +411,36 @@ class YumBase(depsolve.Depsolve): +@@ -367,22 +412,36 @@ class YumBase(depsolve.Depsolve): def doLoggingSetup(self, debuglevel, errorlevel, syslog_ident=None, syslog_facility=None, syslog_device='/dev/log'): @@ -151635,7 +151671,7 @@ index 99039e0..a1b045f 100644 if repo_age is None: repo_age = os.stat(repofn)[8] -@@ -391,8 +449,7 @@ class YumBase(depsolve.Depsolve): +@@ -391,8 +450,7 @@ class YumBase(depsolve.Depsolve): try: parser.readfp(confpp_obj) except ParsingError, e: @@ -151645,7 +151681,7 @@ index 99039e0..a1b045f 100644 # Check sections in the .repo file that was just slurped up for section in parser.sections(): -@@ -429,7 +486,15 @@ class YumBase(depsolve.Depsolve): +@@ -429,7 +487,15 @@ class YumBase(depsolve.Depsolve): thisrepo.base_persistdir = self.conf._repos_persistdir @@ -151662,7 +151698,7 @@ index 99039e0..a1b045f 100644 if thisrepo.id in self.repo_setopts: for opt in self.repo_setopts[thisrepo.id].items: if not hasattr(thisrepo, opt): -@@ -440,6 +505,20 @@ class YumBase(depsolve.Depsolve): +@@ -440,6 +506,20 @@ class YumBase(depsolve.Depsolve): if validate and not validate(thisrepo): continue @@ -151683,7 +151719,7 @@ index 99039e0..a1b045f 100644 # Got our list of repo objects, add them to the repos # collection try: -@@ -448,8 +527,11 @@ class YumBase(depsolve.Depsolve): +@@ -448,8 +528,11 @@ class YumBase(depsolve.Depsolve): self.logger.warning(e) def getReposFromConfig(self): @@ -151697,7 +151733,7 @@ index 99039e0..a1b045f 100644 # Read .repo files from directories specified by the reposdir option # (typically /etc/yum/repos.d) repo_config_age = self.conf.config_file_age -@@ -466,18 +548,22 @@ class YumBase(depsolve.Depsolve): +@@ -466,18 +549,22 @@ class YumBase(depsolve.Depsolve): if os.path.isdir(reposdir): for repofn in sorted(glob.glob('%s/*.repo' % reposdir)): @@ -151725,7 +151761,7 @@ index 99039e0..a1b045f 100644 repo = yumRepo.YumRepository(section) try: repo.populate(parser, section, self.conf) -@@ -493,38 +579,40 @@ class YumBase(depsolve.Depsolve): +@@ -493,38 +580,40 @@ class YumBase(depsolve.Depsolve): repo.name = to_unicode(repo.name) # Set attributes not from the config file @@ -151788,7 +151824,7 @@ index 99039e0..a1b045f 100644 if isinstance(self.plugins, plugins.YumPlugins): raise RuntimeError(_("plugins already initialised")) -@@ -533,6 +621,8 @@ class YumBase(depsolve.Depsolve): +@@ -533,6 +622,8 @@ class YumBase(depsolve.Depsolve): def doRpmDBSetup(self): @@ -151797,7 +151833,7 @@ index 99039e0..a1b045f 100644 warnings.warn(_('doRpmDBSetup() will go away in a future version of Yum.\n'), Errors.YumFutureDeprecationWarning, stacklevel=2) -@@ -552,7 +642,8 @@ class YumBase(depsolve.Depsolve): +@@ -552,7 +643,8 @@ class YumBase(depsolve.Depsolve): return self._rpmdb def closeRpmDB(self): @@ -151807,7 +151843,7 @@ index 99039e0..a1b045f 100644 if self._rpmdb is not None: self._rpmdb.ts = None self._rpmdb.dropCachedData() -@@ -567,6 +658,12 @@ class YumBase(depsolve.Depsolve): +@@ -567,6 +659,12 @@ class YumBase(depsolve.Depsolve): self._ts = None def doRepoSetup(self, thisrepo=None): @@ -151820,7 +151856,7 @@ index 99039e0..a1b045f 100644 warnings.warn(_('doRepoSetup() will go away in a future version of Yum.\n'), Errors.YumFutureDeprecationWarning, stacklevel=2) -@@ -588,7 +685,8 @@ class YumBase(depsolve.Depsolve): +@@ -588,7 +686,8 @@ class YumBase(depsolve.Depsolve): prerepoconf = self.prerepoconf del self.prerepoconf @@ -151830,7 +151866,7 @@ index 99039e0..a1b045f 100644 self.repos.callback = prerepoconf.callback self.repos.setFailureCallback(prerepoconf.failure_callback) self.repos.setInterruptCallback(prerepoconf.interrupt_callback) -@@ -630,6 +728,14 @@ class YumBase(depsolve.Depsolve): +@@ -630,6 +729,14 @@ class YumBase(depsolve.Depsolve): self._repos = RepoStorage(self) def doSackSetup(self, archlist=None, thisrepo=None): @@ -151845,7 +151881,7 @@ index 99039e0..a1b045f 100644 warnings.warn(_('doSackSetup() will go away in a future version of Yum.\n'), Errors.YumFutureDeprecationWarning, stacklevel=2) -@@ -711,6 +817,9 @@ class YumBase(depsolve.Depsolve): +@@ -711,6 +818,9 @@ class YumBase(depsolve.Depsolve): def doUpdateSetup(self): @@ -151855,7 +151891,7 @@ index 99039e0..a1b045f 100644 warnings.warn(_('doUpdateSetup() will go away in a future version of Yum.\n'), Errors.YumFutureDeprecationWarning, stacklevel=2) -@@ -765,6 +874,8 @@ class YumBase(depsolve.Depsolve): +@@ -765,6 +875,8 @@ class YumBase(depsolve.Depsolve): return self._up def doGroupSetup(self): @@ -151864,7 +151900,7 @@ index 99039e0..a1b045f 100644 warnings.warn(_('doGroupSetup() will go away in a future version of Yum.\n'), Errors.YumFutureDeprecationWarning, stacklevel=2) -@@ -820,16 +931,10 @@ class YumBase(depsolve.Depsolve): +@@ -820,16 +932,14 @@ class YumBase(depsolve.Depsolve): self.verbose_logger.log(logginglevels.DEBUG_4, _('Adding group file from repository: %s'), repo) groupfile = repo.getGroups() @@ -151874,6 +151910,10 @@ index 99039e0..a1b045f 100644 - cached=repo.cache) - # Do we want a RepoError here? - ++ if not groupfile: ++ msg = _('Failed to retrieve group file for repository: %s') % repo ++ self.logger.critical(msg) ++ continue try: self._comps.add(groupfile) except (Errors.GroupsError,Errors.CompsException), e: @@ -151882,7 +151922,7 @@ index 99039e0..a1b045f 100644 self.logger.critical(msg) else: repo.groups_added = True -@@ -837,7 +942,10 @@ class YumBase(depsolve.Depsolve): +@@ -837,7 +947,10 @@ class YumBase(depsolve.Depsolve): if self._comps.compscount == 0: raise Errors.GroupsError, _('No Groups Available in any repository') @@ -151894,7 +151934,7 @@ index 99039e0..a1b045f 100644 self.verbose_logger.debug('group time: %0.3f' % (time.time() - group_st)) return self._comps -@@ -868,7 +976,7 @@ class YumBase(depsolve.Depsolve): +@@ -868,7 +981,7 @@ class YumBase(depsolve.Depsolve): # feed it into _tags.add() self._tags.add(repo.id, tag_sqlite) except (Errors.RepoError, Errors.PkgTagsError), e: @@ -151903,7 +151943,7 @@ index 99039e0..a1b045f 100644 self.logger.critical(msg) -@@ -881,9 +989,18 @@ class YumBase(depsolve.Depsolve): +@@ -881,9 +994,18 @@ class YumBase(depsolve.Depsolve): if self._history is None: pdb_path = self.conf.persistdir + "/history" self._history = yum.history.YumHistory(root=self.conf.installroot, @@ -151923,7 +151963,7 @@ index 99039e0..a1b045f 100644 # properties so they auto-create themselves with defaults repos = property(fget=lambda self: self._getRepos(), fset=lambda self, value: setattr(self, "_repos", value), -@@ -921,6 +1038,11 @@ class YumBase(depsolve.Depsolve): +@@ -921,6 +1043,11 @@ class YumBase(depsolve.Depsolve): fdel=lambda self: setattr(self, "_history", None), doc="Yum History Object") @@ -151935,7 +151975,7 @@ index 99039e0..a1b045f 100644 pkgtags = property(fget=lambda self: self._getTags(), fset=lambda self, value: setattr(self, "_tags",value), fdel=lambda self: setattr(self, "_tags", None), -@@ -928,9 +1050,10 @@ class YumBase(depsolve.Depsolve): +@@ -928,9 +1055,10 @@ class YumBase(depsolve.Depsolve): def doSackFilelistPopulate(self): @@ -151949,7 +151989,7 @@ index 99039e0..a1b045f 100644 necessary = False # I can't think of a nice way of doing this, we have to have the sack here -@@ -951,8 +1074,12 @@ class YumBase(depsolve.Depsolve): +@@ -951,8 +1079,12 @@ class YumBase(depsolve.Depsolve): self.repos.populateSack(mdtype='filelists') def yumUtilsMsg(self, func, prog): @@ -151964,7 +152004,7 @@ index 99039e0..a1b045f 100644 if self.rpmdb.contains(name="yum-utils"): return -@@ -964,8 +1091,17 @@ class YumBase(depsolve.Depsolve): +@@ -964,8 +1096,17 @@ class YumBase(depsolve.Depsolve): (hibeg, prog, hiend)) def buildTransaction(self, unfinished_transactions_check=True): @@ -151984,7 +152024,7 @@ index 99039e0..a1b045f 100644 if (unfinished_transactions_check and misc.find_unfinished_transactions(yumlibpath=self.conf.persistdir)): msg = _('There are unfinished transactions remaining. You might ' \ -@@ -1004,7 +1140,7 @@ class YumBase(depsolve.Depsolve): +@@ -1004,7 +1145,7 @@ class YumBase(depsolve.Depsolve): # If transaction was changed by postresolve plugins then we should run skipbroken again (rescode, restring) = self._doSkipBroken(rescode, restring, clear_skipped=False ) @@ -151993,7 +152033,7 @@ index 99039e0..a1b045f 100644 self.tsInfo.pkgSack.dropCachedData() # FIXME: This is horrible, see below and yummain. Maybe create a real -@@ -1044,6 +1180,37 @@ class YumBase(depsolve.Depsolve): +@@ -1044,6 +1185,39 @@ class YumBase(depsolve.Depsolve): if first.verEQ(other): continue msg = _('Protected multilib versions: %s != %s') @@ -152003,14 +152043,16 @@ index 99039e0..a1b045f 100644 + bigmsg = _("""\ + Multilib version problems found. This often means that the root +cause is something else and multilib version checking is just -+pointing it that there is a problem. Eg.: ++pointing out that there is a problem. Eg.: + + 1. You have an upgrade for %(name)s which is missing some + dependency that another package requires. Yum is trying to + solve this by installing an older version of %(name)s of the + different architecture. If you exclude the bad architecture + yum will tell you what the root cause is (which package -+ requires what). ++ requires what). You can try redoing the upgrade with ++ --exclude %(name)s.otherarch ... this should give you an error ++ message showing the root cause of the problem. + + 2. You have multiple architectures of %(name)s installed, but + yum can only see an upgrade for one of those arcitectures. @@ -152031,7 +152073,7 @@ index 99039e0..a1b045f 100644 xrestring.append(msg % (first, other)) if xrestring: rescode = 1 -@@ -1242,13 +1409,15 @@ class YumBase(depsolve.Depsolve): +@@ -1242,13 +1416,15 @@ class YumBase(depsolve.Depsolve): if None in pkgtup: return None return pkgtup @@ -152051,7 +152093,7 @@ index 99039e0..a1b045f 100644 if pkgtup is None: return self._not_found_i[pkgtup] = YumNotFoundPackage(pkgtup) -@@ -1454,8 +1623,14 @@ class YumBase(depsolve.Depsolve): +@@ -1454,8 +1630,14 @@ class YumBase(depsolve.Depsolve): return probs def runTransaction(self, cb): @@ -152067,7 +152109,7 @@ index 99039e0..a1b045f 100644 self.plugins.run('pretrans') # We may want to put this other places, eventually, but for now it's -@@ -1516,10 +1691,23 @@ class YumBase(depsolve.Depsolve): +@@ -1516,10 +1698,23 @@ class YumBase(depsolve.Depsolve): pass self._ts_save_file = None @@ -152091,7 +152133,7 @@ index 99039e0..a1b045f 100644 # make resultobject - just a plain yumgenericholder object resultobject = misc.GenericHolder() -@@ -1567,13 +1755,24 @@ class YumBase(depsolve.Depsolve): +@@ -1567,13 +1762,24 @@ class YumBase(depsolve.Depsolve): self.plugins.run('posttrans') # sync up what just happened versus what is in the rpmdb if not self.ts.isTsFlagSet(rpm.RPMTRANS_FLAG_TEST): @@ -152121,7 +152163,7 @@ index 99039e0..a1b045f 100644 # check to see that the rpmdb and the tsInfo roughly matches # push package object metadata outside of rpmdb into yumdb # delete old yumdb metadata entries -@@ -1584,9 +1783,16 @@ class YumBase(depsolve.Depsolve): +@@ -1584,9 +1790,16 @@ class YumBase(depsolve.Depsolve): # that there is not also an install of this pkg in the tsInfo (reinstall) # for any kind of install add from_repo to the yumdb, and the cmdline # and the install reason @@ -152138,7 +152180,7 @@ index 99039e0..a1b045f 100644 for txmbr in self.tsInfo: if txmbr.output_state in TS_INSTALL_STATES: if not self.rpmdb.contains(po=txmbr.po): -@@ -1596,7 +1802,9 @@ class YumBase(depsolve.Depsolve): +@@ -1596,7 +1809,9 @@ class YumBase(depsolve.Depsolve): ' but is not!' % txmbr.po)) # Note: Get Panu to do te.Failed() so we don't have to txmbr.output_state = TS_FAILED @@ -152148,7 +152190,7 @@ index 99039e0..a1b045f 100644 po = self.getInstalledPackageObject(txmbr.pkgtup) rpo = txmbr.po po.yumdb_info.from_repo = rpo.repoid -@@ -1630,6 +1838,10 @@ class YumBase(depsolve.Depsolve): +@@ -1630,6 +1845,10 @@ class YumBase(depsolve.Depsolve): if md: po.yumdb_info.from_repo_timestamp = str(md.timestamp) @@ -152159,7 +152201,7 @@ index 99039e0..a1b045f 100644 loginuid = misc.getloginuid() if txmbr.updates or txmbr.downgrades or txmbr.reinstall: if txmbr.updates: -@@ -1640,11 +1852,16 @@ class YumBase(depsolve.Depsolve): +@@ -1640,11 +1859,16 @@ class YumBase(depsolve.Depsolve): opo = po if 'installed_by' in opo.yumdb_info: po.yumdb_info.installed_by = opo.yumdb_info.installed_by @@ -152176,7 +152218,7 @@ index 99039e0..a1b045f 100644 # Remove old ones after installing new ones, so we can copy values. for txmbr in self.tsInfo: if txmbr.output_state in TS_INSTALL_STATES: -@@ -1662,10 +1879,13 @@ class YumBase(depsolve.Depsolve): +@@ -1662,10 +1886,13 @@ class YumBase(depsolve.Depsolve): ' but is not!' % txmbr.po)) # Note: Get Panu to do te.Failed() so we don't have to txmbr.output_state = TS_FAILED @@ -152190,7 +152232,7 @@ index 99039e0..a1b045f 100644 self.verbose_logger.log(logginglevels.DEBUG_2, 'What is this? %s' % txmbr.po) self.plugins.run('postverifytrans') -@@ -1680,10 +1900,11 @@ class YumBase(depsolve.Depsolve): +@@ -1680,10 +1907,11 @@ class YumBase(depsolve.Depsolve): self.verbose_logger.debug('VerifyTransaction time: %0.3f' % (time.time() - vt_st)) def costExcludePackages(self): @@ -152206,7 +152248,7 @@ index 99039e0..a1b045f 100644 # if all the repo.costs are equal then don't bother running things costs = {} for r in self.repos.listEnabled(): -@@ -1705,10 +1926,12 @@ class YumBase(depsolve.Depsolve): +@@ -1705,10 +1933,12 @@ class YumBase(depsolve.Depsolve): done = True def excludePackages(self, repo=None): @@ -152222,7 +152264,7 @@ index 99039e0..a1b045f 100644 if "all" in self.conf.disable_excludes: return -@@ -1735,9 +1958,11 @@ class YumBase(depsolve.Depsolve): +@@ -1735,9 +1965,11 @@ class YumBase(depsolve.Depsolve): self.pkgSack.addPackageExcluder(repoid, exid,'exclude.match', match) def includePackages(self, repo): @@ -152237,7 +152279,7 @@ index 99039e0..a1b045f 100644 includelist = repo.getIncludePkgList() if len(includelist) == 0: -@@ -1757,8 +1982,11 @@ class YumBase(depsolve.Depsolve): +@@ -1757,8 +1989,11 @@ class YumBase(depsolve.Depsolve): self.pkgSack.addPackageExcluder(repo.id, exid, 'exclude.marked') def doLock(self, lockfile = YUM_PID_FILE): @@ -152251,7 +152293,7 @@ index 99039e0..a1b045f 100644 if self.conf.uid != 0: # If we are a user, assume we are using the root cache ... so don't # bother locking. -@@ -1774,38 +2002,26 @@ class YumBase(depsolve.Depsolve): +@@ -1774,38 +2009,26 @@ class YumBase(depsolve.Depsolve): mypid=str(os.getpid()) while not self._lock(lockfile, mypid, 0644): @@ -152305,7 +152347,7 @@ index 99039e0..a1b045f 100644 # if we're not root then we don't lock - just return nicely # Note that we can get here from __del__, so if we haven't created # YumBase.conf we don't want to do so here as creating stuff inside -@@ -1830,31 +2046,69 @@ class YumBase(depsolve.Depsolve): +@@ -1830,31 +2053,69 @@ class YumBase(depsolve.Depsolve): self._unlock(lockfile) self._lockfile = None @@ -152385,7 +152427,7 @@ index 99039e0..a1b045f 100644 failed = False if type(fo) is types.InstanceType: -@@ -1894,9 +2148,16 @@ class YumBase(depsolve.Depsolve): +@@ -1894,9 +2155,16 @@ class YumBase(depsolve.Depsolve): def verifyChecksum(self, fo, checksumType, csum): @@ -152405,7 +152447,7 @@ index 99039e0..a1b045f 100644 try: filesum = misc.checksum(checksumType, fo) except Errors.MiscError, e: -@@ -1908,6 +2169,17 @@ class YumBase(depsolve.Depsolve): +@@ -1908,6 +2176,17 @@ class YumBase(depsolve.Depsolve): return 0 def downloadPkgs(self, pkglist, callback=None, callback_total=None): @@ -152423,7 +152465,43 @@ index 99039e0..a1b045f 100644 def mediasort(apo, bpo): # FIXME: we should probably also use the mediaid; else we # could conceivably ping-pong between different disc1's -@@ -1979,8 +2251,9 @@ class YumBase(depsolve.Depsolve): +@@ -1943,6 +2222,7 @@ class YumBase(depsolve.Depsolve): + self.history.close() + + self.plugins.run('predownload', pkglist=pkglist) ++ downloadonly = getattr(self.conf, 'downloadonly', False) + repo_cached = False + remote_pkgs = [] + remote_size = 0 +@@ -1961,6 +2241,14 @@ class YumBase(depsolve.Depsolve): + self.verbose_logger.debug(_("using local copy of %s") %(po,)) + continue + ++ if downloadonly: ++ # download to temp file ++ rpmfile = po.localpath ++ po.localpath += '.%d.tmp' % os.getpid() ++ try: os.rename(rpmfile, po.localpath) ++ except OSError: pass ++ po.basepath # prefetch now; fails when repos are closed ++ + remote_pkgs.append(po) + remote_size += po.size + +@@ -1969,7 +2257,11 @@ class YumBase(depsolve.Depsolve): + # way to save this, report the error and return + if (self.conf.cache or repo_cached) and errors: + return errors +- ++ if downloadonly: ++ # close DBs, unlock ++ self.repos.close() ++ self.closeRpmDB() ++ self.doUnlock() + + remote_pkgs.sort(mediasort) + # This is kind of a hack and does nothing in non-Fedora versions, +@@ -1979,8 +2271,9 @@ class YumBase(depsolve.Depsolve): urlgrabber.progress.text_meter_total_size(remote_size) beg_download = time.time() i = 0 @@ -152434,7 +152512,7 @@ index 99039e0..a1b045f 100644 for po in remote_pkgs: # Recheck if the file is there, works around a couple of weird # edge cases. -@@ -1992,52 +2265,47 @@ class YumBase(depsolve.Depsolve): +@@ -1992,67 +2285,94 @@ class YumBase(depsolve.Depsolve): remote_size -= po.size if hasattr(urlgrabber.progress, 'text_meter_total_size'): urlgrabber.progress.text_meter_total_size(remote_size, @@ -152513,7 +152591,32 @@ index 99039e0..a1b045f 100644 if hasattr(urlgrabber.progress, 'text_meter_total_size'): urlgrabber.progress.text_meter_total_size(0) if callback_total is not None and not errors: -@@ -2052,7 +2320,22 @@ class YumBase(depsolve.Depsolve): + callback_total(remote_pkgs, remote_size, beg_download) + +- self.plugins.run('postdownload', pkglist=pkglist, errors=errors) ++ if downloadonly: ++ for po in remote_pkgs: ++ rpmfile = po.localpath.rsplit('.', 2)[0] ++ if po in errors: ++ # we may throw away partial file here- but we don't lock, ++ # so can't rename tempfile to rpmfile safely ++ misc.unlink_f(po.localpath) ++ if po not in errors: ++ # verifyPkg() didn't complain, so (potentially) ++ # overwriting another copy should not be a problem ++ os.rename(po.localpath, rpmfile) ++ po.localpath = rpmfile ++ else: ++ # XXX: Run unlocked? Skip this for now.. ++ self.plugins.run('postdownload', pkglist=pkglist, errors=errors) + + # Close curl object after we've downloaded everything. + if hasattr(urlgrabber.grabber, 'reset_curl_obj'): + urlgrabber.grabber.reset_curl_obj() + ++ if downloadonly and not errors: # caller handles errors ++ self.verbose_logger.info(_('exiting because --downloadonly specified')) ++ sys.exit(self.exit_code) return errors def verifyHeader(self, fo, po, raiseError): @@ -152537,7 +152640,7 @@ index 99039e0..a1b045f 100644 if type(fo) is types.InstanceType: fo = fo.filename -@@ -2076,9 +2359,12 @@ class YumBase(depsolve.Depsolve): +@@ -2076,9 +2396,12 @@ class YumBase(depsolve.Depsolve): return 1 def downloadHeader(self, po): @@ -152552,7 +152655,7 @@ index 99039e0..a1b045f 100644 if hasattr(po, 'pkgtype') and po.pkgtype == 'local': return -@@ -2122,15 +2408,17 @@ class YumBase(depsolve.Depsolve): +@@ -2122,15 +2445,17 @@ class YumBase(depsolve.Depsolve): return def sigCheckPkg(self, po): @@ -152578,7 +152681,7 @@ index 99039e0..a1b045f 100644 if self._override_sigchecks: check = False hasgpgkey = 0 -@@ -2181,6 +2469,9 @@ class YumBase(depsolve.Depsolve): +@@ -2181,6 +2506,9 @@ class YumBase(depsolve.Depsolve): return result, msg def cleanUsedHeadersPackages(self): @@ -152588,7 +152691,7 @@ index 99039e0..a1b045f 100644 filelist = [] for txmbr in self.tsInfo: if txmbr.po.state not in TS_INSTALL_STATES: -@@ -2218,27 +2509,42 @@ class YumBase(depsolve.Depsolve): +@@ -2218,27 +2546,42 @@ class YumBase(depsolve.Depsolve): _('%s removed'), fn) def cleanHeaders(self): @@ -152633,7 +152736,7 @@ index 99039e0..a1b045f 100644 cachedir = self.conf.persistdir + "/rpmdb-indexes/" if not os.path.exists(cachedir): filelist = [] -@@ -2272,8 +2578,29 @@ class YumBase(depsolve.Depsolve): +@@ -2272,8 +2615,29 @@ class YumBase(depsolve.Depsolve): def doPackageLists(self, pkgnarrow='all', patterns=None, showdups=None, ignore_case=False): @@ -152665,7 +152768,7 @@ index 99039e0..a1b045f 100644 if showdups is None: showdups = self.conf.showdupesfromrepos ygh = misc.GenericHolder(iter=pkgnarrow) -@@ -2323,10 +2650,22 @@ class YumBase(depsolve.Depsolve): +@@ -2323,10 +2687,22 @@ class YumBase(depsolve.Depsolve): key = (pkg.name, pkg.arch) if pkg.pkgtup in dinst: reinstall_available.append(pkg) @@ -152691,7 +152794,7 @@ index 99039e0..a1b045f 100644 # produce the updates list of tuples elif pkgnarrow == 'updates': -@@ -2461,14 +2800,13 @@ class YumBase(depsolve.Depsolve): +@@ -2461,14 +2837,13 @@ class YumBase(depsolve.Depsolve): def findDeps(self, pkgs): @@ -152711,7 +152814,7 @@ index 99039e0..a1b045f 100644 results = {} for pkg in pkgs: -@@ -2495,10 +2833,22 @@ class YumBase(depsolve.Depsolve): +@@ -2495,10 +2870,22 @@ class YumBase(depsolve.Depsolve): # pre 3.2.10 API used to always showdups, so that's the default atm. def searchGenerator(self, fields, criteria, showdups=True, keys=False, searchtags=True, searchrpmdb=True): @@ -152738,7 +152841,7 @@ index 99039e0..a1b045f 100644 sql_fields = [] for f in fields: sql_fields.append(RPM_TO_SQLITE.get(f, f)) -@@ -2661,6 +3011,14 @@ class YumBase(depsolve.Depsolve): +@@ -2661,6 +3048,14 @@ class YumBase(depsolve.Depsolve): yield (po, vs) def searchPackageTags(self, criteria): @@ -152753,7 +152856,7 @@ index 99039e0..a1b045f 100644 results = {} # name = [(criteria, taglist)] for c in criteria: c = c.lower() -@@ -2677,11 +3035,16 @@ class YumBase(depsolve.Depsolve): +@@ -2677,11 +3072,16 @@ class YumBase(depsolve.Depsolve): return results def searchPackages(self, fields, criteria, callback=None): @@ -152775,7 +152878,7 @@ index 99039e0..a1b045f 100644 warnings.warn(_('searchPackages() will go away in a future version of Yum.\ Use searchGenerator() instead. \n'), Errors.YumFutureDeprecationWarning, stacklevel=2) -@@ -2700,13 +3063,23 @@ class YumBase(depsolve.Depsolve): +@@ -2700,13 +3100,23 @@ class YumBase(depsolve.Depsolve): def searchPackageProvides(self, args, callback=None, callback_has_matchfor=False): @@ -152803,7 +152906,7 @@ index 99039e0..a1b045f 100644 else: isglob = True canBeFile = misc.re_filename(arg) -@@ -2723,7 +3096,7 @@ class YumBase(depsolve.Depsolve): +@@ -2723,7 +3133,7 @@ class YumBase(depsolve.Depsolve): where = self.returnPackagesByDep(arg) else: usedDepString = False @@ -152812,7 +152915,7 @@ index 99039e0..a1b045f 100644 self.verbose_logger.log(logginglevels.DEBUG_1, P_('Searching %d package', 'Searching %d packages', len(where)), len(where)) -@@ -2817,25 +3190,160 @@ class YumBase(depsolve.Depsolve): +@@ -2817,25 +3227,160 @@ class YumBase(depsolve.Depsolve): return matches @@ -152985,7 +153088,7 @@ index 99039e0..a1b045f 100644 if uservisible: if grp.user_visible: installed.append(grp) -@@ -2847,34 +3355,98 @@ class YumBase(depsolve.Depsolve): +@@ -2847,34 +3392,98 @@ class YumBase(depsolve.Depsolve): available.append(grp) else: available.append(grp) @@ -153094,7 +153197,7 @@ index 99039e0..a1b045f 100644 thesegroups = self.comps.return_groups(grpid) if not thesegroups: raise Errors.GroupsError, _("No Group named %s exists") % to_unicode(grpid) -@@ -2898,13 +3470,58 @@ class YumBase(depsolve.Depsolve): +@@ -2898,13 +3507,58 @@ class YumBase(depsolve.Depsolve): self.tsInfo.remove(txmbr.po.pkgtup) @@ -153160,7 +153263,7 @@ index 99039e0..a1b045f 100644 """ if not self.comps.has_group(grpid): -@@ -2920,6 +3537,9 @@ class YumBase(depsolve.Depsolve): +@@ -2920,6 +3574,9 @@ class YumBase(depsolve.Depsolve): if group_package_types: package_types = group_package_types @@ -153170,7 +153273,7 @@ index 99039e0..a1b045f 100644 for thisgroup in thesegroups: if thisgroup.selected: continue -@@ -2934,12 +3554,49 @@ class YumBase(depsolve.Depsolve): +@@ -2934,12 +3591,49 @@ class YumBase(depsolve.Depsolve): if 'optional' in package_types: pkgs.extend(thisgroup.optional_packages) @@ -153221,7 +153324,7 @@ index 99039e0..a1b045f 100644 except Errors.InstallError, e: self.verbose_logger.debug(_('No package named %s available to be installed'), pkg) -@@ -2953,7 +3610,9 @@ class YumBase(depsolve.Depsolve): +@@ -2953,7 +3647,9 @@ class YumBase(depsolve.Depsolve): group_conditionals = enable_group_conditionals count_cond_test = 0 @@ -153232,7 +153335,7 @@ index 99039e0..a1b045f 100644 for condreq, cond in thisgroup.conditional_packages.iteritems(): if self.isPackageInstalled(cond): try: -@@ -2990,17 +3649,22 @@ class YumBase(depsolve.Depsolve): +@@ -2990,17 +3686,22 @@ class YumBase(depsolve.Depsolve): if cond not in self.tsInfo.conditionals: self.tsInfo.conditionals[cond] = [] self.tsInfo.conditionals[cond].extend(pkgs) @@ -153261,7 +153364,7 @@ index 99039e0..a1b045f 100644 if not self.comps.has_group(grpid): raise Errors.GroupsError, _("No Group named %s exists") % to_unicode(grpid) -@@ -3008,7 +3672,8 @@ class YumBase(depsolve.Depsolve): +@@ -3008,7 +3709,8 @@ class YumBase(depsolve.Depsolve): thesegroups = self.comps.return_groups(grpid) if not thesegroups: raise Errors.GroupsError, _("No Group named %s exists") % to_unicode(grpid) @@ -153271,7 +153374,7 @@ index 99039e0..a1b045f 100644 for thisgroup in thesegroups: thisgroup.selected = False -@@ -3034,13 +3699,102 @@ class YumBase(depsolve.Depsolve): +@@ -3034,13 +3736,102 @@ class YumBase(depsolve.Depsolve): for pkg in self.tsInfo.conditionals.get(txmbr.name, []): self.tsInfo.remove(pkg.pkgtup) @@ -153380,7 +153483,7 @@ index 99039e0..a1b045f 100644 # look it up in the self.localPackages first: for po in self.localPackages: if po.pkgtup == pkgtup: -@@ -3049,7 +3803,7 @@ class YumBase(depsolve.Depsolve): +@@ -3049,7 +3840,7 @@ class YumBase(depsolve.Depsolve): pkgs = self.pkgSack.searchPkgTuple(pkgtup) if len(pkgs) == 0: @@ -153389,7 +153492,7 @@ index 99039e0..a1b045f 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 +3819,21 @@ class YumBase(depsolve.Depsolve): +@@ -3065,13 +3856,21 @@ class YumBase(depsolve.Depsolve): return result def getInstalledPackageObject(self, pkgtup): @@ -153416,7 +153519,7 @@ index 99039e0..a1b045f 100644 raise Errors.RpmDBError, _('Package tuple %s could not be found in rpmdb') % str(pkgtup) # Dito. FIXME from getPackageObject() for len() > 1 ... :) -@@ -3079,9 +3841,11 @@ class YumBase(depsolve.Depsolve): +@@ -3079,9 +3878,11 @@ class YumBase(depsolve.Depsolve): return po def gpgKeyCheck(self): @@ -153430,7 +153533,7 @@ index 99039e0..a1b045f 100644 gpgkeyschecked = self.conf.cachedir + '/.gpgkeyschecked.yum' if os.path.exists(gpgkeyschecked): return 1 -@@ -3106,9 +3870,13 @@ class YumBase(depsolve.Depsolve): +@@ -3106,9 +3907,13 @@ class YumBase(depsolve.Depsolve): return 1 def returnPackagesByDep(self, depstring): @@ -153446,7 +153549,7 @@ index 99039e0..a1b045f 100644 if not depstring: return [] -@@ -3135,9 +3903,16 @@ class YumBase(depsolve.Depsolve): +@@ -3135,9 +3940,16 @@ class YumBase(depsolve.Depsolve): return self.pkgSack.getProvides(depname, depflags, depver).keys() def returnPackageByDep(self, depstring): @@ -153466,7 +153569,7 @@ index 99039e0..a1b045f 100644 # we get all sorts of randomness here errstring = depstring if type(depstring) not in types.StringTypes: -@@ -3149,16 +3924,22 @@ class YumBase(depsolve.Depsolve): +@@ -3149,16 +3961,22 @@ class YumBase(depsolve.Depsolve): raise Errors.YumBaseError, _('No Package found for %s') % errstring ps = ListPackageSack(pkglist) @@ -153493,7 +153596,7 @@ index 99039e0..a1b045f 100644 if not depstring: return [] -@@ -3184,12 +3965,47 @@ class YumBase(depsolve.Depsolve): +@@ -3184,12 +4002,47 @@ class YumBase(depsolve.Depsolve): return self.rpmdb.getProvides(depname, depflags, depver).keys() @@ -153543,7 +153646,7 @@ index 99039e0..a1b045f 100644 if len(pkglist) == 0: -@@ -3198,14 +4014,23 @@ class YumBase(depsolve.Depsolve): +@@ -3198,14 +4051,23 @@ class YumBase(depsolve.Depsolve): if len(pkglist) == 1: return pkglist[0] @@ -153573,7 +153676,7 @@ index 99039e0..a1b045f 100644 returnlist = [] compatArchList = self.arch.get_arch_list(arch) multiLib = [] -@@ -3222,9 +4047,9 @@ class YumBase(depsolve.Depsolve): +@@ -3222,9 +4084,9 @@ class YumBase(depsolve.Depsolve): singleLib.append(po) # we now have three lists. find the best package(s) of each @@ -153586,7 +153689,7 @@ index 99039e0..a1b045f 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 +4063,7 @@ class YumBase(depsolve.Depsolve): +@@ -3238,7 +4100,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: @@ -153595,7 +153698,7 @@ index 99039e0..a1b045f 100644 if best.arch == "noarch": returnlist.append(no) else: -@@ -3246,7 +4071,7 @@ class YumBase(depsolve.Depsolve): +@@ -3246,7 +4108,7 @@ class YumBase(depsolve.Depsolve): if single: returnlist.append(single) # similar for the non-multilib case elif single: @@ -153604,7 +153707,7 @@ index 99039e0..a1b045f 100644 if best.arch == "noarch": returnlist.append(no) else: -@@ -3350,28 +4175,58 @@ class YumBase(depsolve.Depsolve): +@@ -3350,28 +4212,58 @@ class YumBase(depsolve.Depsolve): done = True slow = next_func(slow) @@ -153668,7 +153771,7 @@ index 99039e0..a1b045f 100644 try: txmbrs = self.groupRemove(group_string) except yum.Errors.GroupsError: -@@ -3387,6 +4242,8 @@ class YumBase(depsolve.Depsolve): +@@ -3387,6 +4279,8 @@ class YumBase(depsolve.Depsolve): assert pattern[0] == '@' grpid = pattern[1:] @@ -153677,7 +153780,7 @@ index 99039e0..a1b045f 100644 thesegroups = self.comps.return_groups(grpid) if not thesegroups: raise Errors.GroupsError, _("No Group named %s exists") % to_unicode(grpid) -@@ -3398,7 +4255,11 @@ class YumBase(depsolve.Depsolve): +@@ -3398,7 +4292,11 @@ class YumBase(depsolve.Depsolve): def _minus_deselect(self, pattern): """ Remove things from the transaction, like kickstart. """ assert pattern[0] == '-' @@ -153690,7 +153793,7 @@ index 99039e0..a1b045f 100644 if pat and pat[0] == '@': pat = pat[1:] -@@ -3437,14 +4298,61 @@ class YumBase(depsolve.Depsolve): +@@ -3437,14 +4335,87 @@ class YumBase(depsolve.Depsolve): if flag not in self.tsInfo.probFilterFlags: self.tsInfo.probFilterFlags.append(flag) @@ -153718,6 +153821,32 @@ index 99039e0..a1b045f 100644 + return True + + return False ++ ++ def _valid_install_arch(self, po, ipkgs=None): ++ ''' See if we can install this arch of package, mainly for ++ i386 vs. i586 or ppc64 vs. ppc64 etc. ''' ++ if not ipkgs: ++ ipkgs = self.rpmdb.searchNames([po.name]) ++ else: ++ ipkgs = ipkgs[:] ++ ++ # Add these anyway, just to be sure. ++ for txmbr in self.tsInfo.matchNaevr(po.name): ++ if txmbr.output_state not in TS_INSTALL_STATES: ++ continue ++ ipkgs.append(txmbr.po) ++ ++ for ipkg in ipkgs: ++ if po.arch == ipkg.arch: ++ continue ++ if not po.verEQ(ipkg): ++ continue ++ if canCoinstall(po.arch, ipkg.arch): ++ continue ++ self.verbose_logger.log(logginglevels.INFO_2, ++ _("Package: %s - can't co-install with %s"), po, ipkg) ++ return False ++ return True + def install(self, po=None, **kwargs): - """try to mark for install the item specified. Uses provided package @@ -153758,7 +153887,7 @@ index 99039e0..a1b045f 100644 pkgs = [] was_pattern = False if po: -@@ -3477,20 +4385,12 @@ class YumBase(depsolve.Depsolve): +@@ -3477,20 +4448,12 @@ class YumBase(depsolve.Depsolve): self.verbose_logger.debug(_('Checking for virtual provide or file-provide for %s'), arg) @@ -153785,7 +153914,7 @@ index 99039e0..a1b045f 100644 else: nevra_dict = self._nevra_kwarg_parse(kwargs) -@@ -3577,8 +4477,8 @@ class YumBase(depsolve.Depsolve): +@@ -3577,17 +4540,20 @@ class YumBase(depsolve.Depsolve): continue # make sure this shouldn't be passed to update: @@ -153796,7 +153925,11 @@ index 99039e0..a1b045f 100644 txmbrs = self.update(po=po) tx_return.extend(txmbrs) continue -@@ -3587,7 +4487,7 @@ class YumBase(depsolve.Depsolve): ++ ++ if not self._valid_install_arch(po, ipkgs): ++ continue + + # 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. obsoleting_pkg = None @@ -153805,7 +153938,7 @@ index 99039e0..a1b045f 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 +4500,23 @@ class YumBase(depsolve.Depsolve): +@@ -3600,23 +4566,23 @@ class YumBase(depsolve.Depsolve): already_obs = pkgs[0] if already_obs: @@ -153836,7 +153969,7 @@ index 99039e0..a1b045f 100644 continue # make sure we don't have a name.arch of this already installed -@@ -3630,7 +4530,7 @@ class YumBase(depsolve.Depsolve): +@@ -3630,7 +4596,7 @@ class YumBase(depsolve.Depsolve): found = True break if not found: @@ -153845,7 +153978,7 @@ index 99039e0..a1b045f 100644 txmbrs = self.update(po=po) tx_return.extend(txmbrs) continue -@@ -3719,19 +4619,47 @@ class YumBase(depsolve.Depsolve): +@@ -3719,19 +4685,47 @@ class YumBase(depsolve.Depsolve): return txmbr def update(self, po=None, requiringPo=None, update_to=False, **kwargs): @@ -153900,7 +154033,7 @@ index 99039e0..a1b045f 100644 tx_return = [] if not po and not kwargs: # update everything (the easy case) self.verbose_logger.log(logginglevels.DEBUG_2, _('Updating Everything')) -@@ -3765,7 +4693,14 @@ class YumBase(depsolve.Depsolve): +@@ -3765,7 +4759,14 @@ class YumBase(depsolve.Depsolve): if new is None: continue tx_return.extend(self.update(po=new)) @@ -153916,7 +154049,7 @@ index 99039e0..a1b045f 100644 return tx_return # complications -@@ -3787,7 +4722,7 @@ class YumBase(depsolve.Depsolve): +@@ -3787,7 +4788,7 @@ class YumBase(depsolve.Depsolve): return self._minus_deselect(kwargs['pattern']) if kwargs['pattern'] and kwargs['pattern'][0] == '@': @@ -153925,7 +154058,7 @@ index 99039e0..a1b045f 100644 arg = kwargs['pattern'] if not update_to: -@@ -3843,7 +4778,7 @@ class YumBase(depsolve.Depsolve): +@@ -3843,7 +4844,7 @@ class YumBase(depsolve.Depsolve): availpkgs = self._compare_providers(availpkgs, requiringPo) availpkgs = map(lambda x: x[0], availpkgs) elif not availpkgs: @@ -153934,10 +154067,13 @@ index 99039e0..a1b045f 100644 # for any thing specified # get the list of available pkgs matching it (or take the po) -@@ -3920,6 +4855,18 @@ class YumBase(depsolve.Depsolve): +@@ -3920,6 +4921,21 @@ class YumBase(depsolve.Depsolve): tx_return.append(txmbr) for available_pkg in availpkgs: ++ if not self._valid_install_arch(available_pkg): ++ continue ++ + # "Just do it" if it's a local pkg. + if isinstance(available_pkg, YumLocalPackage): + n = available_pkg.name @@ -153953,7 +154089,7 @@ index 99039e0..a1b045f 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 +4932,18 @@ class YumBase(depsolve.Depsolve): +@@ -3985,11 +5001,18 @@ class YumBase(depsolve.Depsolve): return tx_return def remove(self, po=None, **kwargs): @@ -153977,7 +154113,7 @@ index 99039e0..a1b045f 100644 if not po and not kwargs: raise Errors.RemoveError, 'Nothing specified to remove' -@@ -4055,17 +5009,19 @@ class YumBase(depsolve.Depsolve): +@@ -4055,17 +5078,19 @@ class YumBase(depsolve.Depsolve): return tx_return def installLocal(self, pkg, po=None, updateonly=False): @@ -154007,7 +154143,7 @@ index 99039e0..a1b045f 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 +5139,15 @@ class YumBase(depsolve.Depsolve): +@@ -4183,16 +5208,15 @@ class YumBase(depsolve.Depsolve): return tx_return def reinstallLocal(self, pkg, po=None): @@ -154032,7 +154168,7 @@ index 99039e0..a1b045f 100644 if not po: try: po = YumUrlPackage(self, ts=self.rpmdb.readOnlyTS(), url=pkg, -@@ -4215,9 +5170,19 @@ class YumBase(depsolve.Depsolve): +@@ -4215,9 +5239,19 @@ class YumBase(depsolve.Depsolve): return self.reinstall(po=po) def reinstall(self, po=None, **kwargs): @@ -154055,7 +154191,7 @@ index 99039e0..a1b045f 100644 self._add_prob_flags(rpm.RPMPROB_FILTER_REPLACEPKG, rpm.RPMPROB_FILTER_REPLACENEWFILES, rpm.RPMPROB_FILTER_REPLACEOLDFILES) -@@ -4259,16 +5224,15 @@ class YumBase(depsolve.Depsolve): +@@ -4259,16 +5293,15 @@ class YumBase(depsolve.Depsolve): return tx_mbrs def downgradeLocal(self, pkg, po=None): @@ -154080,7 +154216,7 @@ index 99039e0..a1b045f 100644 if not po: try: po = YumUrlPackage(self, ts=self.rpmdb.readOnlyTS(), url=pkg, -@@ -4309,13 +5273,19 @@ class YumBase(depsolve.Depsolve): +@@ -4309,13 +5342,19 @@ class YumBase(depsolve.Depsolve): return False def downgrade(self, po=None, **kwargs): @@ -154107,7 +154243,18 @@ index 99039e0..a1b045f 100644 if not po and not kwargs: raise Errors.DowngradeError, 'Nothing specified to downgrade' -@@ -4421,6 +5391,9 @@ class YumBase(depsolve.Depsolve): +@@ -4397,6 +5436,10 @@ class YumBase(depsolve.Depsolve): + # installed version. Indexed fromn the latest installed pkgtup. + downgrade_apkgs = {} + for pkg in sorted(apkgs): ++ # We are cleverer here, I think... ++ # if not self._valid_install_arch(pkg, ipkgs): ++ # continue ++ + na = (pkg.name, pkg.arch) + + # Here we allow downgrades from .i386 => .noarch, or .i586 => .i386 +@@ -4421,6 +5464,9 @@ class YumBase(depsolve.Depsolve): warned_nas.add(na) continue @@ -154117,7 +154264,7 @@ index 99039e0..a1b045f 100644 if pkg.verGE(lipkg): if na not in warned_nas: msg = _('Only Upgrade available on package: %s') % pkg -@@ -4457,7 +5430,7 @@ class YumBase(depsolve.Depsolve): +@@ -4457,7 +5503,7 @@ class YumBase(depsolve.Depsolve): if e and v and r: evr = '%s:%s-%s' % (e, v, r) elif v and r: @@ -154126,7 +154273,7 @@ index 99039e0..a1b045f 100644 elif e and v: evr = '%s:%s' % (e, v) elif v: # e and r etc. is just too weird to print -@@ -4500,12 +5473,24 @@ class YumBase(depsolve.Depsolve): +@@ -4500,12 +5546,24 @@ class YumBase(depsolve.Depsolve): return returndict @@ -154154,7 +154301,7 @@ index 99039e0..a1b045f 100644 old_conf_obs = self.conf.obsoletes self.conf.obsoletes = False done = False -@@ -4515,19 +5500,46 @@ class YumBase(depsolve.Depsolve): +@@ -4515,19 +5573,46 @@ class YumBase(depsolve.Depsolve): done = True for pkg in transaction.trans_data: if pkg.state == 'Downgrade': @@ -154201,7 +154348,7 @@ index 99039e0..a1b045f 100644 if self.install(pkgtup=pkg.pkgtup): done = True for pkg in transaction.trans_data: -@@ -4538,8 +5550,14 @@ class YumBase(depsolve.Depsolve): +@@ -4538,8 +5623,14 @@ class YumBase(depsolve.Depsolve): return done def history_undo(self, transaction): @@ -154218,7 +154365,7 @@ index 99039e0..a1b045f 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 +5634,7 @@ class YumBase(depsolve.Depsolve): +@@ -4616,7 +5707,7 @@ class YumBase(depsolve.Depsolve): except urlgrabber.grabber.URLGrabError, e: raise Errors.YumBaseError(_('GPG key retrieval failed: ') + @@ -154227,7 +154374,7 @@ index 99039e0..a1b045f 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 +5667,7 @@ class YumBase(depsolve.Depsolve): +@@ -4649,7 +5740,7 @@ class YumBase(depsolve.Depsolve): keys_info = misc.getgpgkeyinfo(rawkey, multiple=True) except ValueError, e: raise Errors.YumBaseError(_('Invalid GPG Key from %s: %s') % @@ -154236,7 +154383,7 @@ index 99039e0..a1b045f 100644 keys = [] for keyinfo in keys_info: thiskey = {} -@@ -4674,39 +5692,49 @@ class YumBase(depsolve.Depsolve): +@@ -4674,39 +5765,49 @@ class YumBase(depsolve.Depsolve): if pkgs: pkgs = sorted(pkgs)[-1] msg = (_('Importing %s key 0x%s:\n' @@ -154304,7 +154451,7 @@ index 99039e0..a1b045f 100644 user_cb_fail = False for keyurl in keyurls: keys = self._retrievePublicKey(keyurl, repo) -@@ -4725,7 +5753,9 @@ class YumBase(depsolve.Depsolve): +@@ -4725,7 +5826,9 @@ class YumBase(depsolve.Depsolve): # Try installing/updating GPG key self._getKeyImportMessage(info, keyurl) rc = False @@ -154315,7 +154462,7 @@ index 99039e0..a1b045f 100644 rc = True # grab the .sig/.asc for the keyurl, if it exists -@@ -4751,8 +5781,8 @@ class YumBase(depsolve.Depsolve): +@@ -4751,8 +5854,8 @@ class YumBase(depsolve.Depsolve): ts = self.rpmdb.readOnlyTS() result = ts.pgpImportPubkey(misc.procgpgkey(info['raw_key'])) if result != 0: @@ -154326,7 +154473,7 @@ index 99039e0..a1b045f 100644 self.logger.info(_('Key imported successfully')) key_installed = True -@@ -4760,18 +5790,20 @@ class YumBase(depsolve.Depsolve): +@@ -4760,18 +5863,20 @@ class YumBase(depsolve.Depsolve): raise Errors.YumBaseError, _("Didn't install any keys") if not key_installed: @@ -154352,7 +154499,7 @@ index 99039e0..a1b045f 100644 def _getAnyKeyForRepo(self, repo, destdir, keyurl_list, is_cakey=False, callback=None): """ -@@ -4788,6 +5820,18 @@ class YumBase(depsolve.Depsolve): +@@ -4788,6 +5893,18 @@ class YumBase(depsolve.Depsolve): """ key_installed = False @@ -154371,7 +154518,7 @@ index 99039e0..a1b045f 100644 user_cb_fail = False for keyurl in keyurl_list: keys = self._retrievePublicKey(keyurl, repo, getSig=not is_cakey) -@@ -4819,8 +5863,11 @@ class YumBase(depsolve.Depsolve): +@@ -4819,8 +5936,11 @@ class YumBase(depsolve.Depsolve): if not key_installed: self._getKeyImportMessage(info, keyurl, keytype) rc = False @@ -154384,7 +154531,7 @@ index 99039e0..a1b045f 100644 elif callback: rc = callback({"repo": repo, "userid": info['userid'], "hexkeyid": info['hexkeyid'], "keyurl": keyurl, -@@ -4835,7 +5882,8 @@ class YumBase(depsolve.Depsolve): +@@ -4835,7 +5955,8 @@ class YumBase(depsolve.Depsolve): # Import the key result = misc.import_key_to_pubring(info['raw_key'], info['hexkeyid'], gpgdir=destdir) if not result: @@ -154394,7 +154541,7 @@ index 99039e0..a1b045f 100644 self.logger.info(_('Key imported successfully')) key_installed = True # write out the key id to imported_cakeys in the repos basedir -@@ -4851,36 +5899,35 @@ class YumBase(depsolve.Depsolve): +@@ -4851,36 +5972,35 @@ class YumBase(depsolve.Depsolve): pass if not key_installed and user_cb_fail: @@ -154447,7 +154594,7 @@ index 99039e0..a1b045f 100644 self._getAnyKeyForRepo(repo, repo.gpgcadir, repo.gpgcakey, is_cakey=True, callback=callback) def _limit_installonly_pkgs(self): -@@ -4927,6 +5974,7 @@ class YumBase(depsolve.Depsolve): +@@ -4927,6 +6047,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) @@ -154455,7 +154602,7 @@ index 99039e0..a1b045f 100644 for m in self.tsInfo.getMembers(): if m.ts_state not in ('i', 'u'): continue -@@ -4937,12 +5985,21 @@ class YumBase(depsolve.Depsolve): +@@ -4937,12 +6058,21 @@ class YumBase(depsolve.Depsolve): if not po_names.intersection(install_only_names): continue @@ -154481,7 +154628,7 @@ index 99039e0..a1b045f 100644 for po in installed: if (po.version, po.release) == (cur_kernel_v, cur_kernel_r): # don't remove running -@@ -4959,19 +6016,22 @@ class YumBase(depsolve.Depsolve): +@@ -4959,19 +6089,22 @@ class YumBase(depsolve.Depsolve): txmbr.depends_on.append(rel) def processTransaction(self, callback=None,rpmTestDisplay=None, rpmDisplay=None): @@ -154517,7 +154664,7 @@ index 99039e0..a1b045f 100644 if not callback: callback = callbacks.ProcessTransNoOutputCallback() -@@ -5114,13 +6174,19 @@ class YumBase(depsolve.Depsolve): +@@ -5114,13 +6247,19 @@ class YumBase(depsolve.Depsolve): return results def add_enable_repo(self, repoid, baseurls=[], mirrorlist=None, **kwargs): @@ -154544,7 +154691,7 @@ index 99039e0..a1b045f 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 +6233,15 @@ class YumBase(depsolve.Depsolve): +@@ -5167,9 +6306,15 @@ class YumBase(depsolve.Depsolve): def setCacheDir(self, force=False, tmpdir=None, reuse=True, suffix='/$basearch/$releasever'): @@ -154563,7 +154710,7 @@ index 99039e0..a1b045f 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 +6251,7 @@ class YumBase(depsolve.Depsolve): +@@ -5179,7 +6324,7 @@ class YumBase(depsolve.Depsolve): try: cachedir = misc.getCacheDir(tmpdir, reuse) except (IOError, OSError), e: @@ -154572,7 +154719,7 @@ index 99039e0..a1b045f 100644 cachedir = None if cachedir is None: -@@ -5190,6 +6262,7 @@ class YumBase(depsolve.Depsolve): +@@ -5190,6 +6335,7 @@ class YumBase(depsolve.Depsolve): self.prerepoconf.cachedir = cachedir else: self.repos.setCacheDir(cachedir) @@ -154580,7 +154727,7 @@ index 99039e0..a1b045f 100644 self.conf.cachedir = cachedir return True # We got a new cache dir -@@ -5220,13 +6293,24 @@ class YumBase(depsolve.Depsolve): +@@ -5220,13 +6366,24 @@ class YumBase(depsolve.Depsolve): self.history.write_addon_data('config-repos', myrepos) def verify_plugins_cb(self, verify_package): @@ -154608,7 +154755,7 @@ index 99039e0..a1b045f 100644 if self.tsInfo._unresolvedMembers: if auto: self.logger.critical(_("Dependencies not solved. Will not save unresolved transaction.")) -@@ -5234,7 +6318,7 @@ class YumBase(depsolve.Depsolve): +@@ -5234,7 +6391,7 @@ class YumBase(depsolve.Depsolve): raise Errors.YumBaseError(_("Dependencies not solved. Will not save unresolved transaction.")) if not filename: @@ -154617,7 +154764,7 @@ index 99039e0..a1b045f 100644 fd,filename = tempfile.mkstemp(suffix='.yumtx', prefix=prefix) f = os.fdopen(fd, 'w') else: -@@ -5244,13 +6328,17 @@ class YumBase(depsolve.Depsolve): +@@ -5244,13 +6401,17 @@ class YumBase(depsolve.Depsolve): msg = "%s\n" % self.rpmdb.simpleVersion(main_only=True)[0] msg += "%s\n" % self.ts.getTsFlags() @@ -154638,7 +154785,7 @@ index 99039e0..a1b045f 100644 msg += "%s\n" % len(self.tsInfo.getMembers()) for txmbr in self.tsInfo.getMembers(): msg += txmbr._dump() -@@ -5260,13 +6348,25 @@ class YumBase(depsolve.Depsolve): +@@ -5260,13 +6421,25 @@ class YumBase(depsolve.Depsolve): except (IOError, OSError), e: self._ts_save_file = None if auto: @@ -154670,7 +154817,7 @@ index 99039e0..a1b045f 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 +6376,45 @@ class YumBase(depsolve.Depsolve): +@@ -5276,26 +6449,45 @@ class YumBase(depsolve.Depsolve): try: data = open(filename, 'r').readlines() except (IOError, OSError), e: @@ -154718,7 +154865,7 @@ index 99039e0..a1b045f 100644 if ignorerpm: msg += _(" ignoring, as requested.") self.logger.critical(_(msg)) -@@ -5318,8 +6437,17 @@ class YumBase(depsolve.Depsolve): +@@ -5318,8 +6510,17 @@ class YumBase(depsolve.Depsolve): numrepos = int(data[2].strip()) repos = [] rindex=3+numrepos @@ -154737,7 +154884,7 @@ index 99039e0..a1b045f 100644 # pkgs/txmbrs numpkgs = int(data[rindex].strip()) -@@ -5329,6 +6457,7 @@ class YumBase(depsolve.Depsolve): +@@ -5329,6 +6530,7 @@ class YumBase(depsolve.Depsolve): pkgcount = 0 pkgprob = False curpkg = None @@ -154745,7 +154892,7 @@ index 99039e0..a1b045f 100644 for l in data[pkgstart:]: l = l.rstrip() # our main txmbrs -@@ -5356,6 +6485,7 @@ class YumBase(depsolve.Depsolve): +@@ -5356,6 +6558,7 @@ class YumBase(depsolve.Depsolve): if not ignoremissing: raise Errors.YumBaseError(msg) else: @@ -154753,7 +154900,7 @@ index 99039e0..a1b045f 100644 self.logger.critical(msg) else: pkgcount += 1 -@@ -5432,12 +6562,18 @@ class YumBase(depsolve.Depsolve): +@@ -5432,12 +6635,18 @@ class YumBase(depsolve.Depsolve): if pkgprob: msg = _("Transaction members, relations are missing or ts has been modified,") if ignoremissing: @@ -154772,7 +154919,7 @@ index 99039e0..a1b045f 100644 return self.tsInfo.getMembers() def _remove_old_deps(self): -@@ -5470,18 +6606,6 @@ class YumBase(depsolve.Depsolve): +@@ -5470,18 +6679,6 @@ class YumBase(depsolve.Depsolve): if requiring == required: # if they are self-requiring skip them continue @@ -154791,7 +154938,7 @@ index 99039e0..a1b045f 100644 #for tbi_pkg in self.tsInfo.getMembersWithState(output_states=TS_INSTALL_STATES): # for reqtuple in tbi_pkg.po.requires: # if required.provides_for(reqtuple): -@@ -5533,7 +6657,24 @@ class YumBase(depsolve.Depsolve): +@@ -5533,7 +6730,24 @@ class YumBase(depsolve.Depsolve): # Debugging output self.verbose_logger.log(logginglevels.DEBUG_2, _("%s has revdep %s which was user-installed."), pkg, curpkg) ok_to_remove[pkg] = False @@ -154816,7 +154963,7 @@ index 99039e0..a1b045f 100644 visited[curpkg] = True all_leaves_visited = True leaves = curpkg.requiring_packages() -@@ -5547,4 +6688,3 @@ class YumBase(depsolve.Depsolve): +@@ -5547,4 +6761,3 @@ class YumBase(depsolve.Depsolve): # Debugging output self.verbose_logger.log(logginglevels.DEBUG_2, _("%s has no user-installed revdeps."), pkg) return False @@ -157766,7 +157913,7 @@ index aaa4f25..61aa586 100755 continue diff --git a/yum/misc.py b/yum/misc.py -index 2f6ddfe..0fd3e90 100644 +index 2f6ddfe..a0bac7b 100644 --- a/yum/misc.py +++ b/yum/misc.py @@ -8,6 +8,7 @@ import os @@ -157785,7 +157932,27 @@ index 2f6ddfe..0fd3e90 100644 _available_compression = ['gz', 'bz2'] try: import lzma -@@ -410,6 +412,17 @@ def procgpgkey(rawkey): +@@ -95,6 +97,19 @@ def re_glob(s): + _re_compiled_glob_match = re.compile('[*?]|\[.+\]').search + return _re_compiled_glob_match(s) + ++def compile_pattern(pat, ignore_case=False): ++ """ Compile shell wildcards, return a 'match' function. """ ++ if re_glob(pat): ++ try: ++ flags = ignore_case and re.I or 0 ++ return re.compile(fnmatch.translate(pat), flags).match ++ except re.error: ++ pass # fall back to exact match ++ if ignore_case: ++ pat = pat.lower() ++ return lambda s: s.lower() == pat ++ return lambda s: s == pat ++ + _re_compiled_filename_match = None + def re_filename(s): + """ Tests if a string could be a filename. We still get negated character +@@ -410,6 +425,17 @@ def procgpgkey(rawkey): # Decode and return return base64.decodestring(block.getvalue()) @@ -157803,7 +157970,7 @@ index 2f6ddfe..0fd3e90 100644 def getgpgkeyinfo(rawkey, multiple=False): '''Return a dict of info for the given ASCII armoured key text -@@ -611,6 +624,8 @@ def getCacheDir(tmpdir='/var/tmp', reuse=True, prefix='yum-'): +@@ -611,6 +637,8 @@ def getCacheDir(tmpdir='/var/tmp', reuse=True, prefix='yum-'): try: usertup = pwd.getpwuid(uid) username = usertup[0] @@ -157812,7 +157979,7 @@ index 2f6ddfe..0fd3e90 100644 except KeyError: return None # if it returns None then, well, it's bollocksed -@@ -744,8 +759,9 @@ def _decompress_chunked(source, dest, ztype): +@@ -744,8 +772,9 @@ def _decompress_chunked(source, dest, ztype): while True: try: data = s_fn.read(1024000) @@ -157824,7 +157991,7 @@ index 2f6ddfe..0fd3e90 100644 if not data: break -@@ -940,14 +956,16 @@ def unlink_f(filename): +@@ -940,14 +969,16 @@ def unlink_f(filename): if e.errno != errno.ENOENT: raise @@ -157845,7 +158012,7 @@ index 2f6ddfe..0fd3e90 100644 def _getloginuid(): """ Get the audit-uid/login-uid, if available. None is returned if there -@@ -992,9 +1010,17 @@ def setup_locale(override_codecs=True, override_time=False): +@@ -992,9 +1023,17 @@ def setup_locale(override_codecs=True, override_time=False): locale.setlocale(locale.LC_ALL, 'C') if override_codecs: @@ -157866,7 +158033,7 @@ index 2f6ddfe..0fd3e90 100644 def get_my_lang_code(): -@@ -1105,17 +1131,28 @@ def decompress(filename, dest=None, fn_only=False, check_timestamps=False): +@@ -1105,17 +1144,28 @@ def decompress(filename, dest=None, fn_only=False, check_timestamps=False): out = filename.replace('.xz', '') else: @@ -157903,7 +158070,7 @@ index 2f6ddfe..0fd3e90 100644 return out -@@ -1123,11 +1160,7 @@ def repo_gen_decompress(filename, generated_name, cached=False): +@@ -1123,11 +1173,7 @@ 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. """ @@ -157917,10 +158084,41 @@ index 2f6ddfe..0fd3e90 100644 def read_in_items_from_dot_dir(thisglob, line_as_list=True): diff --git a/yum/packageSack.py b/yum/packageSack.py -index 4af563a..47832fc 100644 +index 4af563a..a702ac1 100644 --- a/yum/packageSack.py +++ b/yum/packageSack.py -@@ -445,6 +445,7 @@ class MetaSack(PackageSackBase): +@@ -282,11 +282,7 @@ class PackageSackBase(object): + + specs = {} + for p in pkgspecs: +- if misc.re_glob(p): +- restring = fnmatch.translate(p) +- specs[p] = re.compile(restring) +- else: +- specs[p] = p ++ specs[p] = misc.compile_pattern(p) + + # We don't use simplePkgList() here because that loads all of the + # rpmdb, if we are Eg. doing a "remove PackageKit". +@@ -304,13 +300,12 @@ class PackageSackBase(object): + )) + + for (term,query) in specs.items(): +- if term == query: +- if query in names: +- exactmatch.append(self.searchPkgTuple(pkgtup)[0]) +- unmatched.discard(term) ++ if term in names: ++ exactmatch.append(self.searchPkgTuple(pkgtup)[0]) ++ unmatched.discard(term) + else: + for n in names: +- if query.match(n): ++ if query(n): + matched.append(self.searchPkgTuple(pkgtup)[0]) + unmatched.discard(term) + return misc.unique(exactmatch), misc.unique(matched), list(unmatched) +@@ -445,6 +440,7 @@ class MetaSack(PackageSackBase): nobsdict = {} last_name = '' last_pkg = None @@ -157928,7 +158126,7 @@ index 4af563a..47832fc 100644 # It takes about 0.2 of a second to convert these into packages, just # so we can sort them, which is ~40% of this functions time. So we sort # the pkgtups "by hand". -@@ -624,6 +625,8 @@ class MetaSack(PackageSackBase): +@@ -624,6 +620,8 @@ class MetaSack(PackageSackBase): class PackageSack(PackageSackBase): """represents sets (sacks) of Package Objects""" def __init__(self): @@ -157938,7 +158136,7 @@ index 4af563a..47832fc 100644 self.obsoletes = {} #obs[obsoletename] = [pkg1, pkg2, pkg3] #the package lists are packages that obsolete the key name diff --git a/yum/packages.py b/yum/packages.py -index 5ef9951..07c555c 100644 +index 5ef9951..7a2624a 100644 --- a/yum/packages.py +++ b/yum/packages.py @@ -106,14 +106,16 @@ def buildPkgRefDict(pkgs, casematch=True): @@ -157960,7 +158158,21 @@ index 5ef9951..07c555c 100644 exactmatch = [] matched = [] unmatched = [] -@@ -223,6 +225,10 @@ class FakeRepository: +@@ -130,11 +132,10 @@ def parsePackages(pkgs, usercommands, casematch=0, + trylist = pkgdict.keys() + # command and pkgdict are already lowered if not casematch + # so case sensitive is always fine +- restring = fnmatch.translate(command) +- regex = re.compile(restring) ++ regex = misc.compile_pattern(command) + foundit = 0 + for item in trylist: +- if regex.match(item): ++ if regex(item): + matched.extend(pkgdict[item]) + del pkgdict[item] + foundit = 1 +@@ -223,6 +224,10 @@ class FakeRepository: def __str__(self): return self.id @@ -157971,7 +158183,7 @@ index 5ef9951..07c555c 100644 # Goal for the below is to have a packageobject that can be used by generic # functions independent of the type of package - ie: installed or available -@@ -243,34 +249,87 @@ class PackageObject(object): +@@ -243,34 +248,87 @@ class PackageObject(object): def _ui_envra(self): if self.epoch == '0': @@ -158079,7 +158291,7 @@ index 5ef9951..07c555c 100644 def __str__(self): return self.ui_envra -@@ -481,15 +540,14 @@ class RpmBase(object): +@@ -481,15 +539,14 @@ class RpmBase(object): if prcotuple in self._prco_lookup[prcotype]: return 1 @@ -158103,7 +158315,7 @@ index 5ef9951..07c555c 100644 return 0 -@@ -611,15 +669,18 @@ class RpmBase(object): +@@ -611,15 +668,18 @@ class RpmBase(object): dirlist = property(fget=lambda self: self.returnFileEntries(ftype='dir')) ghostlist = property(fget=lambda self: self.returnFileEntries(ftype='ghost')) requires = property(fget=lambda self: self.returnPrco('requires')) @@ -158122,7 +158334,7 @@ index 5ef9951..07c555c 100644 conflicts_print = property(fget=lambda self: self.returnPrco('conflicts', True)) obsoletes_print = property(fget=lambda self: self.returnPrco('obsoletes', True)) changelog = property(fget=lambda self: self.returnChangelog()) -@@ -1083,7 +1144,7 @@ class YumAvailablePackage(PackageObject, RpmBase): +@@ -1083,7 +1143,7 @@ class YumAvailablePackage(PackageObject, RpmBase): misc.to_unicode(misc.to_xml(self.summary)), misc.to_unicode(misc.to_xml(self.description)), packager, url, self.filetime, @@ -158131,7 +158343,7 @@ index 5ef9951..07c555c 100644 msg += self._return_remote_location() return msg -@@ -1133,7 +1194,7 @@ class YumAvailablePackage(PackageObject, RpmBase): +@@ -1133,7 +1193,7 @@ class YumAvailablePackage(PackageObject, RpmBase): msg = "" mylist = getattr(self, pcotype) if mylist: msg = "\n \n" % pcotype @@ -158140,7 +158352,7 @@ index 5ef9951..07c555c 100644 pcostring = ''' %s\n""" % misc.to_xml(fn) return msg -@@ -1194,8 +1255,8 @@ class YumAvailablePackage(PackageObject, RpmBase): +@@ -1194,8 +1254,8 @@ class YumAvailablePackage(PackageObject, RpmBase): continue newlist.append(i) mylist = newlist @@ -158166,7 +158378,7 @@ index 5ef9951..07c555c 100644 if name.startswith('rpmlib('): continue # this drops out requires that the pkg provides for itself. -@@ -1217,13 +1278,16 @@ class YumAvailablePackage(PackageObject, RpmBase): +@@ -1217,13 +1277,16 @@ class YumAvailablePackage(PackageObject, RpmBase): prcostring += ''' ver="%s"''' % misc.to_xml(v, attrib=True) if r: prcostring += ''' rel="%s"''' % misc.to_xml(r, attrib=True) @@ -158185,7 +158397,7 @@ index 5ef9951..07c555c 100644 return msg def _dump_changelog(self, clog_limit): -@@ -1272,6 +1336,13 @@ class YumAvailablePackage(PackageObject, RpmBase): +@@ -1272,6 +1335,13 @@ class YumAvailablePackage(PackageObject, RpmBase): return misc.to_utf8(msg) @@ -158199,7 +158411,7 @@ index 5ef9951..07c555c 100644 # This is a tweak on YumAvailablePackage() and is a base class for packages # which are actual rpms. -@@ -1299,7 +1370,8 @@ class YumHeaderPackage(YumAvailablePackage): +@@ -1299,7 +1369,8 @@ class YumHeaderPackage(YumAvailablePackage): self.pkgid = self.hdr[rpm.RPMTAG_SHA1HEADER] if not self.pkgid: self.pkgid = "%s.%s" %(self.hdr['name'], self.hdr['buildtime']) @@ -158209,7 +158421,7 @@ index 5ef9951..07c555c 100644 self.__mode_cache = {} self.__prcoPopulated = False -@@ -1353,6 +1425,12 @@ class YumHeaderPackage(YumAvailablePackage): +@@ -1353,6 +1424,12 @@ class YumHeaderPackage(YumAvailablePackage): continue lst = hdr[getattr(rpm, 'RPMTAG_%sFLAGS' % tag)] @@ -158222,7 +158434,7 @@ index 5ef9951..07c555c 100644 flag = map(rpmUtils.miscutils.flagToString, lst) flag = map(misc.share_data, flag) -@@ -1363,6 +1441,10 @@ class YumHeaderPackage(YumAvailablePackage): +@@ -1363,6 +1440,10 @@ class YumHeaderPackage(YumAvailablePackage): prcotype = tag2prco[tag] self.prco[prcotype] = map(misc.share_data, zip(name,flag,vers)) @@ -158233,7 +158445,7 @@ index 5ef9951..07c555c 100644 def tagByName(self, tag): warnings.warn("tagByName() will go away in a furture version of Yum.\n", -@@ -1447,7 +1529,7 @@ class YumHeaderPackage(YumAvailablePackage): +@@ -1447,7 +1528,7 @@ class YumHeaderPackage(YumAvailablePackage): raise NotImplementedError() def _size(self): @@ -158847,7 +159059,7 @@ index 31b1080..eb84123 100755 tags += """ \n""" msg += tags diff --git a/yum/repos.py b/yum/repos.py -index 3793bad..6d4c20e 100644 +index 3793bad..de5da1e 100644 --- a/yum/repos.py +++ b/yum/repos.py @@ -22,6 +22,7 @@ import misc @@ -158906,15 +159118,21 @@ index 3793bad..6d4c20e 100644 def doSetup(self, thisrepo = None): self.ayum.plugins.run('prereposetup') -@@ -89,6 +131,7 @@ class RepoStorage: +@@ -87,8 +129,13 @@ class RepoStorage: + # so nothing else touches us + if not repo.enabled: self.disableRepo(repo.id) ++ else: ++ pkgdir = getattr(self.ayum.conf, 'downloaddir', None) ++ if pkgdir: ++ repo.pkgdir = pkgdir self._setup = True + self.retrieveAllMD() self.ayum.plugins.run('postreposetup') def __str__(self): -@@ -223,15 +266,16 @@ class RepoStorage: +@@ -223,15 +270,16 @@ class RepoStorage: self._cachedir = cachedir for repo in self.repos.values(): @@ -158935,7 +159153,7 @@ index 3793bad..6d4c20e 100644 def setFailureCallback(self, obj): """sets the failure callback for all repos""" -@@ -288,6 +332,16 @@ class RepoStorage: +@@ -288,6 +336,16 @@ class RepoStorage: else: data = [ mdtype ] @@ -158953,7 +159171,7 @@ index 3793bad..6d4c20e 100644 sack = repo.getPackageSack() try: diff --git a/yum/rpmsack.py b/yum/rpmsack.py -index e289a7a..a4da4ab 100644 +index e289a7a..302f613 100644 --- a/yum/rpmsack.py +++ b/yum/rpmsack.py @@ -48,6 +48,17 @@ def _open_no_umask(*args): @@ -158993,7 +159211,53 @@ index e289a7a..a4da4ab 100644 continue pkg = pkg[0] -@@ -616,7 +628,7 @@ class RPMDBPackageSack(PackageSackBase): +@@ -534,13 +546,11 @@ class RPMDBPackageSack(PackageSackBase): + qpat = pat[0] + if qpat in ('?', '*', '['): + qpat = None +- if ignore_case: +- if qpat is not None: +- qpat = qpat.lower() +- ret.append((qpat, re.compile(fnmatch.translate(pat), re.I))) +- else: +- ret.append((qpat, re.compile(fnmatch.translate(pat)))) ++ elif ignore_case: ++ qpat = qpat.lower() ++ ret.append((qpat, misc.compile_pattern(pat, ignore_case))) + return ret ++ + @staticmethod + def _match_repattern(repatterns, hdr, ignore_case): + """ This is basically parsePackages() but for rpm hdr objects. """ +@@ -558,20 +568,20 @@ class RPMDBPackageSack(PackageSackBase): + qname = qname.lower() + if qpat is not None and qpat != qname and qpat != epoch[0]: + continue +- if repat.match(hdr['name']): ++ if repat(hdr['name']): + return True +- if repat.match("%(name)s-%(version)s-%(release)s.%(arch)s" % hdr): ++ if repat("%(name)s-%(version)s-%(release)s.%(arch)s" % hdr): + return True +- if repat.match("%(name)s.%(arch)s" % hdr): ++ if repat("%(name)s.%(arch)s" % hdr): + return True +- if repat.match("%(name)s-%(version)s" % hdr): ++ if repat("%(name)s-%(version)s" % hdr): + return True +- if repat.match("%(name)s-%(version)s-%(release)s" % hdr): ++ if repat("%(name)s-%(version)s-%(release)s" % hdr): + return True +- if repat.match(epoch + ":%(name)s-%(version)s-%(release)s.%(arch)s" ++ if repat(epoch + ":%(name)s-%(version)s-%(release)s.%(arch)s" + % hdr): + return True +- if repat.match("%(name)s-%(epoch)s:%(version)s-%(release)s.%(arch)s" ++ if repat("%(name)s-%(epoch)s:%(version)s-%(release)s.%(arch)s" + % hdr): + return True + return False +@@ -616,7 +626,7 @@ class RPMDBPackageSack(PackageSackBase): for hdr, idx in self._get_packages(): if self._match_repattern(rpats, hdr, ignore_case): self._makePackageObject(hdr, idx) @@ -159002,7 +159266,7 @@ index e289a7a..a4da4ab 100644 pkgobjlist = self._idx2pkg.values() # Remove gpg-pubkeys, as no sane callers expects/likes them... -@@ -993,7 +1005,7 @@ class RPMDBPackageSack(PackageSackBase): +@@ -993,7 +1003,7 @@ class RPMDBPackageSack(PackageSackBase): return if not load_packages: @@ -159011,7 +159275,7 @@ index e289a7a..a4da4ab 100644 for pkgtup in checksum_data: if checksum_data[pkgtup] is None: -@@ -1002,7 +1014,8 @@ class RPMDBPackageSack(PackageSackBase): +@@ -1002,7 +1012,8 @@ class RPMDBPackageSack(PackageSackBase): (n, a, e, v, r) = pkgtup pkg = self.searchNevra(n, e, v, r, a) if not pkg: @@ -159021,7 +159285,7 @@ index e289a7a..a4da4ab 100644 continue pkg = pkg[0] (T, D) = checksum_data[pkgtup] -@@ -1088,7 +1101,7 @@ class RPMDBPackageSack(PackageSackBase): +@@ -1088,7 +1099,7 @@ class RPMDBPackageSack(PackageSackBase): return try: @@ -159030,7 +159294,7 @@ index e289a7a..a4da4ab 100644 except (IOError, OSError), e: return -@@ -1456,7 +1469,7 @@ class RPMDBPackageSack(PackageSackBase): +@@ -1456,7 +1467,7 @@ class RPMDBPackageSack(PackageSackBase): providers = set() # Speedup, as usual :) problems = [] for pkg in sorted(pkgs): # The sort here is mainly for "UI" @@ -159039,7 +159303,7 @@ index e289a7a..a4da4ab 100644 if rreq[0].startswith('rpmlib'): continue if rreq in providers: continue -@@ -1562,11 +1575,11 @@ class RPMDBAdditionalData(object): +@@ -1562,11 +1573,11 @@ class RPMDBAdditionalData(object): self._packages = {} # pkgid = dir if not os.path.exists(self.conf.db_path): try: @@ -159054,7 +159318,7 @@ index e289a7a..a4da4ab 100644 else: if os.access(self.conf.db_path, os.W_OK): self.conf.writable = True -@@ -1622,6 +1635,7 @@ class RPMDBAdditionalDataPackage(object): +@@ -1622,6 +1633,7 @@ class RPMDBAdditionalDataPackage(object): 'installed_by', 'changed_by', 'from_repo', 'from_repo_revision', 'from_repo_timestamp', 'releasever', @@ -159062,7 +159326,7 @@ index e289a7a..a4da4ab 100644 'command_line']) def __init__(self, conf, pkgdir, yumdb_cache=None): -@@ -1708,7 +1722,7 @@ class RPMDBAdditionalDataPackage(object): +@@ -1708,7 +1720,7 @@ class RPMDBAdditionalDataPackage(object): def _write(self, attr, value): # check for self._conf.writable before going on? if not os.path.exists(self._mydir): @@ -159071,7 +159335,7 @@ index e289a7a..a4da4ab 100644 attr = _sanitize(attr) if attr in self._read_cached_data: -@@ -1753,7 +1767,7 @@ class RPMDBAdditionalDataPackage(object): +@@ -1753,7 +1765,7 @@ class RPMDBAdditionalDataPackage(object): if attr.endswith('.tmp'): raise AttributeError, "%s has no attribute %s" % (self, attr) @@ -159156,7 +159420,7 @@ index 9b265f9..74a0f3f 100644 + + self.display.verify_txmbr(self.base, txmbr, count) diff --git a/yum/sqlitesack.py b/yum/sqlitesack.py -index 8a6f6f3..ed57408 100644 +index 8a6f6f3..a955895 100644 --- a/yum/sqlitesack.py +++ b/yum/sqlitesack.py @@ -69,7 +69,7 @@ def _parse_pkg_n(match, regexp_match, n): @@ -159207,6 +159471,31 @@ index 8a6f6f3..ed57408 100644 if len(self.filelistsdb) == 0: # grab repo object from primarydb and force filelists population in this sack using repo +@@ -1560,7 +1563,7 @@ class YumSqlitePackageSack(yumRepo.YumPackageSack): + patterns = tmp + return (need_full, patterns, fields, False) + +- @catchSqliteException ++ # @catchSqliteException has no effect on generators + def _yieldSQLDataList(self, repoid, patterns, fields, ignore_case): + """Yields all the package data for the given params. Excludes are done + at this stage. """ +@@ -1593,6 +1596,7 @@ class YumSqlitePackageSack(yumRepo.YumPackageSack): + for x in cur: + yield (repo, x) + ++ @catchSqliteException + def _buildPkgObjList(self, repoid=None, patterns=None, ignore_case=False): + """Builds a list of packages, only containing nevra information. + Excludes are done at this stage. """ +@@ -1666,6 +1670,7 @@ class YumSqlitePackageSack(yumRepo.YumPackageSack): + + return returnList + ++ @catchSqliteException + def simplePkgList(self, patterns=None, ignore_case=False): + """Returns a list of pkg tuples (n, a, e, v, r), optionally from a + single repoid. Note that the packages are always filtered to those diff --git a/yum/transactioninfo.py b/yum/transactioninfo.py index 4d89d83..e7377bf 100644 --- a/yum/transactioninfo.py @@ -159440,7 +159729,7 @@ index 2cb1acb..0586c1c 100644 for pkg in un['pkglist']: for filedata in pkg['packages']: diff --git a/yum/yumRepo.py b/yum/yumRepo.py -index e5e9ece..9b9cc72 100644 +index e5e9ece..e362c43 100644 --- a/yum/yumRepo.py +++ b/yum/yumRepo.py @@ -20,10 +20,12 @@ import time @@ -159947,7 +160236,7 @@ index e5e9ece..9b9cc72 100644 # pretend everything is good until the revert. if not self.timestamp_check: - raise Errors.RepoError, "Can't download or revert repomd.xml" -+ raise Errors.RepoError, "Can't download or revert repomd.xml for:" % self.ui_id ++ raise Errors.RepoError, "Can't download or revert repomd.xml for %s" % self.ui_id if 'old_repo_XML' not in self._oldRepoMDData: self._oldRepoMDData = {} @@ -160159,8 +160448,20 @@ index e5e9ece..9b9cc72 100644 """ Internal function, use .retrieveMD() from outside yum. """ # Note that this can raise Errors.RepoMDError if mdtype doesn't exist # for this repo. -@@ -1588,7 +1720,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1580,15 +1712,19 @@ class YumRepository(Repository, config.RepoConf): + try: + self.checkMD(local, mdtype) + except URLGrabError, e: ++ if retrieve_can_fail: ++ return None + raise Errors.RepoError, \ + "Caching enabled and local cache: %s does not match checksum" % local + else: + return local + else: # ain't there - raise ++ if retrieve_can_fail: ++ return None raise Errors.RepoError, \ "Caching enabled but no local cache of %s from %s" % (local, - self) @@ -160168,7 +160469,7 @@ index e5e9ece..9b9cc72 100644 if (os.path.exists(local) or self._preload_md_from_system_cache(os.path.basename(local))): -@@ -1597,8 +1729,10 @@ class YumRepository(Repository, config.RepoConf): +@@ -1597,8 +1733,10 @@ class YumRepository(Repository, config.RepoConf): return local # it's the same return the local one try: @@ -160181,7 +160482,7 @@ index e5e9ece..9b9cc72 100644 if thisdata.size is None: reget = None else: -@@ -1613,8 +1747,9 @@ class YumRepository(Repository, config.RepoConf): +@@ -1613,8 +1751,9 @@ class YumRepository(Repository, config.RepoConf): checkfunc=checkfunc, text=text, cache=self.http_caching == 'all', @@ -160193,7 +160494,7 @@ index e5e9ece..9b9cc72 100644 if retrieve_can_fail: return None raise -@@ -1622,9 +1757,8 @@ class YumRepository(Repository, config.RepoConf): +@@ -1622,9 +1761,8 @@ class YumRepository(Repository, config.RepoConf): if retrieve_can_fail: return None raise Errors.RepoError, \ @@ -160204,7 +160505,7 @@ index e5e9ece..9b9cc72 100644 return local -@@ -1646,13 +1780,21 @@ class YumRepository(Repository, config.RepoConf): +@@ -1646,13 +1784,21 @@ class YumRepository(Repository, config.RepoConf): def getGroups(self): """gets groups and returns group file path for the repository, if there @@ -160229,7 +160530,7 @@ index e5e9ece..9b9cc72 100644 self._callbacks_changed = True def setFailureObj(self, failure_obj): -@@ -1681,7 +1823,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1681,7 +1827,7 @@ class YumRepository(Repository, config.RepoConf): print "Could not read mirrorlist %s, error was \n%s" %(url, e) content = [] for line in content: @@ -160238,7 +160539,7 @@ index e5e9ece..9b9cc72 100644 continue mirror = line.rstrip() # no more trailing \n's mirror = mirror.replace('$ARCH', '$BASEARCH') -@@ -1713,7 +1855,7 @@ class YumRepository(Repository, config.RepoConf): +@@ -1713,7 +1859,7 @@ class YumRepository(Repository, config.RepoConf): ugopts = self._default_grabopts() try: fo = urlgrabber.grabber.urlopen(url, **ugopts) @@ -160247,7 +160548,7 @@ index e5e9ece..9b9cc72 100644 print "Could not retrieve mirrorlist %s error was\n%s: %s" % (url, e.args[0], misc.to_unicode(e.args[1])) fo = None -@@ -1877,7 +2019,7 @@ def getMirrorList(mirrorlist, pdict = None): +@@ -1877,7 +2023,7 @@ def getMirrorList(mirrorlist, pdict = None): try: fo = urlresolver.urlopen(url, proxies=pdict) diff --git a/yum.spec b/yum.spec index 7a6fd86..f7f6909 100644 --- a/yum.spec +++ b/yum.spec @@ -18,7 +18,7 @@ Summary: RPM package installer/updater/manager Name: yum Version: 3.4.3 -Release: 45%{?dist} +Release: 46%{?dist} License: GPLv2+ Group: System Environment/Base Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz @@ -56,6 +56,9 @@ Requires: python-sqlite Requires: python-urlgrabber >= 3.9.0-8 Requires: yum-metadata-parser >= 1.1.0 Requires: pygpgme +# rawhide is >= 0.5.3-7.fc18 ... as this is added. +Requires: pyliblzma + Conflicts: rpm >= 5-0 # Zif is a re-implementation of yum in C, however: @@ -91,6 +94,8 @@ Provides: yum-protect-packages = 1.1.27-0.yum Provides: yum-plugin-protect-packages = 1.1.27-0.yum Obsoletes: yum-plugin-download-order <= 0.2-2 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Obsoletes: yum-plugin-downloadonly <= 1.1.31-6.fc19 +Provides: yum-plugin-downloadonly = 3.4.3-44.yum %description @@ -272,6 +277,7 @@ exit 0 %{_sysconfdir}/bash_completion.d %dir %{_datadir}/yum-cli %{_datadir}/yum-cli/* +%exclude %{_datadir}/yum-cli/completion-helper.py? %if %{yum_updatesd} %exclude %{_datadir}/yum-cli/yumupd.py* %endif @@ -315,6 +321,10 @@ exit 0 %endif %changelog +* Tue Oct 23 2012 James Antill - 3.4.3-46 +- update to latest HEAD. +- Minor upstream fixes, mainly for ppc64p7. + * Tue Oct 2 2012 Zdenek Pavlas - 3.4.3-45 - update to latest HEAD. - Don't skip loadts new rpmdbv check, when transaction changes. BZ 857961 From c4c6a002e6cd2366269a5451127fc1212918eeca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zden=C4=9Bk=20Pavlas?= Date: Fri, 23 Nov 2012 14:16:41 +0100 Subject: [PATCH 14/24] update yum-cron requires --- yum.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yum.spec b/yum.spec index f7f6909..9824e4e 100644 --- a/yum.spec +++ b/yum.spec @@ -125,7 +125,7 @@ can notify you when they are available via email, syslog or dbus. %package cron Summary: Files needed to run yum updates as a cron job Group: System Environment/Base -Requires: yum >= 3.0 vixie-cron crontabs yum-plugin-downloadonly findutils +Requires: yum >= 3.0 cronie crontabs findutils Requires(post): /sbin/chkconfig Requires(post): /sbin/service Requires(preun): /sbin/chkconfig From 55dc3db0eebce8a5fe12f5b76c6ee1f5a3f6a896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zden=C4=9Bk=20Pavlas?= Date: Thu, 6 Dec 2012 14:13:30 +0100 Subject: [PATCH 15/24] Include langpacks when reading and writing comps. BZ 870753 --- BZ-870753-include-langpacks.patch | 208 ++++++++++++++++++++++++++++++ yum.spec | 7 +- 2 files changed, 214 insertions(+), 1 deletion(-) create mode 100644 BZ-870753-include-langpacks.patch diff --git a/BZ-870753-include-langpacks.patch b/BZ-870753-include-langpacks.patch new file mode 100644 index 0000000..781e49e --- /dev/null +++ b/BZ-870753-include-langpacks.patch @@ -0,0 +1,208 @@ +From 6ef7823406da1e044ca188a9c96fe867a5e8c36f Mon Sep 17 00:00:00 2001 +From: Daniel Mach +Date: Tue, 16 Oct 2012 07:10:13 -0400 +Subject: Include langpacks when reading and writing comps. + +The comps section defines patterns used by the yum-langpacks plugin. +We want to keep them when writing comps. +--- + yum/comps.py | 93 +++++++++++++++++++++++++++++++++++++++++++++++++-------- + 1 files changed, 80 insertions(+), 13 deletions(-) + +diff --git a/yum/comps.py b/yum/comps.py +index 4e765ef..fe5649d 100755 +--- a/yum/comps.py ++++ b/yum/comps.py +@@ -16,14 +16,14 @@ + + import types + import sys +-from constants import * +-from Errors import CompsException ++from yum.constants import * ++from yum.Errors import CompsException + #FIXME - compsexception isn't caught ANYWHERE so it's pointless to raise it + # switch all compsexceptions to grouperrors after api break + import fnmatch + import re + from yum.i18n import to_unicode +-from misc import get_my_lang_code ++from yum.misc import get_my_lang_code + from yum.misc import cElementTree_iterparse as iterparse + + lang_attr = '{http://www.w3.org/XML/1998/namespace}lang' +@@ -281,7 +281,6 @@ class Group(CompsObj): + + return msg + +- + class Environment(CompsObj): + """ Environment object parsed from group data in each repo, and merged """ + +@@ -512,13 +511,61 @@ class Category(CompsObj): + msg += """ \n""" + + return msg +- ++ ++class Langpacks(CompsObj): ++ def __init__(self, elem=None): ++ self.langpacks = [] ++ self.name = "" # prevent CompsObj.__str__() throwing an AttributeError ++ if elem is not None: ++ self.parse(elem) ++ ++ def __getitem__(self, indx): ++ return self.langpacks[indx] ++ ++ def __iter__(self): ++ for i in self.langpacks: ++ yield i ++ ++ def __len__(self): ++ return len(self.langpacks) ++ ++ def add(self, name, install): ++ langpack = { ++ "name": name, ++ "install": install, ++ } ++ self.langpacks.append(langpack) ++ ++ def parse(self, elem): ++ for child in elem: ++ if child.tag == "match": ++ langpack = { ++ "name": child.attrib.get("name"), ++ "install": child.attrib.get("install"), ++ } ++ self.langpacks.append(langpack) ++ else: ++ raise CompsException("Unexpected element in : %s" % child.tag) ++ ++ self.name = elem.attrib.get("name") ++ self.install = elem.attrib.get("install") ++ ++ def xml(self): ++ """write out an xml stanza for the Langpacks object""" ++ if not self.langpacks: ++ return '' ++ msg = ' \n' ++ for i in self: ++ msg += ' \n' % (i["name"], i["install"]) ++ msg += ' \n' ++ return msg + + class Comps(object): + def __init__(self, overwrite_groups=False): + self._groups = {} + self._environments = {} + self._categories = {} ++ self._langpacks = Langpacks() + self.compscount = 0 + self.overwrite_groups = overwrite_groups + self.compiled = False # have groups been compiled into avail/installed +@@ -529,7 +576,7 @@ class Comps(object): + grps = self._groups.values() + grps.sort(key=lambda x: (x.display_order, x.name)) + return grps +- ++ + def get_environments(self): + environments = self._environments.values() + environments.sort(key=lambda x: (x.display_order, x.name)) +@@ -539,10 +586,14 @@ class Comps(object): + cats = self._categories.values() + cats.sort(key=lambda x: (x.display_order, x.name)) + return cats ++ ++ def get_langpacks(self): ++ return self._langpacks + + groups = property(get_groups) + environments = property(get_environments) + categories = property(get_categories) ++ langpacks = property(get_langpacks) + + def has_group(self, grpid): + exists = self.return_groups(grpid) +@@ -703,6 +754,9 @@ class Comps(object): + else: + self._categories[category.categoryid] = category + ++ def add_langpack(self, name, install): ++ self._langpacks.add(name, install) ++ + def add(self, srcfile = None): + if not srcfile: + raise CompsException +@@ -732,6 +786,8 @@ class Comps(object): + if elem.tag == "category": + category = Category(elem) + self.add_category(category) ++ if elem.tag == "langpacks": ++ self._langpacks.parse(elem) + except SyntaxError, e: + raise CompsException, "comps file is empty/damaged" + +@@ -791,7 +847,7 @@ class Comps(object): + """returns the xml of the comps files in this class, merged""" + + if not self._groups and not self._categories and \ +- not self._environments: ++ not self._environments and not len(self._langpacks): + return "" + + msg = """ +@@ -805,7 +861,7 @@ class Comps(object): + msg += c.xml() + for e in self.get_environments(): + msg += e.xml() +- ++ msg += self.get_langpacks().xml() + msg += """\n\n""" + + return msg +@@ -820,23 +876,34 @@ def main(): + for srcfile in sys.argv[1:]: + p.add(srcfile) + ++ print ++ print "===== GROUPS =====" + for group in p.groups: +- print group ++ print "%s (id: %s)" % (group, group.groupid) + for pkg in group.packages: + print ' ' + pkg +- ++ ++ print ++ print "===== ENVIRONMENTS =====" + for environment in p.environments: +- print environment.name ++ print "%s (id: %s)" % (environment.name, environment.environmentid) + for group in environment.groups: + print ' ' + group + for group in environment.options: + print ' *' + group + ++ print ++ print "===== CATEGORIES =====" + for category in p.categories: +- print category.name ++ print "%s (id: %s)" % (category.name, category.categoryid) + for group in category.groups: + print ' ' + group +- ++ ++ print ++ print "===== LANGPACKS =====" ++ for langpack in p.langpacks: ++ print ' %s (%s)' % (langpack["name"], langpack["install"]) ++ + except IOError: + print >> sys.stderr, "newcomps.py: No such file:\'%s\'" % sys.argv[1] + sys.exit(1) +-- +1.7.4.4 + diff --git a/yum.spec b/yum.spec index 9824e4e..dc0710d 100644 --- a/yum.spec +++ b/yum.spec @@ -18,7 +18,7 @@ Summary: RPM package installer/updater/manager Name: yum Version: 3.4.3 -Release: 46%{?dist} +Release: 47%{?dist} License: GPLv2+ Group: System Environment/Base Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz @@ -32,6 +32,7 @@ Patch7: yum-ppc64-preferred.patch Patch8: BZ-803346-no-only-update.patch Patch20: yum-manpage-files.patch Patch21: yum-completion-helper.patch +Patch22: BZ-870753-include-langpacks.patch URL: http://yum.baseurl.org/ BuildArchitectures: noarch @@ -146,6 +147,7 @@ Install this package if you want auto yum updates nightly via cron. %patch8 -p1 %patch20 -p1 %patch21 -p1 +%patch22 -p1 %patch1 -p1 %build @@ -321,6 +323,9 @@ exit 0 %endif %changelog +* Thu Dec 6 2012 Zdeněk Pavlas - 3.4.3-47 +- Include langpacks when reading and writing comps. BZ 870753 + * Tue Oct 23 2012 James Antill - 3.4.3-46 - update to latest HEAD. - Minor upstream fixes, mainly for ppc64p7. From 89bc912db7f6c4c6bb440846f3c40290ec3b4992 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zden=C4=9Bk=20Pavlas?= Date: Thu, 6 Dec 2012 14:39:53 +0100 Subject: [PATCH 16/24] Fix the BZ# in previous commit --- ...clude-langpacks.patch => BZ-881756-include-langpacks.patch | 0 yum.spec | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename BZ-870753-include-langpacks.patch => BZ-881756-include-langpacks.patch (100%) diff --git a/BZ-870753-include-langpacks.patch b/BZ-881756-include-langpacks.patch similarity index 100% rename from BZ-870753-include-langpacks.patch rename to BZ-881756-include-langpacks.patch diff --git a/yum.spec b/yum.spec index dc0710d..e73ceac 100644 --- a/yum.spec +++ b/yum.spec @@ -32,7 +32,7 @@ Patch7: yum-ppc64-preferred.patch Patch8: BZ-803346-no-only-update.patch Patch20: yum-manpage-files.patch Patch21: yum-completion-helper.patch -Patch22: BZ-870753-include-langpacks.patch +Patch22: BZ-881756-include-langpacks.patch URL: http://yum.baseurl.org/ BuildArchitectures: noarch @@ -324,7 +324,7 @@ exit 0 %changelog * Thu Dec 6 2012 Zdeněk Pavlas - 3.4.3-47 -- Include langpacks when reading and writing comps. BZ 870753 +- Include langpacks when reading and writing comps. BZ 881756 * Tue Oct 23 2012 James Antill - 3.4.3-46 - update to latest HEAD. From 56fa7022d4abf851a89839e60d3134163b3533ae Mon Sep 17 00:00:00 2001 From: Zdenek Pavlas Date: Wed, 16 Jan 2013 15:16:49 +0100 Subject: [PATCH 17/24] Fix a typo in select_groups(). BZ 885139 --- BZ-885139-not-enough-arguments.patch | 20 ++++++++++++++++++++ yum.spec | 7 ++++++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 BZ-885139-not-enough-arguments.patch diff --git a/BZ-885139-not-enough-arguments.patch b/BZ-885139-not-enough-arguments.patch new file mode 100644 index 0000000..6538675 --- /dev/null +++ b/BZ-885139-not-enough-arguments.patch @@ -0,0 +1,20 @@ +commit 4687ffe032c1a4060da3ef670301df06d0faeb32 +Author: Zdeněk Pavlas +Date: Mon Dec 10 08:55:41 2012 +0100 + + selectGroup(): Fix a typo. BZ 885139 + +diff --git a/yum/__init__.py b/yum/__init__.py +index 6401645..63053af 100644 +--- a/yum/__init__.py ++++ b/yum/__init__.py +@@ -3692,7 +3692,8 @@ much more problems). + if not upgrade and len(txmbrs_used) == old_txmbrs: + self.logger.critical(_('Warning: Group %s does not have any packages to install.'), thisgroup.groupid) + if count_cond_test: +- self.logger.critical(_('Group %s does have %u conditional packages, which may get installed.'), count_cond_test) ++ self.logger.critical(_('Group %s does have %u conditional packages, which may get installed.'), ++ thisgroup.groupid, count_cond_test) + return txmbrs_used + + def deselectGroup(self, grpid, force=False): diff --git a/yum.spec b/yum.spec index e73ceac..9db5653 100644 --- a/yum.spec +++ b/yum.spec @@ -18,7 +18,7 @@ Summary: RPM package installer/updater/manager Name: yum Version: 3.4.3 -Release: 47%{?dist} +Release: 48%{?dist} License: GPLv2+ Group: System Environment/Base Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz @@ -33,6 +33,7 @@ Patch8: BZ-803346-no-only-update.patch Patch20: yum-manpage-files.patch Patch21: yum-completion-helper.patch Patch22: BZ-881756-include-langpacks.patch +Patch23: BZ-885139-not-enough-arguments.patch URL: http://yum.baseurl.org/ BuildArchitectures: noarch @@ -148,6 +149,7 @@ Install this package if you want auto yum updates nightly via cron. %patch20 -p1 %patch21 -p1 %patch22 -p1 +%patch23 -p1 %patch1 -p1 %build @@ -323,6 +325,9 @@ exit 0 %endif %changelog +* Wed Jan 16 2013 Zdeněk Pavlas - 3.4.3-48 +- Fix a typo in select_groups(). BZ 885139 + * Thu Dec 6 2012 Zdeněk Pavlas - 3.4.3-47 - Include langpacks when reading and writing comps. BZ 881756 From 0c6bada47c2d21ab941e50ec0f798d6c8a0a8775 Mon Sep 17 00:00:00 2001 From: Zdenek Pavlas Date: Wed, 6 Feb 2013 10:53:27 +0100 Subject: [PATCH 18/24] Conflict with yum-plugin-downloadonly. BZ 905438 --- yum.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/yum.spec b/yum.spec index 9db5653..f5460dd 100644 --- a/yum.spec +++ b/yum.spec @@ -18,7 +18,7 @@ Summary: RPM package installer/updater/manager Name: yum Version: 3.4.3 -Release: 48%{?dist} +Release: 49%{?dist} License: GPLv2+ Group: System Environment/Base Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz @@ -96,7 +96,7 @@ Provides: yum-protect-packages = 1.1.27-0.yum Provides: yum-plugin-protect-packages = 1.1.27-0.yum Obsoletes: yum-plugin-download-order <= 0.2-2 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -Obsoletes: yum-plugin-downloadonly <= 1.1.31-6.fc19 +Conflicts: yum-plugin-downloadonly <= 1.1.31-7.fc18 Provides: yum-plugin-downloadonly = 3.4.3-44.yum @@ -325,6 +325,9 @@ exit 0 %endif %changelog +* Wed Feb 6 2013 Zdenek Pavlas - 3.4.3-49 +- Conflict with yum-plugin-downloadonly. BZ 905438 + * Wed Jan 16 2013 Zdeněk Pavlas - 3.4.3-48 - Fix a typo in select_groups(). BZ 885139 From 1558c1c899041aa986d90346f13c0d06387446d9 Mon Sep 17 00:00:00 2001 From: Zdenek Pavlas Date: Tue, 19 Feb 2013 09:32:16 +0100 Subject: [PATCH 19/24] Revert last commit, bump the obsoleted range. BZ 905438 --- yum.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/yum.spec b/yum.spec index f5460dd..3c04245 100644 --- a/yum.spec +++ b/yum.spec @@ -18,7 +18,7 @@ Summary: RPM package installer/updater/manager Name: yum Version: 3.4.3 -Release: 49%{?dist} +Release: 50%{?dist} License: GPLv2+ Group: System Environment/Base Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz @@ -96,7 +96,7 @@ Provides: yum-protect-packages = 1.1.27-0.yum Provides: yum-plugin-protect-packages = 1.1.27-0.yum Obsoletes: yum-plugin-download-order <= 0.2-2 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -Conflicts: yum-plugin-downloadonly <= 1.1.31-7.fc18 +Obsoletes: yum-plugin-downloadonly <= 1.1.31-7.fc18 Provides: yum-plugin-downloadonly = 3.4.3-44.yum @@ -325,6 +325,9 @@ exit 0 %endif %changelog +* Tue Feb 19 2013 Zdenek Pavlas - 3.4.3-50 +- Revert last commit, bump the obsoleted range. BZ 905438 + * Wed Feb 6 2013 Zdenek Pavlas - 3.4.3-49 - Conflict with yum-plugin-downloadonly. BZ 905438 From eb9900ac1ab8e696c199d06eee27d9b520cc5eee Mon Sep 17 00:00:00 2001 From: James Antill Date: Tue, 19 Feb 2013 19:41:07 -0500 Subject: [PATCH 20/24] Fix non-removal of corrupt metadata files. BZ 908870. --- BZ-908870-MD-files-bad.patch | 241 +++++++++++++++++++++++++++++++++++ yum.spec | 7 +- 2 files changed, 247 insertions(+), 1 deletion(-) create mode 100644 BZ-908870-MD-files-bad.patch diff --git a/BZ-908870-MD-files-bad.patch b/BZ-908870-MD-files-bad.patch new file mode 100644 index 0000000..c8d79a8 --- /dev/null +++ b/BZ-908870-MD-files-bad.patch @@ -0,0 +1,241 @@ +commit 83fcbe745c3ee8f5f0fa29626a86c824db059b22 +Author: James Antill +Date: Thu Feb 7 12:58:07 2013 -0500 + + Fix problems with mirrors like wtfnix.com, delete bad MD files. + +diff --git a/yum/yumRepo.py b/yum/yumRepo.py +index dfcf8f9..efbc42a 100644 +--- a/yum/yumRepo.py ++++ b/yum/yumRepo.py +@@ -940,6 +941,7 @@ Insufficient space in download directory %s + range=(start, end), + ) + except URLGrabError, e: ++ self._del_dl_file(local, size) + errstr = "failed to retrieve %s from %s\nerror was %s" % (relative, self, e) + if self.mirrorurls: + errstr +="\n You could try running: yum clean expire-cache" +@@ -961,6 +963,7 @@ Insufficient space in download directory %s + **kwargs + ) + except URLGrabError, e: ++ self._del_dl_file(local, size) + errstr = "failure: %s from %s: %s" % (relative, self, e) + errors = getattr(e, 'errors', None) + raise Errors.NoMoreMirrorsRepoError(errstr, errors) +@@ -1652,6 +1655,18 @@ Insufficient space in download directory %s + raise URLGrabError(-1, 'repomd.xml does not match metalink for %s' % + self) + ++ def _del_dl_file(self, local, size): ++ """ Delete a downloaded file if it's the correct size. """ ++ ++ sd = misc.stat_f(local) ++ if not sd: # File doesn't exist... ++ return ++ ++ if size and sd.st_size < size: ++ return # Still more to get... ++ ++ # Is the correct size, or too big ... delete it so we'll try again. ++ misc.unlink_f(local) + + def checkMD(self, fn, mdtype, openchecksum=False): + """check the metadata type against its checksum""" +@@ -1681,7 +1696,7 @@ Insufficient space in download directory %s + if size is not None: + size = int(size) + +- if fast: ++ if fast and skip_old_DBMD_check: + fsize = misc.stat_f(file) + if fsize is None: # File doesn't exist... + return None +@@ -1756,16 +1771,21 @@ Insufficient space in download directory %s + + try: + def checkfunc(obj): +- self.checkMD(obj, mdtype) ++ try: ++ self.checkMD(obj, mdtype) ++ except URLGrabError: ++ # Don't share MD among mirrors, in theory we could use: ++ # self._del_dl_file(local, int(thisdata.size)) ++ # ...but this is safer. ++ misc.unlink_f(obj.filename) ++ raise + self.retrieved[mdtype] = 1 + text = "%s/%s" % (self, mdtype) + if thisdata.size is None: + reget = None + else: + reget = 'simple' +- if os.path.exists(local): +- if os.stat(local).st_size >= int(thisdata.size): +- misc.unlink_f(local) ++ self._del_dl_file(local, int(thisdata.size)) + local = self._getFile(relative=remote, + local=local, + copy_local=1, +commit c148eb10b798270b3d15087433c8efb2a79a69d0 +Author: James Antill +Date: Mon Feb 18 16:17:06 2013 -0500 + + Use xattr data as well as file size for "fast checksumming". + +diff --git a/yum/yumRepo.py b/yum/yumRepo.py +index efbc42a..8c38093 100644 +--- a/yum/yumRepo.py ++++ b/yum/yumRepo.py +@@ -52,15 +52,54 @@ import stat + import errno + import tempfile + +-# If you want yum to _always_ check the MD .sqlite files then set this to +-# False (this doesn't affect .xml files or .sqilte files derived from them). +-# With this as True yum will only check when a new repomd.xml or +-# new MD is downloaded. +-# Note that with atomic MD, we can't have old MD lying around anymore so +-# the only way we need this check is if someone does something like: +-# cp primary.sqlite /var/cache/yum/blah +-# ...at which point you lose. +-skip_old_DBMD_check = True ++# This is unused now, probably nothing uses it but it was global/public. ++skip_old_DBMD_check = False ++ ++try: ++ import xattr ++ if not hasattr(xattr, 'get') or not hasattr(xattr, 'set'): ++ xattr = None # This is a "newer" API. ++except ImportError: ++ xattr = None ++ ++# The problem we are trying to solve here is that: ++# ++# 1. We rarely want to be downloading MD/pkgs/etc. ++# 2. We want to check those files are valid (match checksums) when we do ++# download them. ++# 3. We _really_ don't want to checksum all the files everytime we ++# run (100s of MBs). ++# 4. We can continue to download files from bad mirrors, or retry files due to ++# C-c etc. ++# ++# ...we used to solve this by just checking the file size, and assuming the ++# files had been downloaded and checksumed as correct if that matched. But that ++# was error prone on bad mirrors, so now we store the checksum in an ++# xattr ... this does mean that if you can't store xattrs (Eg. NFS) you will ++# rechecksum everything constantly. ++ ++def _xattr_get_chksum(filename, chktype): ++ if not xattr: ++ return None ++ ++ try: ++ ret = xattr.get(filename, 'user.yum.checksum.' + chktype) ++ except: # Documented to be "EnvironmentError", but make sure ++ return None ++ ++ return ret ++ ++def _xattr_set_chksum(filename, chktype, chksum): ++ if not xattr: ++ return None ++ ++ try: ++ xattr.set(filename, 'user.yum.checksum.' + chktype, chksum) ++ except: ++ return False # Data too long. = IOError ... ignore everything. ++ ++ return True ++ + + warnings.simplefilter("ignore", Errors.YumFutureDeprecationWarning) + +@@ -228,7 +267,7 @@ 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): ++ def _check_uncompressed_db_gen(self, repo, mdtype): + """return file name of db in gen/ dir if good, None if not""" + + mydbdata = repo.repoXML.getData(mdtype) +@@ -238,7 +277,7 @@ class YumPackageSack(packageSack.PackageSack): + db_un_fn = mdtype + '.sqlite' + + if not repo._checkMD(compressed_fn, mdtype, data=mydbdata, +- check_can_fail=fast, fast=fast): ++ check_can_fail=True): + return None + + ret = misc.repo_gen_decompress(compressed_fn, db_un_fn, +@@ -261,8 +300,7 @@ class YumPackageSack(packageSack.PackageSack): + result = None + + if os.path.exists(db_un_fn): +- if skip_old_DBMD_check and repo._using_old_MD: +- return db_un_fn ++ + + try: + repo.checkMD(db_un_fn, mdtype, openchecksum=True) +@@ -296,7 +334,6 @@ class YumRepository(Repository, config.RepoConf): + # eventually want + self.repoMDFile = 'repodata/repomd.xml' + self._repoXML = None +- self._using_old_MD = None + self._oldRepoMDData = {} + self.cache = 0 + self.mirrorlistparsed = 0 +@@ -1407,7 +1444,6 @@ Insufficient space in download directory %s + self._revertOldRepoXML() + return False + +- self._using_old_MD = caching + if caching: + return False # Skip any work. + +@@ -1673,7 +1709,7 @@ Insufficient space in download directory %s + return self._checkMD(fn, mdtype, openchecksum) + + def _checkMD(self, fn, mdtype, openchecksum=False, +- data=None, check_can_fail=False, fast=False): ++ data=None, check_can_fail=False): + """ Internal function, use .checkMD() from outside yum. """ + + thisdata = data # So the argument name is nicer +@@ -1696,17 +1732,15 @@ Insufficient space in download directory %s + if size is not None: + size = int(size) + +- if fast and skip_old_DBMD_check: ++ l_csum = _xattr_get_chksum(file, r_ctype) ++ if l_csum: + 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') ++ if fsize is not None: # We just got an xattr, so it should be there ++ if size is None and l_csum == r_csum: ++ return 1 ++ if size == fsize.st_size and l_csum == r_csum: ++ return 1 ++ # Anything goes wrong, run the checksums as normal... + + try: # get the local checksum + l_csum = self._checksum(r_ctype, file, datasize=size) +@@ -1716,6 +1750,7 @@ Insufficient space in download directory %s + raise URLGrabError(-3, 'Error performing checksum') + + if l_csum == r_csum: ++ _xattr_set_chksum(file, r_ctype, l_csum) + return 1 + else: + if check_can_fail: diff --git a/yum.spec b/yum.spec index 3c04245..15c7050 100644 --- a/yum.spec +++ b/yum.spec @@ -34,6 +34,7 @@ Patch20: yum-manpage-files.patch Patch21: yum-completion-helper.patch Patch22: BZ-881756-include-langpacks.patch Patch23: BZ-885139-not-enough-arguments.patch +Patch24: BZ-908870-MD-files-bad.patch URL: http://yum.baseurl.org/ BuildArchitectures: noarch @@ -60,7 +61,7 @@ Requires: yum-metadata-parser >= 1.1.0 Requires: pygpgme # rawhide is >= 0.5.3-7.fc18 ... as this is added. Requires: pyliblzma - +Requires: pyxattr Conflicts: rpm >= 5-0 # Zif is a re-implementation of yum in C, however: @@ -150,6 +151,7 @@ Install this package if you want auto yum updates nightly via cron. %patch21 -p1 %patch22 -p1 %patch23 -p1 +%patch24 -p1 %patch1 -p1 %build @@ -325,6 +327,9 @@ exit 0 %endif %changelog +* Tue Feb 19 2013 James Antill - 3.4.3-51 +- Fix non-removal of corrupt metadata files. BZ 908870. + * Tue Feb 19 2013 Zdenek Pavlas - 3.4.3-50 - Revert last commit, bump the obsoleted range. BZ 905438 From c1c8e4faf3080e765b13671cb9c1495989dbd4ee Mon Sep 17 00:00:00 2001 From: James Antill Date: Tue, 19 Feb 2013 19:44:26 -0500 Subject: [PATCH 21/24] Fix non-removal of corrupt metadata files. BZ 908870. --- yum.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yum.spec b/yum.spec index 15c7050..002034c 100644 --- a/yum.spec +++ b/yum.spec @@ -18,7 +18,7 @@ Summary: RPM package installer/updater/manager Name: yum Version: 3.4.3 -Release: 50%{?dist} +Release: 51%{?dist} License: GPLv2+ Group: System Environment/Base Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz From f14f2b26c6fe03d324bcdee825234015ff90aeb6 Mon Sep 17 00:00:00 2001 From: Zdenek Pavlas Date: Mon, 11 Mar 2013 11:23:32 +0100 Subject: [PATCH 22/24] ui_id: prevent TB on invalid repos with no URLs. BZ 870691 --- BZ-870691-repos-with-no-url.patch | 22 ++++++++++++++++++++++ yum.spec | 7 ++++++- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 BZ-870691-repos-with-no-url.patch diff --git a/BZ-870691-repos-with-no-url.patch b/BZ-870691-repos-with-no-url.patch new file mode 100644 index 0000000..16ca85d --- /dev/null +++ b/BZ-870691-repos-with-no-url.patch @@ -0,0 +1,22 @@ +commit 40d9d5f4c3a00b2efa6ee0b64fe4d1ec52d46a69 +Author: Zdeněk Pavlas +Date: Mon Oct 29 09:22:02 2012 +0100 + + ui_id: prevent TB on invalid repos with no URLs. BZ 870691. + +diff --git a/yum/yumRepo.py b/yum/yumRepo.py +index e362c43..414f1d9 100644 +--- a/yum/yumRepo.py ++++ b/yum/yumRepo.py +@@ -381,8 +381,10 @@ class YumRepository(Repository, config.RepoConf): + val = ini['metalink'] + elif 'mirrorlist' in ini: + val = ini['mirrorlist'] +- else: ++ elif 'baseurl' in ini: + val = ini['baseurl'] ++ else: ++ val = '' + ret = self.id + if '$releasever' in val: + ret += '/' diff --git a/yum.spec b/yum.spec index 002034c..f38aa45 100644 --- a/yum.spec +++ b/yum.spec @@ -18,7 +18,7 @@ Summary: RPM package installer/updater/manager Name: yum Version: 3.4.3 -Release: 51%{?dist} +Release: 52%{?dist} License: GPLv2+ Group: System Environment/Base Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz @@ -35,6 +35,7 @@ Patch21: yum-completion-helper.patch Patch22: BZ-881756-include-langpacks.patch Patch23: BZ-885139-not-enough-arguments.patch Patch24: BZ-908870-MD-files-bad.patch +Patch25: BZ-870691-repos-with-no-url.patch URL: http://yum.baseurl.org/ BuildArchitectures: noarch @@ -152,6 +153,7 @@ Install this package if you want auto yum updates nightly via cron. %patch22 -p1 %patch23 -p1 %patch24 -p1 +%patch25 -p1 %patch1 -p1 %build @@ -327,6 +329,9 @@ exit 0 %endif %changelog +* Mon Mar 11 2013 Zdenek Pavlas - 3.4.3-52 +- ui_id: prevent TB on invalid repos with no URLs. BZ 870691 + * Tue Feb 19 2013 James Antill - 3.4.3-51 - Fix non-removal of corrupt metadata files. BZ 908870. From 605e50730032b876e64eae50eba4c712cdbc1e08 Mon Sep 17 00:00:00 2001 From: Zdenek Pavlas Date: Mon, 25 Mar 2013 15:19:03 +0100 Subject: [PATCH 23/24] fix bugs in package download and verify --- ...7240-fix-package-download-and-verify.patch | 44 +++++++++++++++++++ yum.spec | 8 +++- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 BZ-927240-fix-package-download-and-verify.patch diff --git a/BZ-927240-fix-package-download-and-verify.patch b/BZ-927240-fix-package-download-and-verify.patch new file mode 100644 index 0000000..a737ff0 --- /dev/null +++ b/BZ-927240-fix-package-download-and-verify.patch @@ -0,0 +1,44 @@ +commit fe21657d863708d48fe2ec4e056c37a1b676661c +Author: Zdeněk Pavlas +Date: Wed Nov 14 09:51:26 2012 +0100 + + can't verify package before it's downloaded + +diff --git a/yum/yumRepo.py b/yum/yumRepo.py +index 6bf520f..4f5f7a6 100644 +--- a/yum/yumRepo.py ++++ b/yum/yumRepo.py +@@ -993,7 +993,8 @@ Insufficient space in download directory %s + **kwargs + ) + +- if not package.verifyLocalPkg(): # Don't return as "success" when bad. ++ if not kwargs.get('async') and not package.verifyLocalPkg(): ++ # Don't return as "success" when bad. + msg = "Downloaded package %s, from %s, but it was invalid." + msg = msg % (package, package.repo.id) + raise Errors.RepoError, msg + +downloadPkgs: skip duplicated packages + +diff -up yum-3.4.3/yum/__init__.py.old yum-3.4.3/yum/__init__.py +--- yum-3.4.3/yum/__init__.py.old 2013-03-25 14:45:17.125277817 +0100 ++++ yum-3.4.3/yum/__init__.py 2013-03-25 14:48:31.158718960 +0100 +@@ -2226,11 +2226,17 @@ much more problems). + repo_cached = False + remote_pkgs = [] + remote_size = 0 ++ beenthere = set() # only once, please. BZ 468401 + for po in pkglist: + if hasattr(po, 'pkgtype') and po.pkgtype == 'local': + continue + + local = po.localPkg() ++ if local in beenthere: ++ # This is definitely a depsolver bug. Make it fatal? ++ self.verbose_logger.warn(_("ignoring a dupe of %s") % po) ++ continue ++ beenthere.add(local) + if os.path.exists(local): + if not self.verifyPkg(local, po, False): + if po.repo.cache: diff --git a/yum.spec b/yum.spec index f38aa45..53f8e96 100644 --- a/yum.spec +++ b/yum.spec @@ -18,7 +18,7 @@ Summary: RPM package installer/updater/manager Name: yum Version: 3.4.3 -Release: 52%{?dist} +Release: 53%{?dist} License: GPLv2+ Group: System Environment/Base Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz @@ -36,6 +36,7 @@ Patch22: BZ-881756-include-langpacks.patch Patch23: BZ-885139-not-enough-arguments.patch Patch24: BZ-908870-MD-files-bad.patch Patch25: BZ-870691-repos-with-no-url.patch +Patch26: BZ-927240-fix-package-download-and-verify.patch URL: http://yum.baseurl.org/ BuildArchitectures: noarch @@ -154,6 +155,7 @@ Install this package if you want auto yum updates nightly via cron. %patch23 -p1 %patch24 -p1 %patch25 -p1 +%patch26 -p1 %patch1 -p1 %build @@ -329,6 +331,10 @@ exit 0 %endif %changelog +* Mon Mar 25 2013 Zdenek Pavlas - 3.4.3-53 +- fix getPackage() calling verifyLocalPkg() too early +- downloadPkgs(): skip duplicated packages, issue warning. + * Mon Mar 11 2013 Zdenek Pavlas - 3.4.3-52 - ui_id: prevent TB on invalid repos with no URLs. BZ 870691 From 6d0388921c43a851dde1019c5ed30036467c6aa2 Mon Sep 17 00:00:00 2001 From: Zdenek Pavlas Date: Thu, 4 Apr 2013 18:27:12 +0200 Subject: [PATCH 24/24] Fix a depsolver traceback. BZ 920758 --- ...-keep-installedFileRequires-inc-sync.patch | 34 +++++++++++++++++++ yum.spec | 7 +++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 BZ-920758-keep-installedFileRequires-inc-sync.patch diff --git a/BZ-920758-keep-installedFileRequires-inc-sync.patch b/BZ-920758-keep-installedFileRequires-inc-sync.patch new file mode 100644 index 0000000..c0bc9be --- /dev/null +++ b/BZ-920758-keep-installedFileRequires-inc-sync.patch @@ -0,0 +1,34 @@ +diff -up yum-3.4.3/yum/depsolve.py.old yum-3.4.3/yum/depsolve.py +--- yum-3.4.3/yum/depsolve.py.old 2013-04-04 18:21:22.477786494 +0200 ++++ yum-3.4.3/yum/depsolve.py 2013-04-04 18:22:48.742547795 +0200 +@@ -918,6 +918,9 @@ class Depsolve(object): + self._last_req = None + self.pkgSack.delPackage(otxmbr.po) + self.up.delPackage(otxmbr.pkgtup) ++ # Update the cache and recheck file requires ++ (self.installedFileRequires or {}).pop(otxmbr.pkgtup, None) ++ CheckRemoves = True + + if CheckDeps: + if self.dsCallback: self.dsCallback.restartLoop() +@@ -1177,10 +1180,10 @@ class Depsolve(object): + + # get file requirements from new packages + for txmbr in self._tsInfo.getMembersWithState(output_states=TS_INSTALL_STATES): ++ files = [] + for name, flag, evr in txmbr.po.requires: + if name.startswith('/'): +- pt = txmbr.po.pkgtup +- self.installedFileRequires.setdefault(pt, []).append(name) ++ files.append(name) + # check if file requires was already unresolved in update + if name in self.installedUnresolvedFileRequires: + already_broken = False +@@ -1194,6 +1197,7 @@ class Depsolve(object): + nfileRequires.add(name) + fileRequires.add(name) + reverselookup.setdefault(name, []).append(txmbr.po.pkgtup) ++ self.installedFileRequires[txmbr.po.pkgtup] = files + + todel = [] + for fname in self.installedFileProviders: diff --git a/yum.spec b/yum.spec index 53f8e96..01ba845 100644 --- a/yum.spec +++ b/yum.spec @@ -18,7 +18,7 @@ Summary: RPM package installer/updater/manager Name: yum Version: 3.4.3 -Release: 53%{?dist} +Release: 54%{?dist} License: GPLv2+ Group: System Environment/Base Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz @@ -37,6 +37,7 @@ Patch23: BZ-885139-not-enough-arguments.patch Patch24: BZ-908870-MD-files-bad.patch Patch25: BZ-870691-repos-with-no-url.patch Patch26: BZ-927240-fix-package-download-and-verify.patch +Patch27: BZ-920758-keep-installedFileRequires-inc-sync.patch URL: http://yum.baseurl.org/ BuildArchitectures: noarch @@ -156,6 +157,7 @@ Install this package if you want auto yum updates nightly via cron. %patch24 -p1 %patch25 -p1 %patch26 -p1 +%patch27 -p1 %patch1 -p1 %build @@ -331,6 +333,9 @@ exit 0 %endif %changelog +* Thu Apr 4 2013 Zdenek Pavlas - 3.4.3-54 +- Fix a depsolver traceback. BZ 920758 + * Mon Mar 25 2013 Zdenek Pavlas - 3.4.3-53 - fix getPackage() calling verifyLocalPkg() too early - downloadPkgs(): skip duplicated packages, issue warning.