[yum] Update to latest HEAD.
James Antill
james at fedoraproject.org
Fri Sep 6 20:38:43 UTC 2013
commit ab130cc7e2929b9231398b9c9680594512370f3e
Author: James Antill <james at and.org>
Date: Fri Sep 6 16:38:30 2013 -0400
Update to latest HEAD.
- Add cache check to repolist, using "!". Document repoinfo.
- Add epoch to updateinfo xml output.
- Add missing translation hooks for ignored -c option message.
- Try to smooth out the edge cases for cacheReq not ever updating data.
yum-HEAD.patch | 384 ++++++++++++++++++++++++++++++++++++--------------------
yum.spec | 9 ++-
2 files changed, 256 insertions(+), 137 deletions(-)
---
diff --git a/yum-HEAD.patch b/yum-HEAD.patch
index f4dcdae..f42f70f 100644
--- a/yum-HEAD.patch
+++ b/yum-HEAD.patch
@@ -107,7 +107,7 @@ index 2f6154e..2e5a052 100644
diff --git a/cli.py b/cli.py
old mode 100644
new mode 100755
-index 6056d38..8358c55
+index 6056d38..e679546
--- a/cli.py
+++ b/cli.py
@@ -25,7 +25,7 @@ import sys
@@ -277,6 +277,20 @@ index 6056d38..8358c55
sys.exit(1)
# update usage in case plugins have added commands
+@@ -263,11 +302,11 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+ if opts.verbose:
+ opts.debuglevel = opts.errorlevel = 6
+ if opts.debuglevel != pc.debuglevel or opts.errorlevel != pc.errorlevel:
+- self.logger.warning("Ignored option -q, -v, -d or -e (probably due to merging: -yq != -y -q)")
++ self.logger.warning(_("Ignored option -q, -v, -d or -e (probably due to merging: -yq != -y -q)"))
+ # getRoot() changes it, but then setupYumConfig() changes it back. So
+ # don't test for this, if we are using --installroot.
+ if root == '/' and opts.conffile != pc.fn:
+- self.logger.warning("Ignored option -c (probably due to merging -yc != -y -c)")
++ self.logger.warning(_("Ignored option -c (probably due to merging -yc != -y -c)"))
+
+ if opts.version:
+ self.conf.cache = 1
@@ -290,9 +329,9 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
self.term.MODE['normal'])
print _(" Installed: %s-%s at %s") %(name, ver,
@@ -306,7 +320,7 @@ index 6056d38..8358c55
self.verbose_logger.log(yum.logginglevels.DEBUG_4,
'COMMAND: %s', self.cmdstring)
self.verbose_logger.log(yum.logginglevels.DEBUG_4,
-@@ -349,6 +390,13 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -349,6 +390,50 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
self.basecmd, sys.argv[0])
raise CliError
@@ -314,13 +328,50 @@ index 6056d38..8358c55
+ cacheReq = 'write'
+ if hasattr(cmd, 'cacheRequirement'):
+ cacheReq = cmd.cacheRequirement(self, self.basecmd, self.extcmds)
++
++ # The main thing we want to do here is that if the user has done a
++ # "yum makecache fast" or has yum-cron running or something, then try
++ # not to update the repo. caches ... thus. not turning 0.5s ops. into
++ # 100x longer ops.
++ # However if the repos. are not in sync. that's probably not going to
++ # work well (Eg. user enables updates-testing). Also give a warning if
++ # they are _really_ old.
++ ts_min = None
++ ts_max = None
++ for repo in self.repos.sort():
++ if not os.path.exists(repo.metadata_cookie):
++ ts_min = None
++ break
++
++ rts = os.stat(repo.metadata_cookie).st_mtime
++ if not ts_min:
++ ts_min = rts
++ ts_max = rts
++ elif rts > ts_max:
++ ts_max = rts
++ elif rts < ts_min:
++ ts_min = rts
++
++ if ts_min:
++ # If caches are within 5 days of each other, they are ok to work
++ # together (lol, random numbers)...
++ if (ts_max - ts_min) > (60 * 60 * 24 * 5):
++ ts_min = None
++ elif ts_max > time.time():
++ ts_min = None
++
++ if not ts_min:
++ cacheReq = 'write'
++ elif (time.time() - ts_max) > (60 * 60 * 24 * 14):
++ self.logger.warning(_("Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast"))
++
+ for repo in self.repos.sort():
+ repo._metadata_cache_req = cacheReq
+
self.yum_cli_commands[self.basecmd].doCheck(self, self.basecmd, self.extcmds)
def _shell_history_write(self):
-@@ -365,7 +413,11 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -365,7 +450,11 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
self.history.write_addon_data('shell-cmds', data)
def doShell(self):
@@ -333,7 +384,7 @@ index 6056d38..8358c55
yumshell = shell.YumShell(base=self)
-@@ -382,8 +434,12 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -382,8 +471,12 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
return yumshell.result, yumshell.resultmsgs
def errorSummary(self, errstring):
@@ -348,19 +399,11 @@ index 6056d38..8358c55
summary = ''
# do disk space report first
p = re.compile('needs (\d+)MB on the (\S+) filesystem')
-@@ -407,17 +463,45 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -407,17 +500,45 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
return summary
- def doCommands(self):
-- """
-- Calls the base command passes the extended commands/args out to be
-- parsed (most notably package globs).
--
-- Returns a numeric result code and an optional string
-- - 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
+ def waitForLock(self):
+ """Establish the yum lock. If another process is already
+ holding the yum lock, by default this method will keep trying
@@ -368,6 +411,14 @@ index 6056d38..8358c55
+ :attr:`self.conf.exit_on_lock` is set to True, it will
+ raise a :class:`Errors.YumBaseError`.
"""
+- Calls the base command passes the extended commands/args out to be
+- parsed (most notably package globs).
+-
+- Returns a numeric result code and an optional string
+- - 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
+- """
-
+ lockerr = ""
+ while True:
@@ -404,7 +455,7 @@ index 6056d38..8358c55
# at this point we know the args are valid - we don't know their meaning
# but we know we're not being sent garbage
-@@ -435,14 +519,41 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -435,14 +556,41 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
try:
self._getTs(needTsRemove)
except yum.Errors.YumBaseError, e:
@@ -450,7 +501,7 @@ index 6056d38..8358c55
# just make sure there's not, well, nothing to do
if len(self.tsInfo) == 0:
self.verbose_logger.info(_('Trying to run the transaction but nothing to do. Exiting.'))
-@@ -453,7 +564,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -453,7 +601,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
lsts = self.listTransaction()
if self.verbose_logger.isEnabledFor(yum.logginglevels.INFO_1):
self.verbose_logger.log(yum.logginglevels.INFO_1, lsts)
@@ -459,7 +510,7 @@ index 6056d38..8358c55
# If we are in quiet, and assumeyes isn't on we want to output
# at least the transaction list anyway.
self.logger.warn(lsts)
-@@ -463,7 +574,6 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -463,7 +611,6 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
rmpkgs = []
stuff_to_download = False
install_only = True
@@ -467,7 +518,7 @@ index 6056d38..8358c55
for txmbr in self.tsInfo.getMembers():
if txmbr.ts_state not in ('i', 'u'):
install_only = False
-@@ -471,7 +581,6 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -471,7 +618,6 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
if po:
rmpkgs.append(po)
else:
@@ -475,7 +526,7 @@ index 6056d38..8358c55
stuff_to_download = True
po = txmbr.po
if po:
-@@ -489,19 +598,40 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -489,19 +635,40 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
else:
self.reportDownloadSize(downloadpkgs, install_only)
@@ -521,7 +572,7 @@ index 6056d38..8358c55
for key in problems:
errors = yum.misc.unique(problems[key])
for error in errors:
-@@ -520,8 +650,9 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -520,8 +687,9 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
rcd_st = time.time()
self.verbose_logger.log(yum.logginglevels.INFO_2,
@@ -532,7 +583,7 @@ index 6056d38..8358c55
if msgs:
rpmlib_only = True
for msg in msgs:
-@@ -532,21 +663,23 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -532,21 +700,23 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
print _("ERROR You need to update rpm to handle:")
else:
print _('ERROR with transaction check vs depsolve:')
@@ -561,7 +612,7 @@ index 6056d38..8358c55
self.ts.order() # order the transaction
self.ts.clean() # release memory not needed beyond this point
-@@ -556,16 +689,16 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -556,16 +726,16 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
del testcb
if len(tserrors) > 0:
@@ -581,7 +632,7 @@ index 6056d38..8358c55
# unset the sigquit handler
signal.signal(signal.SIGQUIT, signal.SIG_DFL)
-@@ -595,7 +728,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -595,7 +765,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
if self.conf.debuglevel < 2:
cb.display.output = False
@@ -590,7 +641,7 @@ index 6056d38..8358c55
resultobject = self.runTransaction(cb=cb)
self.verbose_logger.debug('Transaction time: %0.3f' % (time.time() - ts_st))
-@@ -609,12 +742,14 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -609,12 +779,14 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
return resultobject.return_code
def gpgsigcheck(self, pkgs):
@@ -610,7 +661,7 @@ index 6056d38..8358c55
for po in pkgs:
result, errmsg = self.sigCheckPkg(po)
-@@ -623,7 +758,8 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -623,7 +795,8 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
continue
elif result == 1:
@@ -620,7 +671,7 @@ index 6056d38..8358c55
raise yum.Errors.YumBaseError, \
_('Refusing to automatically import keys when running ' \
'unattended.\nUse "-y" to override.')
-@@ -691,12 +827,62 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -691,12 +864,62 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
", ".join(matches))
self.verbose_logger.log(yum.logginglevels.INFO_2, msg)
@@ -689,7 +740,7 @@ index 6056d38..8358c55
# get the list of available packages
# iterate over the user's list
# add packages to Transaction holding class if they match.
-@@ -710,11 +896,36 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -710,11 +933,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))):
@@ -728,7 +779,7 @@ index 6056d38..8358c55
except yum.Errors.InstallError:
self.verbose_logger.log(yum.logginglevels.INFO_2,
_('No package %s%s%s available.'),
-@@ -723,6 +934,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -723,6 +971,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
self._maybeYouMeant(arg)
else:
done = True
@@ -736,7 +787,7 @@ index 6056d38..8358c55
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 +944,27 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -732,9 +981,27 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
return 0, [_('Nothing to do')]
def updatePkgs(self, userlist, quiet=0, update_to=False):
@@ -767,7 +818,7 @@ index 6056d38..8358c55
# 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,34 +975,46 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -745,34 +1012,46 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
else:
# go through the userlist - look for items that are local rpms. If we find them
@@ -831,7 +882,7 @@ index 6056d38..8358c55
level = 'diff'
if userlist and userlist[0] in ('full', 'diff', 'different'):
-@@ -831,6 +1073,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -831,6 +1110,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
continue
nayi = napkg.yumdb_info
@@ -839,7 +890,7 @@ index 6056d38..8358c55
for apkg in self.pkgSack.searchPkgTuple(napkg.pkgtup):
if ('checksum_type' in nayi and
'checksum_data' in nayi and
-@@ -861,19 +1104,58 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -861,19 +1141,58 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
dupdates.extend(self.downgrade(name=n, epoch=e, ver=v, rel=r))
if dupdates:
@@ -906,7 +957,7 @@ index 6056d38..8358c55
if not rms:
self._checkMaybeYouMeant(arg, always_output=False, rpmdb_only=True)
all_rms.extend(rms)
-@@ -884,12 +1166,24 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -884,12 +1203,24 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
return 0, [_('No Packages marked for removal')]
def downgradePkgs(self, userlist):
@@ -934,7 +985,7 @@ index 6056d38..8358c55
for arg in userlist:
if (arg.endswith('.rpm') and (yum.misc.re_remote_url(arg) or
os.path.exists(arg))):
-@@ -905,26 +1199,44 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -905,26 +1236,44 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
self.term.MODE['bold'], arg,
self.term.MODE['normal'])
self._maybeYouMeant(arg)
@@ -983,7 +1034,7 @@ index 6056d38..8358c55
except yum.Errors.ReinstallRemoveError:
self._checkMaybeYouMeant(arg, always_output=False)
except yum.Errors.ReinstallInstallError, e:
-@@ -940,22 +1252,38 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -940,22 +1289,38 @@ 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)
@@ -1026,7 +1077,7 @@ index 6056d38..8358c55
installing = False
for pkg in filelist:
-@@ -971,23 +1299,29 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -971,23 +1336,29 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
return 2, [_('Package(s) to install')]
return 0, [_('Nothing to do')]
@@ -1072,7 +1123,7 @@ index 6056d38..8358c55
pkgnarrow = 'all'
done_hidden_available = False
-@@ -1003,7 +1337,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1003,7 +1374,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
pkgnarrow = extcmds.pop(0)
ypl = self.doPackageLists(pkgnarrow=pkgnarrow, patterns=extcmds,
@@ -1081,7 +1132,7 @@ index 6056d38..8358c55
if self.conf.showdupesfromrepos:
ypl.available += ypl.reinstall_available
-@@ -1017,8 +1351,25 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1017,8 +1388,25 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
return ypl
def search(self, args):
@@ -1109,7 +1160,7 @@ index 6056d38..8358c55
# call the yum module search function with lists of tags to search
# and what to search for
-@@ -1053,7 +1404,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1053,7 +1441,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
print ""
else:
mkeys = set(keys)
@@ -1118,7 +1169,7 @@ index 6056d38..8358c55
okeys = keys
pos.add(po)
akeys.update(keys)
-@@ -1104,13 +1455,24 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1104,13 +1492,24 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
self.logger.warning(_('Warning: No matches found for: %s'), arg)
if not akeys:
@@ -1136,9 +1187,9 @@ index 6056d38..8358c55
+ :param args: a list of names or wildcards specifying packages
+ that should have their dependenices printed
+ :return: (exit_code, [ errors ])
-
-+ exit_code is::
+
++ exit_code is::
+
+ 0 = we're done, exit
+ 1 = we've errored, exit with error string
+ 2 = we've got work yet to do, onto the next stage
@@ -1146,7 +1197,7 @@ index 6056d38..8358c55
pkgs = []
for arg in args:
if (arg.endswith('.rpm') and (yum.misc.re_remote_url(arg) or
-@@ -1118,10 +1480,12 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1118,10 +1517,12 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
thispkg = yum.packages.YumUrlPackage(self, self.ts, arg)
pkgs.append(thispkg)
elif self.conf.showdupesfromrepos:
@@ -1161,7 +1212,7 @@ index 6056d38..8358c55
except yum.Errors.PackageSackError:
pass
-@@ -1131,10 +1495,19 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1131,10 +1532,19 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
return 0, []
def provides(self, args):
@@ -1185,7 +1236,7 @@ index 6056d38..8358c55
old_sdup = self.conf.showdupesfromrepos
# For output, as searchPackageProvides() is always in showdups mode
self.conf.showdupesfromrepos = True
-@@ -1147,6 +1520,8 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1147,6 +1557,8 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
paths = set(sys.path + os.environ['PATH'].split(':'))
nargs = []
for arg in args:
@@ -1194,7 +1245,7 @@ index 6056d38..8358c55
if yum.misc.re_filename(arg) or yum.misc.re_glob(arg):
continue
for path in paths:
-@@ -1158,25 +1533,82 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1158,25 +1570,82 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
self.conf.showdupesfromrepos = old_sdup
if len(matching) == 0:
@@ -1283,7 +1334,7 @@ index 6056d38..8358c55
hdrcode = pkgcode = xmlcode = dbcode = expccode = 0
pkgresults = hdrresults = xmlresults = dbresults = expcresults = []
msg = self.fmtKeyValFill(_('Cleaning repos: '),
-@@ -1184,7 +1616,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1184,7 +1653,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
self.verbose_logger.log(yum.logginglevels.INFO_2, msg)
if 'all' in userlist:
self.verbose_logger.log(yum.logginglevels.INFO_2,
@@ -1292,7 +1343,7 @@ index 6056d38..8358c55
pkgcode, pkgresults = self.cleanPackages()
hdrcode, hdrresults = self.cleanHeaders()
xmlcode, xmlresults = self.cleanMetadata()
-@@ -1200,10 +1632,10 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1200,10 +1669,10 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
return code, []
if 'headers' in userlist:
@@ -1305,7 +1356,7 @@ index 6056d38..8358c55
pkgcode, pkgresults = self.cleanPackages()
if 'metadata' in userlist:
self.logger.debug(_('Cleaning up xml metadata'))
-@@ -1228,138 +1660,265 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1228,138 +1697,265 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
return code, []
def returnGroupLists(self, userlist):
@@ -1315,10 +1366,10 @@ index 6056d38..8358c55
+ :param extcmds: a list of names or wildcards specifying
+ groups to list
+ :return: (exit_code, [ errors ])
-+
-+ exit_code is::
- uservisible=1
++ 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
@@ -1653,7 +1704,7 @@ index 6056d38..8358c55
continue
if not pkgs_used:
-@@ -1368,17 +1927,55 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1368,17 +1964,55 @@ 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):
@@ -1717,7 +1768,7 @@ index 6056d38..8358c55
if not pkgs_used:
return 0, [_('No packages to remove from groups')]
-@@ -1389,7 +1986,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1389,7 +2023,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
def _promptWanted(self):
# shortcut for the always-off/always-on options
@@ -1726,7 +1777,7 @@ index 6056d38..8358c55
return False
if self.conf.alwaysprompt:
return True
-@@ -1397,10 +1994,9 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1397,10 +2031,9 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
# prompt if:
# package was added to fill a dependency
# package is being removed
@@ -1738,7 +1789,7 @@ index 6056d38..8358c55
txmbr.name not in self.extcmds:
return True
-@@ -1408,11 +2004,11 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1408,11 +2041,11 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
return False
def usage(self):
@@ -1752,7 +1803,7 @@ index 6056d38..8358c55
sys.stdout.write(self.optparser.get_usage())
def _installable(self, pkg, ematch=False):
-@@ -1468,9 +2064,9 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1468,9 +2101,9 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
return False
class YumOptionParser(OptionParser):
@@ -1764,7 +1815,7 @@ index 6056d38..8358c55
def __init__(self,base, **kwargs):
# check if this is called with a utils=True/False parameter
-@@ -1488,13 +2084,23 @@ class YumOptionParser(OptionParser):
+@@ -1488,13 +2121,23 @@ class YumOptionParser(OptionParser):
self._addYumBasicOptions()
def error(self, msg):
@@ -1790,7 +1841,7 @@ index 6056d38..8358c55
try:
args = _filtercmdline(
('--noplugins','--version','-q', '-v', "--quiet", "--verbose"),
-@@ -1521,7 +2127,15 @@ class YumOptionParser(OptionParser):
+@@ -1521,7 +2164,15 @@ class YumOptionParser(OptionParser):
return ret
def setupYumConfig(self, args=None):
@@ -1807,7 +1858,7 @@ index 6056d38..8358c55
if not args:
(opts, cmds) = self.parse_args()
else:
-@@ -1533,16 +2147,30 @@ class YumOptionParser(OptionParser):
+@@ -1533,16 +2184,30 @@ class YumOptionParser(OptionParser):
try:
# config file is parsed and moving us forward
# set some things in it.
@@ -1844,7 +1895,7 @@ index 6056d38..8358c55
self.base.conf.cache = 1
if opts.obsoletes:
-@@ -1574,11 +2202,8 @@ class YumOptionParser(OptionParser):
+@@ -1574,11 +2239,8 @@ class YumOptionParser(OptionParser):
if opts.color != 'auto':
self.base.term.reinit(color=opts.color)
@@ -1858,7 +1909,7 @@ index 6056d38..8358c55
for exclude in self._splitArg(opts.exclude):
try:
-@@ -1610,10 +2235,6 @@ class YumOptionParser(OptionParser):
+@@ -1610,10 +2272,6 @@ class YumOptionParser(OptionParser):
self.base.usage()
sys.exit(1)
@@ -1869,7 +1920,7 @@ index 6056d38..8358c55
# Disable all gpg key checking, if requested.
if opts.nogpgcheck:
# Altering the normal configs. doesn't work too well, esp. with
-@@ -1623,7 +2244,7 @@ class YumOptionParser(OptionParser):
+@@ -1623,7 +2281,7 @@ class YumOptionParser(OptionParser):
repo._override_sigchecks = True
except ValueError, e:
@@ -1878,7 +1929,7 @@ index 6056d38..8358c55
self.base.usage()
sys.exit(1)
-@@ -1640,10 +2261,18 @@ class YumOptionParser(OptionParser):
+@@ -1640,10 +2298,18 @@ class YumOptionParser(OptionParser):
sys.exit(1)
def getRoot(self,opts):
@@ -1898,7 +1949,7 @@ index 6056d38..8358c55
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 +2330,9 @@ class YumOptionParser(OptionParser):
+@@ -1701,6 +2367,9 @@ class YumOptionParser(OptionParser):
group.add_option("--showduplicates", dest="showdupesfromrepos",
action="store_true",
help=_("show duplicates, in repos, in list/search commands"))
@@ -1908,7 +1959,7 @@ index 6056d38..8358c55
group.add_option("-e", "--errorlevel", dest="errorlevel", default=None,
help=_("error output level"), type='int',
metavar='[error level]')
-@@ -1713,6 +2345,10 @@ class YumOptionParser(OptionParser):
+@@ -1713,6 +2382,10 @@ class YumOptionParser(OptionParser):
help=_("verbose operation"))
group.add_option("-y", "--assumeyes", dest="assumeyes",
action="store_true", help=_("answer yes for all questions"))
@@ -1919,7 +1970,7 @@ index 6056d38..8358c55
group.add_option("--version", action="store_true",
help=_("show Yum version and exit"))
group.add_option("--installroot", help=_("set install root"),
-@@ -1730,6 +2366,9 @@ class YumOptionParser(OptionParser):
+@@ -1730,6 +2403,9 @@ class YumOptionParser(OptionParser):
group.add_option("", "--disableexcludes", default=[], action="append",
help=_("disable exclude from main, for a repo or for everything"),
metavar='[repo]')
@@ -1929,7 +1980,7 @@ index 6056d38..8358c55
group.add_option("--obsoletes", action="store_true",
help=_("enable obsoletes processing during updates"))
group.add_option("--noplugins", action="store_true",
-@@ -1748,9 +2387,29 @@ class YumOptionParser(OptionParser):
+@@ -1748,9 +2424,29 @@ 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"))
@@ -2725,7 +2776,7 @@ index 0000000..2af059d
+ the mailing list, yum at lists.baseurl.org, or consult bugzilla.
+.fi
diff --git a/docs/yum.8 b/docs/yum.8
-index 1a8202a..1885e15 100644
+index 1a8202a..3766882 100644
--- a/docs/yum.8
+++ b/docs/yum.8
@@ -25,6 +25,8 @@ gnome\-packagekit application\&.
@@ -2994,7 +3045,32 @@ index 1a8202a..1885e15 100644
.IP "\fBdeplist\fP"
Produces a list of all dependencies and what packages provide those
dependencies for the given packages. As of 3.2.30 it now just shows the latest
-@@ -291,11 +401,63 @@ then yum will ignore any repo errors and output the information it can get
+@@ -271,18 +381,19 @@ version of each package that matches (this can be changed by
+ using --showduplicates) and it only shows the newest providers (which can be
+ changed by using --verbose).
+ .IP
+-.IP "\fBrepolist\fP"
++.IP "\fBrepolist\fP" "\fBrepoinfo\fP"
+ Produces a list of configured repositories. The default is to list all
+-enabled repositories. If you pass \-v, for verbose mode, more information is
+-listed. If the first argument is 'enabled', 'disabled' or 'all' then the command
+-will list those types of repos.
++enabled repositories. If you pass \-v, for verbose mode, or use repoinfo then
++more information is listed. If the first argument is 'enabled', 'disabled' or
++'all' then the command will list those types of repos.
+
+ You can pass repo id or name arguments, or wildcards which to match against
+ both of those. However if the id or name matches exactly then the repo will
+ be listed even if you are listing enabled repos. and it is disabled.
+
+ In non-verbose mode the first column will start with a '*' if the repo. has
+-metalink data and the latest metadata is not local. For non-verbose mode the
++metalink data and the latest metadata is not local and will start with a
++'!' if the repo. has metadata that is expired. For non-verbose mode the
+ last column will also display the number of packages in the repo. and (if there
+ are any user specified excludes) the number of packages excluded.
+
+@@ -291,11 +402,63 @@ 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
@@ -3060,7 +3136,7 @@ index 1a8202a..1885e15 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 +483,33 @@ and so takes sub-commands:
+@@ -321,26 +484,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
@@ -3100,7 +3176,7 @@ index 1a8202a..1885e15 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,13 +518,20 @@ transactions 1 and 4.
+@@ -349,13 +519,20 @@ transactions 1 and 4.
The addon-info command takes a transaction ID, and the packages-list command
takes a package (with wildcards).
@@ -3122,7 +3198,7 @@ index 1a8202a..1885e15 100644
.I \fB>\fR - The rpmdb was changed, outside yum, after the transaction.
.br
.I \fB<\fR - The rpmdb was changed, outside yum, before the transaction.
-@@ -371,6 +547,147 @@ end of the package column in the packages-list command).
+@@ -371,6 +548,147 @@ 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
@@ -3270,7 +3346,7 @@ index 1a8202a..1885e15 100644
.IP
.IP "\fBcheck\fP"
Checks the local rpmdb and produces information on any problems it finds. You
-@@ -401,6 +718,11 @@ Assume yes; assume that the answer to any question which would be asked
+@@ -401,6 +719,11 @@ Assume yes; assume that the answer to any question which would be asked
is yes\&.
.br
Configuration Option: \fBassumeyes\fP
@@ -3282,7 +3358,7 @@ index 1a8202a..1885e15 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 +742,7 @@ Sets the error level to [number] Practical range 0 \- 10. 0 means print only cri
+@@ -420,7 +743,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"
@@ -3291,7 +3367,7 @@ index 1a8202a..1885e15 100644
options are: 'critical', 'emergency', 'error', 'warn' and 'debug'.
.br
Configuration Option: \fBrpmverbosity\fP
-@@ -428,9 +750,7 @@ Configuration Option: \fBrpmverbosity\fP
+@@ -428,9 +751,7 @@ Configuration Option: \fBrpmverbosity\fP
Sets the maximum amount of time yum will wait before performing a command \- it randomizes over the time.
.IP "\fB\-C, \-\-cacheonly\fP"
Tells yum to run entirely from system cache - does not download or
@@ -3302,7 +3378,7 @@ index 1a8202a..1885e15 100644
.IP "\fB\-\-version\fP"
Reports the \fByum\fP version number and installed package versions for
everything in history_record_packages (can be added to by plugins).
-@@ -461,8 +781,13 @@ processing logic. For more information see the \fBupdate\fP command above.
+@@ -461,8 +782,13 @@ processing logic. For more information see the \fBupdate\fP command above.
.br
Configuration Option: \fBobsoletes\fP
.IP "\fB\-x, \-\-exclude=package\fP"
@@ -3318,7 +3394,7 @@ index 1a8202a..1885e15 100644
.br
.IP "\fB\-\-color=[always|auto|never]\fP"
Display colorized output automatically, depending on the output terminal,
-@@ -479,6 +804,13 @@ main == disable excludes defined in [main] in yum.conf
+@@ -479,6 +805,13 @@ main == disable excludes defined in [main] in yum.conf
.br
repoid == disable excludes defined for that repo
.br
@@ -3332,7 +3408,7 @@ index 1a8202a..1885e15 100644
.IP "\fB\-\-disableplugin=plugin\fP"
Run with one or more plugins disabled, the argument is a comma separated list
of wildcards to match against plugin names.
-@@ -506,7 +838,14 @@ option will corrupt your cache (and you can use $releasever in your cachedir
+@@ -506,7 +839,14 @@ option will corrupt your cache (and you can use $releasever in your cachedir
configuration to stop this).
.PP
.IP "\fB\-t, \-\-tolerant\fP"
@@ -3348,7 +3424,7 @@ index 1a8202a..1885e15 100644
.br
.IP "\fB\-\-setopt=option=value\fP"
Set any config option in yum config or repo files. For options in the global
-@@ -523,7 +862,7 @@ version of the package\&.
+@@ -523,7 +863,7 @@ version of the package\&.
The format of the output of yum list is:
@@ -3357,7 +3433,7 @@ index 1a8202a..1885e15 100644
.IP "\fByum list [all | glob_exp1] [glob_exp2] [\&.\&.\&.]\fP"
List all available and installed packages\&.
-@@ -542,6 +881,10 @@ shell\-style glob and any matches are printed\&.
+@@ -542,6 +882,10 @@ shell\-style glob and any matches are printed\&.
List the packages installed on the system that are not available in any yum
repository listed in the config file.
.IP
@@ -3368,7 +3444,7 @@ index 1a8202a..1885e15 100644
.IP "\fByum list obsoletes [glob_exp1] [\&.\&.\&.]\fP"
List the packages installed on the system that are obsoleted by packages
in any yum repository listed in the config file.
-@@ -658,7 +1001,7 @@ configuration options.
+@@ -658,7 +1002,7 @@ configuration options.
.I yum-complete-transaction (1)
.I yumdownloader (1)
.I yum-utils (1)
@@ -197714,7 +197790,7 @@ index 4d89d83..d34f3a8 100644
return msg
diff --git a/yum/update_md.py b/yum/update_md.py
-index 2cb1acb..66cd93b 100644
+index 2cb1acb..cf0b882 100644
--- a/yum/update_md.py
+++ b/yum/update_md.py
@@ -23,23 +23,28 @@ Update metadata (updateinfo.xml) parsing.
@@ -197815,8 +197891,19 @@ index 2cb1acb..66cd93b 100644
if self._md['summary']:
msg += """ <summary>%s</summary>\n""" % (to_xml(self._md['summary']))
if self._md['solution']:
-@@ -345,7 +394,7 @@ class UpdateNotice(object):
+@@ -336,16 +385,17 @@ class UpdateNotice(object):
+ to_xml(coll['name']))
+
+ for pkg in coll['packages']:
+- msg += """ <package arch="%s" name="%s" release="%s" src="%s" version="%s">
++ msg += """ <package arch="%s" name="%s" release="%s" src="%s" version="%s" epoch="%s">
+ <filename>%s</filename>
+ </package>\n""" % (to_xml(pkg['arch'], attrib=True),
+ to_xml(pkg['name'], attrib=True),
+ to_xml(pkg['release'], attrib=True),
+ to_xml(pkg['src'], attrib=True),
to_xml(pkg['version'], attrib=True),
++ pkg['epoch'] or '0',
to_xml(pkg['filename']))
msg += """ </collection>\n"""
- msg += """ </pkglist>\n"""
@@ -197824,7 +197911,7 @@ index 2cb1acb..66cd93b 100644
msg += """</update>\n"""
return msg
-@@ -360,11 +409,15 @@ class UpdateMetadata(object):
+@@ -360,11 +410,15 @@ class UpdateMetadata(object):
The root update metadata object.
"""
@@ -197841,7 +197928,7 @@ index 2cb1acb..66cd93b 100644
for repo in repos:
try: # attempt to grab the updateinfo.xml.gz from the repodata
self.add(repo)
-@@ -423,8 +476,41 @@ class UpdateMetadata(object):
+@@ -423,8 +477,41 @@ class UpdateMetadata(object):
def add_notice(self, un):
""" Add an UpdateNotice object. This should be fully populated with
data, esp. update_id and pkglist/packages. """
@@ -197885,7 +197972,7 @@ index 2cb1acb..66cd93b 100644
self._notices[un['update_id']] = un
for pkg in un['pkglist']:
-@@ -435,16 +521,26 @@ class UpdateMetadata(object):
+@@ -435,16 +522,26 @@ class UpdateMetadata(object):
no = self._no_cache.setdefault(filedata['name'], set())
no.add(un)
@@ -197912,7 +197999,7 @@ index 2cb1acb..66cd93b 100644
self._repos.append(obj.id)
md = obj.retrieveMD(mdtype)
if not md:
-@@ -456,15 +552,28 @@ class UpdateMetadata(object):
+@@ -456,15 +553,28 @@ class UpdateMetadata(object):
else: # obj is a file object
infile = obj
@@ -198478,7 +198565,7 @@ index 0000000..1cc207f
+ return txmbrs
+
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
-index e5e9ece..3b44eaa 100644
+index e5e9ece..b98d3cf 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -20,10 +20,12 @@ import time
@@ -198877,11 +198964,11 @@ index e5e9ece..3b44eaa 100644
+ if cb:
+ fun, arg, karg = callable(cb) and (cb, (), {}) or cb
+ action.update(fun(obj, *arg, **karg))
++
++ return action
- self._grab = mgclass(self._grabfunc, self.urls,
- failure_callback=self.mirror_failure_obj)
-+ return action
-+
+ self._grab = mgclass(self._grabfunc, urls,
+ failure_callback=mirror_failure)
@@ -199083,7 +199170,27 @@ index e5e9ece..3b44eaa 100644
def getHeader(self, package, checkfunc = None, reget = 'simple',
cache = True):
-@@ -933,7 +1129,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -894,19 +1090,16 @@ class YumRepository(Repository, config.RepoConf):
+
+ mC_def = self.withinCacheAge(self.metadata_cookie, self.metadata_expire)
+ if not mC_def: # Normal path...
+- self._metadataCurrent = mC_def
+ return mC_def
+
+ # Edge cases, both repomd.xml and metalink (if used). Must exist.
+ repomdfn = self.cachedir + '/' + 'repomd.xml'
+ if not os.path.exists(repomdfn):
+- self._metadataCurrent = False
+ return False
+
+ self._hack_mirrorlist_for_anaconda()
+ mlfn = self.cachedir + '/' + 'metalink.xml'
+ if self.metalink and not os.path.exists(mlfn):
+- self._metadataCurrent = False
+ return False
+
+ self._metadataCurrent = True
+@@ -933,7 +1126,7 @@ class YumRepository(Repository, config.RepoConf):
self._metadataCurrent = False
return self._metadataCurrent
@@ -199092,7 +199199,7 @@ index e5e9ece..3b44eaa 100644
"""check if any file is older than a certain amount of time. Used for
the cachecookie and the mirrorlist
return True if w/i the expiration time limit
-@@ -943,6 +1139,24 @@ class YumRepository(Repository, config.RepoConf):
+@@ -943,6 +1136,24 @@ class YumRepository(Repository, config.RepoConf):
file. If any of them are newer then invalidate the cache
"""
@@ -199117,7 +199224,7 @@ index e5e9ece..3b44eaa 100644
# -1 is special and should never get refreshed
if expiration_time == -1 and os.path.exists(myfile):
return True
-@@ -991,7 +1205,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -991,7 +1202,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):
@@ -199126,7 +199233,7 @@ index e5e9ece..3b44eaa 100644
if self.cache or self.metadataCurrent():
return True
return False
-@@ -1020,7 +1234,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1020,7 +1231,7 @@ class YumRepository(Repository, config.RepoConf):
if grab_can_fail:
return None
raise Errors.RepoError, 'Error downloading file %s: %s' % (local, e)
@@ -199135,7 +199242,7 @@ index e5e9ece..3b44eaa 100644
misc.unlink_f(tfname)
if grab_can_fail:
return None
-@@ -1047,7 +1261,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1047,7 +1258,7 @@ class YumRepository(Repository, config.RepoConf):
parse_can_fail = 'old_repo_XML' in self._oldRepoMDData
if parse_can_fail:
return None
@@ -199144,7 +199251,7 @@ index e5e9ece..3b44eaa 100644
def _saveOldRepoXML(self, local):
""" If we have an older repomd.xml file available, save it out. """
-@@ -1074,7 +1288,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1074,7 +1285,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:
@@ -199153,7 +199260,7 @@ index e5e9ece..3b44eaa 100644
if 'old_repo_XML' not in self._oldRepoMDData:
self._oldRepoMDData = {}
-@@ -1250,7 +1464,6 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1250,7 +1461,6 @@ class YumRepository(Repository, config.RepoConf):
self._revertOldRepoXML()
return False
@@ -199161,7 +199268,7 @@ index e5e9ece..3b44eaa 100644
if caching:
return False # Skip any work.
-@@ -1260,6 +1473,9 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1260,6 +1470,9 @@ class YumRepository(Repository, config.RepoConf):
return True
def _check_db_version(self, mdtype, repoXML=None):
@@ -199171,7 +199278,7 @@ index e5e9ece..3b44eaa 100644
if repoXML is None:
repoXML = self.repoXML
if mdtype in repoXML.repoData:
-@@ -1277,11 +1493,11 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1277,11 +1490,11 @@ class YumRepository(Repository, config.RepoConf):
return None
if not file_check:
@@ -199186,7 +199293,7 @@ index e5e9ece..3b44eaa 100644
if not os.path.exists(local):
local = misc.decompress(local, fn_only=True)
compressed = True
-@@ -1302,6 +1518,17 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1302,6 +1515,17 @@ class YumRepository(Repository, config.RepoConf):
into the delete list, this means metadata can change filename
without us leaking it. """
@@ -199204,7 +199311,7 @@ index e5e9ece..3b44eaa 100644
def _mdtype_eq(omdtype, odata, nmdtype, ndata):
""" Check if two returns from _get_mdtype_data() are equal. """
if ndata is None:
-@@ -1321,6 +1548,14 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1321,6 +1545,14 @@ class YumRepository(Repository, config.RepoConf):
return True
all_mdtypes = self.retrieved.keys()
@@ -199219,7 +199326,7 @@ index e5e9ece..3b44eaa 100644
if mdtypes is None:
mdtypes = all_mdtypes
-@@ -1332,9 +1567,8 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1332,9 +1564,8 @@ class YumRepository(Repository, config.RepoConf):
self._oldRepoMDData['old_MD_files'] = reverts
# Inited twice atm. ... sue me
@@ -199231,7 +199338,7 @@ index e5e9ece..3b44eaa 100644
for mdtype in all_mdtypes:
(nmdtype, ndata) = self._get_mdtype_data(mdtype)
-@@ -1371,43 +1605,16 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1371,43 +1602,16 @@ class YumRepository(Repository, config.RepoConf):
# No old repomd data, but we might still have uncompressed MD
if self._groupCheckDataMDValid(ndata, nmdtype, mdtype):
continue
@@ -199247,7 +199354,9 @@ index e5e9ece..3b44eaa 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...
@@ -199264,9 +199373,7 @@ index e5e9ece..3b44eaa 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)
@@ -199281,7 +199388,7 @@ index e5e9ece..3b44eaa 100644
def _groupLoadRepoXML(self, text=None, mdtypes=None):
""" Retrieve the new repomd.xml from the repository, then check it
-@@ -1421,11 +1628,11 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1421,11 +1625,11 @@ class YumRepository(Repository, config.RepoConf):
self._commonRetrieveDataMD(mdtypes)
def _mdpolicy2mdtypes(self):
@@ -199297,7 +199404,7 @@ index e5e9ece..3b44eaa 100644
mdtypes = set()
if type(self.mdpolicy) in types.StringTypes:
mdtypes.update(md_groups.get(self.mdpolicy, [self.mdpolicy]))
-@@ -1436,6 +1643,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1436,6 +1640,7 @@ class YumRepository(Repository, config.RepoConf):
if not mdtypes or 'group:all' in mdtypes:
mdtypes = None
else:
@@ -199305,7 +199412,7 @@ index e5e9ece..3b44eaa 100644
mdtypes = sorted(list(mdtypes))
return mdtypes
-@@ -1446,17 +1654,12 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1446,17 +1651,12 @@ class YumRepository(Repository, config.RepoConf):
except KeyboardInterrupt:
self._revertOldRepoXML() # Undo metadata cookie?
raise
@@ -199325,7 +199432,7 @@ index e5e9ece..3b44eaa 100644
return self._repoXML
-@@ -1480,7 +1683,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1480,7 +1680,7 @@ class YumRepository(Repository, config.RepoConf):
result = self._getFile(relative='repodata/repomd.xml.asc',
copy_local=1,
local = sigfile,
@@ -199334,7 +199441,7 @@ index e5e9ece..3b44eaa 100644
reget=None,
checkfunc=None,
cache=self.http_caching == 'all',
-@@ -1508,6 +1711,18 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1508,6 +1708,18 @@ class YumRepository(Repository, config.RepoConf):
raise URLGrabError(-1, 'repomd.xml does not match metalink for %s' %
self)
@@ -199353,7 +199460,7 @@ index e5e9ece..3b44eaa 100644
def checkMD(self, fn, mdtype, openchecksum=False):
"""check the metadata type against its checksum"""
-@@ -1537,6 +1752,16 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1537,6 +1749,16 @@ class YumRepository(Repository, config.RepoConf):
if size is not None:
size = int(size)
@@ -199370,7 +199477,7 @@ index e5e9ece..3b44eaa 100644
try: # get the local checksum
l_csum = self._checksum(r_ctype, file, datasize=size)
except Errors.RepoError, e:
-@@ -1545,21 +1770,20 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1545,21 +1767,20 @@ class YumRepository(Repository, config.RepoConf):
raise URLGrabError(-3, 'Error performing checksum')
if l_csum == r_csum:
@@ -199394,7 +199501,7 @@ index e5e9ece..3b44eaa 100644
""" Internal function, use .retrieveMD() from outside yum. """
# Note that this can raise Errors.RepoMDError if mdtype doesn't exist
# for this repo.
-@@ -1575,37 +1799,38 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1575,37 +1796,38 @@ class YumRepository(Repository, config.RepoConf):
# got it, move along
return local
@@ -199453,7 +199560,7 @@ index e5e9ece..3b44eaa 100644
local = self._getFile(relative=remote,
local=local,
copy_local=1,
-@@ -1613,8 +1838,9 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1613,8 +1835,9 @@ class YumRepository(Repository, config.RepoConf):
checkfunc=checkfunc,
text=text,
cache=self.http_caching == 'all',
@@ -199465,7 +199572,7 @@ index e5e9ece..3b44eaa 100644
if retrieve_can_fail:
return None
raise
-@@ -1622,9 +1848,8 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1622,9 +1845,8 @@ class YumRepository(Repository, config.RepoConf):
if retrieve_can_fail:
return None
raise Errors.RepoError, \
@@ -199476,7 +199583,7 @@ index e5e9ece..3b44eaa 100644
return local
-@@ -1646,13 +1871,21 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1646,13 +1868,21 @@ class YumRepository(Repository, config.RepoConf):
def getGroups(self):
"""gets groups and returns group file path for the repository, if there
@@ -199501,7 +199608,7 @@ index e5e9ece..3b44eaa 100644
self._callbacks_changed = True
def setFailureObj(self, failure_obj):
-@@ -1681,7 +1914,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1681,7 +1911,7 @@ class YumRepository(Repository, config.RepoConf):
print "Could not read mirrorlist %s, error was \n%s" %(url, e)
content = []
for line in content:
@@ -199510,7 +199617,7 @@ index e5e9ece..3b44eaa 100644
continue
mirror = line.rstrip() # no more trailing \n's
mirror = mirror.replace('$ARCH', '$BASEARCH')
-@@ -1701,7 +1934,8 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1701,7 +1931,8 @@ class YumRepository(Repository, config.RepoConf):
fo = None
cacheok = False
@@ -199520,7 +199627,7 @@ index e5e9ece..3b44eaa 100644
cacheok = True
fo = open(self.mirrorlist_file, 'r')
url = 'file://' + self.mirrorlist_file # just to keep self._readMirrorList(fo,url) happy
-@@ -1713,7 +1947,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1713,7 +1944,7 @@ class YumRepository(Repository, config.RepoConf):
ugopts = self._default_grabopts()
try:
fo = urlgrabber.grabber.urlopen(url, **ugopts)
@@ -199529,7 +199636,7 @@ index e5e9ece..3b44eaa 100644
print "Could not retrieve mirrorlist %s error was\n%s: %s" % (url, e.args[0], misc.to_unicode(e.args[1]))
fo = None
-@@ -1740,7 +1974,11 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1740,7 +1971,11 @@ class YumRepository(Repository, config.RepoConf):
if os.path.exists(destfn):
if os.stat(fn)[stat.ST_CTIME] <= os.stat(destfn)[stat.ST_CTIME]:
return False
@@ -199542,7 +199649,7 @@ index e5e9ece..3b44eaa 100644
return True
def _preload_file_from_system_cache(self, filename, subdir='',
-@@ -1877,7 +2115,7 @@ def getMirrorList(mirrorlist, pdict = None):
+@@ -1877,7 +2112,7 @@ def getMirrorList(mirrorlist, pdict = None):
try:
fo = urlresolver.urlopen(url, proxies=pdict)
@@ -199552,7 +199659,7 @@ index e5e9ece..3b44eaa 100644
fo = None
diff --git a/yumcommands.py b/yumcommands.py
-index 4dcbea7..03fc58a 100644
+index 4dcbea7..1530161 100644
--- a/yumcommands.py
+++ b/yumcommands.py
@@ -13,6 +13,7 @@
@@ -201631,7 +201738,7 @@ index 4dcbea7..03fc58a 100644
repos = base.repos.repos.values()
repos.sort()
-@@ -924,111 +2172,108 @@ class RepoListCommand(YumCommand):
+@@ -924,111 +2172,113 @@ class RepoListCommand(YumCommand):
ui_enabled = dhibeg + _('disabled') + hiend
ui_endis_wid = utf8_width(_('disabled'))
@@ -201646,6 +201753,11 @@ index 4dcbea7..03fc58a 100644
- (ui_enabled, ui_endis_wid), ui_num))
+ if not verbose:
+ rid = repo.ui_id # can't use str()
++ if repo.metadata_expire >= 0:
++ if os.path.exists(repo.metadata_cookie):
++ last = os.stat(repo.metadata_cookie).st_mtime
++ if last + repo.metadata_expire < time.time():
++ rid = '!' + rid
+ if enabled and repo.metalink:
+ mdts = repo.metalink_data.repomd.timestamp
+ if mdts > repo.repoXML.timestamp:
@@ -201836,7 +201948,7 @@ index 4dcbea7..03fc58a 100644
if not verbose and cols:
# Work out the first (id) and last (enabled/disalbed/count),
-@@ -1088,21 +2333,64 @@ class RepoListCommand(YumCommand):
+@@ -1088,21 +2338,64 @@ class RepoListCommand(YumCommand):
return 0, ['repolist: ' +to_unicode(locale.format("%d", tot_num, True))]
def needTs(self, base, basecmd, extcmds):
@@ -201901,7 +202013,7 @@ index 4dcbea7..03fc58a 100644
if len(extcmds) == 0:
base.usage()
raise cli.CliError
-@@ -1147,82 +2435,230 @@ class HelpCommand(YumCommand):
+@@ -1147,82 +2440,230 @@ class HelpCommand(YumCommand):
return help_output
def doCommand(self, base, basecmd, extcmds):
@@ -202141,7 +202253,7 @@ index 4dcbea7..03fc58a 100644
def _append_repos(cols, repo_data):
for repoid in sorted(repo_data):
-@@ -1264,7 +2700,7 @@ class VersionCommand(YumCommand):
+@@ -1264,7 +2705,7 @@ class VersionCommand(YumCommand):
if vcmd == 'groupinfo':
for group in groups:
@@ -202150,7 +202262,7 @@ index 4dcbea7..03fc58a 100644
continue
print _(" Group :"), group
print _(" Packages:")
-@@ -1284,11 +2720,35 @@ class VersionCommand(YumCommand):
+@@ -1284,11 +2725,35 @@ class VersionCommand(YumCommand):
return 0, ['version groupinfo']
@@ -202187,7 +202299,7 @@ index 4dcbea7..03fc58a 100644
data = base.rpmdb.simpleVersion(not verbose, groups=groups)
lastdbv = base.history.last()
if lastdbv is not None:
-@@ -1302,15 +2762,14 @@ class VersionCommand(YumCommand):
+@@ -1302,15 +2767,14 @@ class VersionCommand(YumCommand):
if groups:
for grp in sorted(data[2]):
if (vcmd.startswith("group-") and
@@ -202206,7 +202318,7 @@ index 4dcbea7..03fc58a 100644
data = base.pkgSack.simpleVersion(not verbose, groups=groups)
if vcmd not in ('group-available', 'group-all'):
cols.append(("%s %s/%s" % (_("Available:"), rel, ba),
-@@ -1320,14 +2779,12 @@ class VersionCommand(YumCommand):
+@@ -1320,14 +2784,12 @@ class VersionCommand(YumCommand):
if groups:
for grp in sorted(data[2]):
if (vcmd.startswith("group-") and
@@ -202222,7 +202334,7 @@ index 4dcbea7..03fc58a 100644
data = {'rid' : {}, 'ver' : {}}
for (rid, ver) in cols:
-@@ -1344,6 +2801,14 @@ class VersionCommand(YumCommand):
+@@ -1344,6 +2806,14 @@ class VersionCommand(YumCommand):
return 0, ['version']
def needTs(self, base, basecmd, extcmds):
@@ -202237,7 +202349,7 @@ index 4dcbea7..03fc58a 100644
vcmd = 'installed'
if extcmds:
vcmd = extcmds[0]
-@@ -1352,25 +2817,74 @@ class VersionCommand(YumCommand):
+@@ -1352,25 +2822,74 @@ class VersionCommand(YumCommand):
return True
return vcmd in ('available', 'all', 'group-available', 'group-all')
@@ -202313,7 +202425,7 @@ index 4dcbea7..03fc58a 100644
return 2, ["Repeating transaction %u" % (old.tid,)]
def _hcmd_undo(self, base, extcmds):
-@@ -1426,12 +2940,57 @@ class HistoryCommand(YumCommand):
+@@ -1426,12 +2945,57 @@ class HistoryCommand(YumCommand):
def _hcmd_new(self, base, extcmds):
base.history._create_db_file()
@@ -202372,7 +202484,7 @@ index 4dcbea7..03fc58a 100644
if extcmds and extcmds[0] not in cmds:
base.logger.critical(_('Invalid history sub-command, use: %s.'),
", ".join(cmds))
-@@ -1444,6 +3003,19 @@ class HistoryCommand(YumCommand):
+@@ -1444,6 +3008,19 @@ class HistoryCommand(YumCommand):
raise cli.CliError
def doCommand(self, base, basecmd, extcmds):
@@ -202392,7 +202504,7 @@ index 4dcbea7..03fc58a 100644
vcmd = 'list'
if extcmds:
vcmd = extcmds[0]
-@@ -1468,29 +3040,88 @@ class HistoryCommand(YumCommand):
+@@ -1468,29 +3045,88 @@ class HistoryCommand(YumCommand):
ret = self._hcmd_rollback(base, extcmds)
elif vcmd == 'new':
ret = self._hcmd_new(base, extcmds)
@@ -202481,7 +202593,7 @@ index 4dcbea7..03fc58a 100644
chkcmd = 'all'
if extcmds:
chkcmd = extcmds
-@@ -1505,33 +3136,1113 @@ class CheckRpmdbCommand(YumCommand):
+@@ -1505,33 +3141,1113 @@ class CheckRpmdbCommand(YumCommand):
return rc, ['%s %s' % (basecmd, chkcmd)]
def needTs(self, base, basecmd, extcmds):
diff --git a/yum.spec b/yum.spec
index 2997353..eb55e31 100644
--- a/yum.spec
+++ b/yum.spec
@@ -41,7 +41,7 @@ BuildRequires: bash-completion
Summary: RPM package installer/updater/manager
Name: yum
Version: 3.4.3
-Release: 109%{?dist}
+Release: 110%{?dist}
License: GPLv2+
Group: System Environment/Base
Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz
@@ -403,6 +403,13 @@ exit 0
%endif
%changelog
+* Fri Sep 6 2013 James Antill <james at fedoraproject.org> - 3.4.3-110
+- Update to latest HEAD.
+- Add cache check to repolist, using "!". Document repoinfo.
+- Add epoch to updateinfo xml output.
+- Add missing translation hooks for ignored -c option message.
+- Try to smooth out the edge cases for cacheReq not ever updating data.
+
* Wed Sep 4 2013 James Antill <james at fedoraproject.org> - 3.4.3-109
- Update to latest HEAD.
- update /etc/yum-cron-hourly.conf. BZ 1002623
More information about the scm-commits
mailing list