[yum] update to latest HEAD.

James Antill james at fedoraproject.org
Fri Aug 31 21:08:33 UTC 2012


commit 32e1511d4eee458825765d65c094745da87f9818
Author: James Antill <james at and.org>
Date:   Fri Aug 31 17:08:23 2012 -0400

    update to latest HEAD.
    
    - Don't statvfs when we aren't going to copy, and using relative.

 yum-HEAD.patch |   70 +++++++++++++++++++++++++++++++++----------------------
 yum.spec       |    6 ++++-
 2 files changed, 47 insertions(+), 29 deletions(-)
---
diff --git a/yum-HEAD.patch b/yum-HEAD.patch
index 39fe263..e3296f4 100644
--- a/yum-HEAD.patch
+++ b/yum-HEAD.patch
@@ -159344,7 +159344,7 @@ index 2cb1acb..0586c1c 100644
          for pkg in un['pkglist']:
              for filedata in pkg['packages']:
 diff --git a/yum/yumRepo.py b/yum/yumRepo.py
-index e5e9ece..f834aec 100644
+index e5e9ece..7c55353 100644
 --- a/yum/yumRepo.py
 +++ b/yum/yumRepo.py
 @@ -20,10 +20,12 @@ import time
@@ -159650,8 +159650,23 @@ index e5e9ece..f834aec 100644
  
                  except urlgrabber.grabber.URLGrabError, e:
                      if not os.path.exists(self.metalink_filename):
-@@ -751,7 +846,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -749,9 +844,22 @@ class YumRepository(Repository, config.RepoConf):
+                                                               value),
+                              fdel=lambda self: setattr(self, "_metalink", None))
  
++    def _all_urls_are_files(self, url):
++        if url:
++            return url.startswith("/") or url.startswith("file:")
++
++        if not self.urls: # WTF ... but whatever.
++            return False
++
++        # Not an explicit url ... so make sure all mirrors/etc. are file://
++        for url in self.urls:
++            if not self._all_urls_are_files(url):
++                return False
++        return True
++
      def _getFile(self, url=None, relative=None, local=None, start=None, end=None,
              copy_local=None, checkfunc=None, text=None, reget='simple', 
 -            cache=True, size=None):
@@ -159659,7 +159674,7 @@ index e5e9ece..f834aec 100644
          """retrieve file from the mirrorgroup for the repo
             relative to local, optionally get range from
             start to end, also optionally retrieve from a specific baseurl"""
-@@ -768,7 +863,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -768,7 +876,7 @@ class YumRepository(Repository, config.RepoConf):
  
          if local is None or relative is None:
              raise Errors.RepoError, \
@@ -159668,12 +159683,11 @@ index e5e9ece..f834aec 100644
  
          if self.cache == 1:
              if os.path.exists(local): # FIXME - we should figure out a way
-@@ -796,6 +891,17 @@ class YumRepository(Repository, config.RepoConf):
+@@ -796,6 +904,16 @@ class YumRepository(Repository, config.RepoConf):
              except Errors.MediaError, e:
                  verbose_logger.log(logginglevels.DEBUG_2, "Error getting package from media; falling back to url %s" %(e,))
  
-+        if size and (self.copy_local or not url or
-+                     not (url.startswith("/") or url.startswith("file:"))):
++        if size and (copy_local or not _all_urls_are_files(url)):
 +            dirstat = os.statvfs(os.path.dirname(local))
 +            avail = dirstat.f_bavail * dirstat.f_bsize
 +            if avail < long(size):
@@ -159686,7 +159700,7 @@ index e5e9ece..f834aec 100644
          if url and scheme != "media":
              ugopts = self._default_grabopts(cache=cache)
              ug = URLGrabber(progress_obj = self.callback,
-@@ -815,14 +921,11 @@ class YumRepository(Repository, config.RepoConf):
+@@ -815,14 +933,11 @@ class YumRepository(Repository, config.RepoConf):
                                      range=(start, end),
                                      )
              except URLGrabError, e:
@@ -159703,7 +159717,7 @@ index e5e9ece..f834aec 100644
  
  
          else:
-@@ -835,19 +938,18 @@ class YumRepository(Repository, config.RepoConf):
+@@ -835,19 +950,18 @@ class YumRepository(Repository, config.RepoConf):
                                             reget = reget,
                                             checkfunc=checkfunc,
                                             http_headers=headers,
