[yum] update to latest HEAD.
James Antill
james at fedoraproject.org
Thu Aug 30 14:33:41 UTC 2012
commit d24df21f1603734e81348a20cf2bf9f8c32a2fe5
Author: James Antill <james at and.org>
Date: Thu Aug 30 10:33:18 2012 -0400
update to latest HEAD.
- Fix rel-eng problems when repo.repofile is None.
yum-HEAD.patch | 155 ++++++++++++++++++++++++++++++++++---------------------
yum.spec | 6 +-
2 files changed, 99 insertions(+), 62 deletions(-)
---
diff --git a/yum-HEAD.patch b/yum-HEAD.patch
index 05b65b1..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
@@ -157642,7 +157672,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 +157700,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 +157751,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 +157784,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 +157805,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 +159334,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 +159587,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 +159598,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 +159619,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 +159627,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 +159636,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 +159649,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 +159658,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 +159675,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 +159692,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 +159718,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 +159746,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 +159755,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 +159765,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 +159780,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 +159798,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 +159813,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 +159823,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 +159872,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 +159881,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 +159889,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 +159903,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 +159912,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 +159921,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 +159940,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 +159957,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 +159970,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 +159982,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 +159990,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 +160015,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 fa49208..48d9bf8 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,9 +315,9 @@ exit 0
%endif
%changelog
-* Wed Aug 29 2012 James Antill <james at fedoraproject.org> - 3.4.3-37
+* Thu Aug 30 2012 James Antill <james at fedoraproject.org> - 3.4.3-38
- update to latest HEAD.
-- Fix problem on metalink downloads due to weird python issue.
+- Fix rel-eng problems when repo.repofile is None.
* Tue Aug 28 2012 James Antill <james at fedoraproject.org> - 3.4.3-36
- update to latest HEAD.
More information about the scm-commits
mailing list