[yum] update to latest HEAD.
James Antill
james at fedoraproject.org
Tue Feb 19 22:00:37 UTC 2013
commit 08db8a6982c2b2ad6bd26ddb2989ad3adca9276b
Author: James Antill <james at and.org>
Date: Tue Feb 19 17:00:07 2013 -0500
update to latest HEAD.
- Add cache-reqs.
yum-HEAD.patch | 120 ++++++++++++++++++++++++++++++++++++-------------------
yum.spec | 6 ++-
2 files changed, 83 insertions(+), 43 deletions(-)
---
diff --git a/yum-HEAD.patch b/yum-HEAD.patch
index dddee9c..283c78e 100644
--- a/yum-HEAD.patch
+++ b/yum-HEAD.patch
@@ -185524,7 +185524,7 @@ index 2cb1acb..3ac0010 100644
def __unicode__(self):
ret = u''
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
-index e5e9ece..ce34a29 100644
+index e5e9ece..342ed42 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -20,10 +20,12 @@ import time
@@ -186243,9 +186243,7 @@ index e5e9ece..ce34a29 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...
@@ -186262,7 +186260,9 @@ index e5e9ece..ce34a29 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)
@@ -186342,25 +186342,24 @@ index e5e9ece..ce34a29 100644
def checkMD(self, fn, mdtype, openchecksum=False):
"""check the metadata type against its checksum"""
-@@ -1537,6 +1729,17 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1537,6 +1729,16 @@ class YumRepository(Repository, config.RepoConf):
if size is not None:
size = int(size)
+ 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 and l_csum == r_csum:
-+ return 1
-+ if size == fsize.st_size and l_csum == r_csum:
-+ return 1
-+ # Redo it ... just to make sure...
++ 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)
except Errors.RepoError, e:
-@@ -1545,21 +1748,20 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1545,21 +1747,20 @@ class YumRepository(Repository, config.RepoConf):
raise URLGrabError(-3, 'Error performing checksum')
if l_csum == r_csum:
@@ -186384,7 +186383,7 @@ index e5e9ece..ce34a29 100644
""" Internal function, use .retrieveMD() from outside yum. """
# Note that this can raise Errors.RepoMDError if mdtype doesn't exist
# for this repo.
-@@ -1580,15 +1782,19 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1580,15 +1781,19 @@ class YumRepository(Repository, config.RepoConf):
try:
self.checkMD(local, mdtype)
except URLGrabError, e:
@@ -186405,7 +186404,7 @@ index e5e9ece..ce34a29 100644
if (os.path.exists(local) or
self._preload_md_from_system_cache(os.path.basename(local))):
-@@ -1597,15 +1803,22 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1597,15 +1802,22 @@ class YumRepository(Repository, config.RepoConf):
return local # it's the same return the local one
try:
@@ -186433,7 +186432,7 @@ index e5e9ece..ce34a29 100644
local = self._getFile(relative=remote,
local=local,
copy_local=1,
-@@ -1613,8 +1826,9 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1613,8 +1825,9 @@ class YumRepository(Repository, config.RepoConf):
checkfunc=checkfunc,
text=text,
cache=self.http_caching == 'all',
@@ -186445,7 +186444,7 @@ index e5e9ece..ce34a29 100644
if retrieve_can_fail:
return None
raise
-@@ -1622,9 +1836,8 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1622,9 +1835,8 @@ class YumRepository(Repository, config.RepoConf):
if retrieve_can_fail:
return None
raise Errors.RepoError, \
@@ -186456,7 +186455,7 @@ index e5e9ece..ce34a29 100644
return local
-@@ -1646,13 +1859,21 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1646,13 +1858,21 @@ class YumRepository(Repository, config.RepoConf):
def getGroups(self):
"""gets groups and returns group file path for the repository, if there
@@ -186481,7 +186480,7 @@ index e5e9ece..ce34a29 100644
self._callbacks_changed = True
def setFailureObj(self, failure_obj):
-@@ -1681,7 +1902,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1681,7 +1901,7 @@ class YumRepository(Repository, config.RepoConf):
print "Could not read mirrorlist %s, error was \n%s" %(url, e)
content = []
for line in content:
@@ -186490,7 +186489,7 @@ index e5e9ece..ce34a29 100644
continue
mirror = line.rstrip() # no more trailing \n's
mirror = mirror.replace('$ARCH', '$BASEARCH')
-@@ -1701,7 +1922,8 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1701,7 +1921,8 @@ class YumRepository(Repository, config.RepoConf):
fo = None
cacheok = False
@@ -186500,7 +186499,7 @@ index e5e9ece..ce34a29 100644
cacheok = True
fo = open(self.mirrorlist_file, 'r')
url = 'file://' + self.mirrorlist_file # just to keep self._readMirrorList(fo,url) happy
-@@ -1713,7 +1935,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1713,7 +1934,7 @@ class YumRepository(Repository, config.RepoConf):
ugopts = self._default_grabopts()
try:
fo = urlgrabber.grabber.urlopen(url, **ugopts)
@@ -186509,7 +186508,7 @@ index e5e9ece..ce34a29 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 +1962,11 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1740,7 +1961,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
@@ -186522,7 +186521,7 @@ index e5e9ece..ce34a29 100644
return True
def _preload_file_from_system_cache(self, filename, subdir='',
-@@ -1877,7 +2103,7 @@ def getMirrorList(mirrorlist, pdict = None):
+@@ -1877,7 +2102,7 @@ def getMirrorList(mirrorlist, pdict = None):
try:
fo = urlresolver.urlopen(url, proxies=pdict)
@@ -186532,7 +186531,7 @@ index e5e9ece..ce34a29 100644
fo = None
diff --git a/yumcommands.py b/yumcommands.py
-index 4dcbea7..1cc4fdf 100644
+index 4dcbea7..ad529cd 100644
--- a/yumcommands.py
+++ b/yumcommands.py
@@ -22,14 +22,16 @@ Classes for subcommands of the yum command line interface.
@@ -187713,7 +187712,7 @@ index 4dcbea7..1cc4fdf 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 +1292,227 @@ class MakeCacheCommand(YumCommand):
+@@ -565,81 +1292,238 @@ class MakeCacheCommand(YumCommand):
repo.mdpolicy = "group:all"
base.doRepoSetup(dosack=0)
base.repos.doSetup()
@@ -187825,6 +187824,17 @@ index 4dcbea7..1cc4fdf 100644
+ """
return False
++ def cacheRequirement(self, base, basecmd, extcmds):
++ """Return the cache requirements for the remote repos.
++
++ :param base: a :class:`yum.Yumbase` object
++ :param basecmd: the name of the command
++ :param extcmds: a list of arguments passed to *basecmd*
++ :return: Type of requirement: read-only:past, read-only:present, read-only:future, write
++ """
++ return 'read-only:past'
++
++
class ProvidesCommand(YumCommand):
+ """A class containing methods needed by the cli to execute the
+ provides command.
@@ -187948,7 +187958,7 @@ index 4dcbea7..1cc4fdf 100644
obscmds = ['obsoletes'] + extcmds
base.extcmds.insert(0, 'updates')
result = 0
-@@ -676,161 +1549,480 @@ class CheckUpdateCommand(YumCommand):
+@@ -676,161 +1560,480 @@ class CheckUpdateCommand(YumCommand):
columns=columns)
result = 100
except yum.Errors.YumBaseError, e:
@@ -188438,7 +188448,7 @@ index 4dcbea7..1cc4fdf 100644
def _repo_size(repo):
ret = 0
for pkg in repo.sack.returnPackages():
-@@ -857,7 +2049,10 @@ class RepoListCommand(YumCommand):
+@@ -857,7 +2060,10 @@ class RepoListCommand(YumCommand):
arg = 'enabled'
extcmds = map(lambda x: x.lower(), extcmds)
@@ -188450,7 +188460,7 @@ index 4dcbea7..1cc4fdf 100644
if arg != 'disabled' or extcmds:
try:
# Setup so len(repo.sack) is correct
-@@ -866,6 +2061,13 @@ class RepoListCommand(YumCommand):
+@@ -866,6 +2072,13 @@ class RepoListCommand(YumCommand):
except yum.Errors.RepoError:
if verbose:
raise
@@ -188464,7 +188474,7 @@ index 4dcbea7..1cc4fdf 100644
repos = base.repos.repos.values()
repos.sort()
-@@ -924,111 +2126,108 @@ class RepoListCommand(YumCommand):
+@@ -924,111 +2137,108 @@ class RepoListCommand(YumCommand):
ui_enabled = dhibeg + _('disabled') + hiend
ui_endis_wid = utf8_width(_('disabled'))
@@ -188669,7 +188679,7 @@ index 4dcbea7..1cc4fdf 100644
if not verbose and cols:
# Work out the first (id) and last (enabled/disalbed/count),
-@@ -1088,21 +2287,64 @@ class RepoListCommand(YumCommand):
+@@ -1088,21 +2298,64 @@ class RepoListCommand(YumCommand):
return 0, ['repolist: ' +to_unicode(locale.format("%d", tot_num, True))]
def needTs(self, base, basecmd, extcmds):
@@ -188734,7 +188744,7 @@ index 4dcbea7..1cc4fdf 100644
if len(extcmds) == 0:
base.usage()
raise cli.CliError
-@@ -1147,28 +2389,85 @@ class HelpCommand(YumCommand):
+@@ -1147,28 +2400,85 @@ class HelpCommand(YumCommand):
return help_output
def doCommand(self, base, basecmd, extcmds):
@@ -188820,7 +188830,7 @@ index 4dcbea7..1cc4fdf 100644
self.doneCommand(base, _("Setting up Reinstall Process"))
try:
return base.reinstallPkgs(extcmds)
-@@ -1177,49 +2476,139 @@ class ReInstallCommand(YumCommand):
+@@ -1177,49 +2487,139 @@ class ReInstallCommand(YumCommand):
return 1, [to_unicode(e)]
def getSummary(self):
@@ -188961,7 +188971,7 @@ index 4dcbea7..1cc4fdf 100644
vcmd = 'installed'
if extcmds:
vcmd = extcmds[0]
-@@ -1308,7 +2697,7 @@ class VersionCommand(YumCommand):
+@@ -1308,7 +2708,7 @@ class VersionCommand(YumCommand):
str(data[2][grp])))
_append_repos(cols, data[3][grp])
except yum.Errors.YumBaseError, e:
@@ -188970,7 +188980,7 @@ index 4dcbea7..1cc4fdf 100644
if vcmd in ('available', 'all', 'group-available', 'group-all'):
try:
data = base.pkgSack.simpleVersion(not verbose, groups=groups)
-@@ -1327,7 +2716,7 @@ class VersionCommand(YumCommand):
+@@ -1327,7 +2727,7 @@ class VersionCommand(YumCommand):
if verbose:
_append_repos(cols, data[3][grp])
except yum.Errors.YumBaseError, e:
@@ -188979,7 +188989,7 @@ index 4dcbea7..1cc4fdf 100644
data = {'rid' : {}, 'ver' : {}}
for (rid, ver) in cols:
-@@ -1344,6 +2733,14 @@ class VersionCommand(YumCommand):
+@@ -1344,6 +2744,14 @@ class VersionCommand(YumCommand):
return 0, ['version']
def needTs(self, base, basecmd, extcmds):
@@ -188994,7 +189004,7 @@ index 4dcbea7..1cc4fdf 100644
vcmd = 'installed'
if extcmds:
vcmd = extcmds[0]
-@@ -1352,25 +2749,74 @@ class VersionCommand(YumCommand):
+@@ -1352,25 +2760,74 @@ class VersionCommand(YumCommand):
return True
return vcmd in ('available', 'all', 'group-available', 'group-all')
@@ -189070,7 +189080,7 @@ index 4dcbea7..1cc4fdf 100644
return 2, ["Repeating transaction %u" % (old.tid,)]
def _hcmd_undo(self, base, extcmds):
-@@ -1426,12 +2872,57 @@ class HistoryCommand(YumCommand):
+@@ -1426,12 +2883,57 @@ class HistoryCommand(YumCommand):
def _hcmd_new(self, base, extcmds):
base.history._create_db_file()
@@ -189129,7 +189139,7 @@ index 4dcbea7..1cc4fdf 100644
if extcmds and extcmds[0] not in cmds:
base.logger.critical(_('Invalid history sub-command, use: %s.'),
", ".join(cmds))
-@@ -1444,6 +2935,19 @@ class HistoryCommand(YumCommand):
+@@ -1444,6 +2946,19 @@ class HistoryCommand(YumCommand):
raise cli.CliError
def doCommand(self, base, basecmd, extcmds):
@@ -189149,7 +189159,7 @@ index 4dcbea7..1cc4fdf 100644
vcmd = 'list'
if extcmds:
vcmd = extcmds[0]
-@@ -1468,29 +2972,88 @@ class HistoryCommand(YumCommand):
+@@ -1468,29 +2983,88 @@ class HistoryCommand(YumCommand):
ret = self._hcmd_rollback(base, extcmds)
elif vcmd == 'new':
ret = self._hcmd_new(base, extcmds)
@@ -189238,7 +189248,7 @@ index 4dcbea7..1cc4fdf 100644
chkcmd = 'all'
if extcmds:
chkcmd = extcmds
-@@ -1505,24 +3068,137 @@ class CheckRpmdbCommand(YumCommand):
+@@ -1505,24 +3079,147 @@ class CheckRpmdbCommand(YumCommand):
return rc, ['%s %s' % (basecmd, chkcmd)]
def needTs(self, base, basecmd, extcmds):
@@ -189252,6 +189262,16 @@ index 4dcbea7..1cc4fdf 100644
+ """
return False
++ def cacheRequirement(self, base, basecmd, extcmds):
++ """Return the cache requirements for the remote repos.
++
++ :param base: a :class:`yum.Yumbase` object
++ :param basecmd: the name of the command
++ :param extcmds: a list of arguments passed to *basecmd*
++ :return: Type of requirement: read-only:past, read-only:present, read-only:future, write
++ """
++ return 'read-only:past'
++
+
class LoadTransactionCommand(YumCommand):
+ """A class containing methods needed by the cli to execute the
@@ -189379,7 +189399,7 @@ index 4dcbea7..1cc4fdf 100644
self.doneCommand(base, _("loading transaction from %s") % load_file)
try:
-@@ -1533,5 +3209,322 @@ class LoadTransactionCommand(YumCommand):
+@@ -1533,5 +3230,338 @@ class LoadTransactionCommand(YumCommand):
def needTs(self, base, basecmd, extcmds):
@@ -189391,8 +189411,24 @@ index 4dcbea7..1cc4fdf 100644
+ :param extcmds: a list of arguments passed to *basecmd*
+ :return: True if a transaction set is needed, False otherwise
+ """
++ if not extcmds or os.path.isdir(extcmds[0]):
++ return False
++
+ return True
+
++ def cacheRequirement(self, base, basecmd, extcmds):
++ """Return the cache requirements for the remote repos.
++
++ :param base: a :class:`yum.Yumbase` object
++ :param basecmd: the name of the command
++ :param extcmds: a list of arguments passed to *basecmd*
++ :return: Type of requirement: read-only:past, read-only:present, read-only:future, write
++ """
++ if not extcmds or os.path.isdir(extcmds[0]):
++ return 'read-only:past'
++
++ return 'write'
++
+
+class SwapCommand(YumCommand):
+ """A class containing methods needed by the cli to execute the
diff --git a/yum.spec b/yum.spec
index d142e4c..8b4e6c0 100644
--- a/yum.spec
+++ b/yum.spec
@@ -24,7 +24,7 @@
Summary: RPM package installer/updater/manager
Name: yum
Version: 3.4.3
-Release: 60%{?dist}
+Release: 61%{?dist}
License: GPLv2+
Group: System Environment/Base
Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz
@@ -319,6 +319,10 @@ fi
%endif
%changelog
+* Tue Feb 18 2013 James Antill <james at fedoraproject.org> - 3.4.3-61
+- update to latest HEAD.
+- Add cache-reqs.
+
* Mon Feb 18 2013 James Antill <james at fedoraproject.org> - 3.4.3-60
- update to latest HEAD.
- Auto expire caches on repo errors.
More information about the scm-commits
mailing list