[yum/f18] Update to latest HEAD

Zdeněk Pavlas zpavlas at fedoraproject.org
Wed Aug 29 15:41:17 UTC 2012


commit 75057add795952495200ee07be9cda1b676dcf8b
Author: Zdeněk Pavlas <zpavlas at redhat.com>
Date:   Wed Aug 29 17:40:49 2012 +0200

    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 <zpavlas at redhat.com> - 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 <james at fedoraproject.org> - 3.4.3-37
 - update to latest HEAD.
 - Fix problem on metalink downloads due to weird python issue.


More information about the scm-commits mailing list