@@ -159729,7 +159743,7 @@ index e5e9ece..f834aec 100644
          remote = package.relativepath
          local = package.localPkg()
          basepath = package.basepath
-@@ -857,15 +959,26 @@ class YumRepository(Repository, config.RepoConf):
+@@ -857,15 +971,26 @@ class YumRepository(Repository, config.RepoConf):
                  return local
              misc.unlink_f(local)
  
@@ -159757,7 +159771,7 @@ index e5e9ece..f834aec 100644
      def getHeader(self, package, checkfunc = None, reget = 'simple',
              cache = True):
  
-@@ -1020,7 +1133,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1020,7 +1145,7 @@ class YumRepository(Repository, config.RepoConf):
              if grab_can_fail:
                  return None
              raise Errors.RepoError, 'Error downloading file %s: %s' % (local, e)
@@ -159766,7 +159780,7 @@ index e5e9ece..f834aec 100644
              misc.unlink_f(tfname)
              if grab_can_fail:
                  return None
-@@ -1260,6 +1373,9 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1260,6 +1385,9 @@ class YumRepository(Repository, config.RepoConf):
          return True
  
      def _check_db_version(self, mdtype, repoXML=None):
@@ -159776,7 +159790,7 @@ index e5e9ece..f834aec 100644
          if repoXML is None:
              repoXML = self.repoXML
          if mdtype in repoXML.repoData:
-@@ -1277,11 +1393,11 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1277,11 +1405,11 @@ class YumRepository(Repository, config.RepoConf):
              return None
  
          if not file_check:
@@ -159791,7 +159805,7 @@ index e5e9ece..f834aec 100644
              if not os.path.exists(local):
                  local = misc.decompress(local, fn_only=True)
                  compressed = True
-@@ -1302,6 +1418,17 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1302,6 +1430,17 @@ class YumRepository(Repository, config.RepoConf):
              into the delete list, this means metadata can change filename
              without us leaking it. """
  
@@ -159809,7 +159823,7 @@ index e5e9ece..f834aec 100644
          def _mdtype_eq(omdtype, odata, nmdtype, ndata):
              """ Check if two returns from _get_mdtype_data() are equal. """
              if ndata is None:
-@@ -1321,6 +1448,14 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1321,6 +1460,14 @@ class YumRepository(Repository, config.RepoConf):
              return True
  
          all_mdtypes = self.retrieved.keys()
@@ -159824,7 +159838,7 @@ index e5e9ece..f834aec 100644
          if mdtypes is None:
              mdtypes = all_mdtypes
  
-@@ -1333,8 +1468,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1333,8 +1480,7 @@ class YumRepository(Repository, config.RepoConf):
  
          # Inited twice atm. ... sue me
          self._oldRepoMDData['new_MD_files'] = []
@@ -159834,7 +159848,7 @@ index e5e9ece..f834aec 100644
          for mdtype in all_mdtypes:
              (nmdtype, ndata) = self._get_mdtype_data(mdtype)
  
-@@ -1371,43 +1505,16 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1371,43 +1517,16 @@ class YumRepository(Repository, config.RepoConf):
              # No old repomd data, but we might still have uncompressed MD
              if self._groupCheckDataMDValid(ndata, nmdtype, mdtype):
                  continue
@@ -159883,7 +159897,7 @@ index e5e9ece..f834aec 100644
  
      def _groupLoadRepoXML(self, text=None, mdtypes=None):
          """ Retrieve the new repomd.xml from the repository, then check it
-@@ -1421,7 +1528,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1421,7 +1540,7 @@ class YumRepository(Repository, config.RepoConf):
              self._commonRetrieveDataMD(mdtypes)
  
      def _mdpolicy2mdtypes(self):
@@ -159892,7 +159906,7 @@ index e5e9ece..f834aec 100644
                       'group:primary' : ['primary'],
                       'group:small'   : ["primary", "updateinfo"],
                       'group:main'    : ["primary", "group", "filelists",
-@@ -1436,6 +1543,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1436,6 +1555,7 @@ class YumRepository(Repository, config.RepoConf):
          if not mdtypes or 'group:all' in mdtypes:
              mdtypes = None
          else:
@@ -159900,7 +159914,7 @@ index e5e9ece..f834aec 100644
              mdtypes = sorted(list(mdtypes))
          return mdtypes
  
-@@ -1451,12 +1559,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1451,12 +1571,7 @@ class YumRepository(Repository, config.RepoConf):
      def _getRepoXML(self):
          if self._repoXML:
              return self._repoXML
@@ -159914,7 +159928,7 @@ index e5e9ece..f834aec 100644
          return self._repoXML
  
  
-@@ -1480,7 +1583,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1480,7 +1595,7 @@ class YumRepository(Repository, config.RepoConf):
                  result = self._getFile(relative='repodata/repomd.xml.asc',
                                         copy_local=1,
                                         local = sigfile,
@@ -159923,7 +159937,7 @@ index e5e9ece..f834aec 100644
                                         reget=None,
                                         checkfunc=None,
                                         cache=self.http_caching == 'all',
-@@ -1514,7 +1617,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1514,7 +1629,7 @@ class YumRepository(Repository, config.RepoConf):
          return self._checkMD(fn, mdtype, openchecksum)
  
      def _checkMD(self, fn, mdtype, openchecksum=False,
@@ -159932,7 +159946,7 @@ index e5e9ece..f834aec 100644
          """ Internal function, use .checkMD() from outside yum. """
  
          thisdata = data # So the argument name is nicer
-@@ -1537,6 +1640,18 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1537,6 +1652,18 @@ class YumRepository(Repository, config.RepoConf):
          if size is not None:
              size = int(size)
  
@@ -159951,7 +159965,7 @@ index e5e9ece..f834aec 100644
          try: # get the local checksum
              l_csum = self._checksum(r_ctype, file, datasize=size)
          except Errors.RepoError, e:
-@@ -1551,15 +1666,13 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1551,15 +1678,13 @@ class YumRepository(Repository, config.RepoConf):
                  return None
              raise URLGrabError(-1, 'Metadata file does not match checksum')
  
@@ -159968,7 +159982,7 @@ index e5e9ece..f834aec 100644
          """ Internal function, use .retrieveMD() from outside yum. """
          #  Note that this can raise Errors.RepoMDError if mdtype doesn't exist
          # for this repo.
-@@ -1597,8 +1710,10 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1597,8 +1722,10 @@ class YumRepository(Repository, config.RepoConf):
                  return local # it's the same return the local one
  
          try:
@@ -159981,7 +159995,7 @@ index e5e9ece..f834aec 100644
              if thisdata.size is None:
                  reget = None
              else:
-@@ -1613,8 +1728,9 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1613,8 +1740,9 @@ class YumRepository(Repository, config.RepoConf):
                                    checkfunc=checkfunc, 
                                    text=text,
                                    cache=self.http_caching == 'all',
@@ -159993,7 +160007,7 @@ index e5e9ece..f834aec 100644
              if retrieve_can_fail:
                  return None
              raise
-@@ -1624,7 +1740,6 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1624,7 +1752,6 @@ class YumRepository(Repository, config.RepoConf):
              raise Errors.RepoError, \
                  "Could not retrieve %s matching remote checksum from %s" % (local, self)
          else:
@@ -160001,7 +160015,7 @@ index e5e9ece..f834aec 100644
              return local
  
  
-@@ -1646,13 +1761,21 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1646,13 +1773,21 @@ class YumRepository(Repository, config.RepoConf):
  
      def getGroups(self):
          """gets groups and returns group file path for the repository, if there
@@ -160026,7 +160040,7 @@ index e5e9ece..f834aec 100644
          self._callbacks_changed = True
  
      def setFailureObj(self, failure_obj):
-@@ -1681,7 +1804,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1681,7 +1816,7 @@ class YumRepository(Repository, config.RepoConf):
                  print "Could not read mirrorlist %s, error was \n%s" %(url, e)
                  content = []
              for line in content:
diff --git a/yum.spec b/yum.spec
index 178e346..b64281c 100644
--- a/yum.spec
+++ b/yum.spec
@@ -18,7 +18,7 @@
 Summary: RPM package installer/updater/manager
 Name: yum
 Version: 3.4.3
-Release: 40%{?dist}
+Release: 41%{?dist}
 License: GPLv2+
 Group: System Environment/Base
 Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz
@@ -315,6 +315,10 @@ exit 0
 %endif
 
 %changelog
+* Fri Aug 31 2012 James Antill <james at fedoraproject.org> - 3.4.3-41
+- update to latest HEAD.
+- Don't statvfs when we aren't going to copy, and using relative.
+
 * Thu Aug 30 2012 James Antill <james at fedoraproject.org> - 3.4.3-40
 - update to latest HEAD.
 - Fix rel-eng problems when repo.repofile is None.


More information about the scm-commits mailing list