[yum] Update to latest HEAD.

James Antill james at fedoraproject.org
Mon Nov 11 06:21:51 UTC 2013


commit fe1bb74636224e88e1ecd7f6374b088c57bd6d32
Author: James Antill <james at and.org>
Date:   Mon Nov 11 01:22:06 2013 -0500

    Update to latest HEAD.
    
    - Fixup always turning cron/makecache systemd stuff off.
    - _readRawRepoFile: return only valid (ini, section_id). BZ 1018795.
    - Same-mirror retry on refused connections. Helps BZ 853432.

 yum-HEAD.patch |  191 +++++++++++++++++++++++++++++++-------------------------
 yum.spec       |   26 +++++++-
 2 files changed, 128 insertions(+), 89 deletions(-)
---
diff --git a/yum-HEAD.patch b/yum-HEAD.patch
index 214cc62..4f18137 100644
--- a/yum-HEAD.patch
+++ b/yum-HEAD.patch
@@ -2778,7 +2778,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..4720ccd 100644
+index 1a8202a..e42bf49 100644
 --- a/docs/yum.8
 +++ b/docs/yum.8
 @@ -25,6 +25,8 @@ gnome\-packagekit application\&.
@@ -3203,7 +3203,7 @@ index 1a8202a..4720ccd 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,11 +550,152 @@ end of the package column in the packages-list command).
+@@ -371,11 +550,156 @@ 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
  
@@ -3287,6 +3287,10 @@ index 1a8202a..4720ccd 100644
 +Is the subset of the updateinfo information, pertaining to security.
 +
 +.br
++.I \fR "\fB* severity / sev\fP"
++Include security relevant packages of this severity.
++
++.br
 +.I \fR "\fB* recommended\fP"
 +Is the subset of the updateinfo information, pertaining to recommended updates.
 +
@@ -3358,7 +3362,7 @@ index 1a8202a..4720ccd 100644
  
  The info command can also take ranges of transaction ids, of the form
  start..end, which will then display a merged history as if all the
-@@ -401,6 +721,11 @@ Assume yes; assume that the answer to any question which would be asked
+@@ -401,6 +725,11 @@ Assume yes; assume that the answer to any question which would be asked
  is yes\&.
  .br
  Configuration Option: \fBassumeyes\fP
@@ -3370,7 +3374,7 @@ index 1a8202a..4720ccd 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 +745,7 @@ Sets the error level to [number] Practical range 0 \- 10. 0 means print only cri
+@@ -420,7 +749,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" 
@@ -3379,7 +3383,7 @@ index 1a8202a..4720ccd 100644
  options are: 'critical', 'emergency', 'error', 'warn' and 'debug'.
  .br
  Configuration Option: \fBrpmverbosity\fP
-@@ -428,9 +753,7 @@ Configuration Option: \fBrpmverbosity\fP
+@@ -428,9 +757,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
@@ -3390,7 +3394,7 @@ index 1a8202a..4720ccd 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 +784,13 @@ processing logic. For more information see the \fBupdate\fP command above.
+@@ -461,8 +788,13 @@ processing logic. For more information see the \fBupdate\fP command above.
  .br
  Configuration Option: \fBobsoletes\fP
  .IP "\fB\-x, \-\-exclude=package\fP"
@@ -3406,7 +3410,7 @@ index 1a8202a..4720ccd 100644
  .br
  .IP "\fB\-\-color=[always|auto|never]\fP"
  Display colorized output automatically, depending on the output terminal,
-@@ -479,6 +807,13 @@ main == disable excludes defined in [main] in yum.conf
+@@ -479,6 +811,13 @@ main == disable excludes defined in [main] in yum.conf
  .br
  repoid == disable excludes defined for that repo
  .br
@@ -3420,7 +3424,7 @@ index 1a8202a..4720ccd 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 +841,14 @@ option will corrupt your cache (and you can use $releasever in your cachedir
+@@ -506,7 +845,14 @@ option will corrupt your cache (and you can use $releasever in your cachedir
  configuration to stop this).
  .PP 
  .IP "\fB\-t, \-\-tolerant\fP"
@@ -3436,7 +3440,7 @@ index 1a8202a..4720ccd 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 +865,7 @@ version of the package\&.
+@@ -523,7 +869,7 @@ version of the package\&.
  
  The format of the output of yum list is:
  
@@ -3445,7 +3449,7 @@ index 1a8202a..4720ccd 100644
  
  .IP "\fByum list [all | glob_exp1] [glob_exp2] [\&.\&.\&.]\fP"
  List all available and installed packages\&.
-@@ -542,6 +884,10 @@ shell\-style glob and any matches are printed\&.
+@@ -542,6 +888,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
@@ -3456,7 +3460,7 @@ index 1a8202a..4720ccd 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 +1004,7 @@ configuration options.
+@@ -658,7 +1008,7 @@ configuration options.
  .I yum-complete-transaction (1)
  .I yumdownloader (1)
  .I yum-utils (1)
@@ -186362,10 +186366,10 @@ index 1ce4720..2f3f7a3
      gobject.threads_init()
      dbus.glib.threads_init()
 diff --git a/yum.spec b/yum.spec
-index abd203f..fa8b782 100644
+index abd203f..b5f39be 100644
 --- a/yum.spec
 +++ b/yum.spec
-@@ -1,24 +1,85 @@
+@@ -1,24 +1,97 @@
 -Summary: RPM installer/updater
 +%define move_yum_conf_back 1
 +%define auto_sitelib 1
@@ -186374,17 +186378,25 @@ index abd203f..fa8b782 100644
 +%define yum_cron_systemd 1
 +%define yum_makecache_systemd 1
 +
++%if 0%{?rhel}
++# If we are building for RHEL ...
++
 +%if 0%{?rhel} <= 6
 +# rhel-6 doesn't have the systemd stuff...
 +%define yum_cron_systemd 0
 +%define yum_makecache_systemd 0
 +%endif
 +
-+%if ! 0%{?rhel}
-+# we don't have this in rhel yet...
-+BuildRequires: bash-completion
++# END OF: If we are building for RHEL ...
 +%endif
 +
++
++%if 0%{?fedora}
++# If we are building for Fedora ...
++
++# we don't have this as of RHEL-7.0.
++BuildRequires: bash-completion
++
 +%if 0%{?fedora} <= 18
 +# yum in Fedora <= 18 doesn't use systemd unit files...
 +%define yum_cron_systemd 0
@@ -186395,6 +186407,10 @@ index abd203f..fa8b782 100644
 +%define yum_makecache_systemd 0
 +%endif
 +
++# END OF: If we are building for Fedora ...
++%endif
++
++
 +%if %{auto_sitelib}
 +
 +%{!?python_sitelib: %define python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
@@ -186457,7 +186473,7 @@ index abd203f..fa8b782 100644
  Conflicts: rpm >= 5-0
  # Zif is a re-implementation of yum in C, however:
  #
-@@ -34,18 +95,32 @@ Conflicts: rpm >= 5-0
+@@ -34,18 +107,32 @@ Conflicts: rpm >= 5-0
  # zif experts).
  #
  # ...so we have two sane choices: i) Conflict with it. 2) Stop developing yum.
@@ -186497,7 +186513,7 @@ index abd203f..fa8b782 100644
  
  %description
  Yum is a utility that can check for and automatically download and
-@@ -58,9 +133,11 @@ Group: Applications/System
+@@ -58,9 +145,11 @@ Group: Applications/System
  Requires: yum = %{version}-%{release}
  Requires: dbus-python
  Requires: pygobject2
@@ -186511,7 +186527,7 @@ index abd203f..fa8b782 100644
  Requires(postun): /sbin/service
  
  
-@@ -68,33 +145,74 @@ Requires(postun): /sbin/service
+@@ -68,33 +157,74 @@ Requires(postun): /sbin/service
  yum-updatesd provides a daemon which checks for available updates and 
  can notify you when they are available via email, syslog or dbus. 
  
@@ -186591,7 +186607,7 @@ index abd203f..fa8b782 100644
  
  # Ghost files:
  mkdir -p $RPM_BUILD_ROOT/var/lib/yum/history
-@@ -102,12 +220,31 @@ mkdir -p $RPM_BUILD_ROOT/var/lib/yum/plugins
+@@ -102,12 +232,31 @@ mkdir -p $RPM_BUILD_ROOT/var/lib/yum/plugins
  mkdir -p $RPM_BUILD_ROOT/var/lib/yum/yumdb
  touch $RPM_BUILD_ROOT/var/lib/yum/uuid
  
@@ -186623,7 +186639,7 @@ index abd203f..fa8b782 100644
  %post updatesd
  /sbin/chkconfig --add yum-updatesd
  /sbin/service yum-updatesd condrestart >/dev/null 2>&1
-@@ -119,9 +256,29 @@ if [ $1 = 0 ]; then
+@@ -119,9 +268,29 @@ if [ $1 = 0 ]; then
   /sbin/service yum-updatesd stop >/dev/null 2>&1
  fi
  exit 0
@@ -186654,7 +186670,7 @@ index abd203f..fa8b782 100644
  # Make sure chkconfig knows about the service
  /sbin/chkconfig --add yum-cron
  # if an upgrade:
-@@ -144,8 +301,13 @@ if [ "$1" -ge "1" ]; then
+@@ -144,8 +313,13 @@ if [ "$1" -ge "1" ]; then
   fi
  fi 
  exit 0
@@ -186668,7 +186684,7 @@ index abd203f..fa8b782 100644
  # if this will be a complete removeal of yum-cron rather than an upgrade,
  # remove the service from chkconfig control
  if [ $1 = 0 ]; then
-@@ -153,33 +315,59 @@ if [ $1 = 0 ]; then
+@@ -153,33 +327,59 @@ if [ $1 = 0 ]; then
   /sbin/service yum-cron stop 1> /dev/null 2>&1
  fi
  exit 0
@@ -186734,7 +186750,7 @@ index abd203f..fa8b782 100644
  %dir /var/cache/yum
  %dir /var/lib/yum
  %ghost /var/lib/yum/uuid
-@@ -188,20 +376,31 @@ exit 0
+@@ -188,20 +388,31 @@ exit 0
  %ghost /var/lib/yum/yumdb
  %{_mandir}/man*/yum.*
  %{_mandir}/man*/yum-shell*
@@ -186774,7 +186790,7 @@ index abd203f..fa8b782 100644
  %files updatesd
  %defattr(-, root, root)
  %config(noreplace) %{_sysconfdir}/yum/yum-updatesd.conf
-@@ -210,8 +409,12 @@ exit 0
+@@ -210,8 +421,12 @@ exit 0
  %{_datadir}/yum-cli/yumupd.py*
  %{_sbindir}/yum-updatesd
  %{_mandir}/man*/yum-updatesd*
@@ -191783,7 +191799,7 @@ index 65f6d5e..706e2a4 100755
          print >> sys.stderr, "newcomps.py: No such file:\'%s\'" % sys.argv[1]
          sys.exit(1)
 diff --git a/yum/config.py b/yum/config.py
-index d09511f..1cb4fc5 100644
+index d09511f..851339d 100644
 --- a/yum/config.py
 +++ b/yum/config.py
 @@ -38,6 +38,7 @@ if not _use_iniparse:
@@ -192071,12 +192087,12 @@ index d09511f..1cb4fc5 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):
@@ -192265,11 +192281,11 @@ index d09511f..1cb4fc5 100644
         
 -        Valid inputs: 100, 123M, 45.6k, 12.4G, 100K, 786.3, 0
 -        Invalid inputs: -10, -0.1, 45.6L, 123Mb
+-
+-        Return value will always be an integer
 +        Valid inputs: 100, 123M, 45.6k, 12.4G, 100K, 786.3, 0.
 +        Invalid inputs: -10, -0.1, 45.6L, 123Mb.
  
--        Return value will always be an integer
--
 -        1k = 1024 bytes.
 -
 -        ValueError will be raised if the option couldn't be parsed.
@@ -192885,10 +192901,13 @@ index d09511f..1cb4fc5 100644
      # b/c repoids can have $values in them we need to map both ways to figure
      # out which one is which
      section_id = repo.id
-@@ -1054,6 +1240,19 @@ def writeRawRepoFile(repo,only=None):
+@@ -1054,6 +1240,22 @@ def writeRawRepoFile(repo,only=None):
          for sect in ini._sections.keys():
              if varReplace(sect, repo.yumvar) == repo.id:
                  section_id = sect
++                break
++        else:
++            return None
 +    return ini, section_id
 +
 +def writeRawRepoFile(repo,only=None):
@@ -192905,7 +192924,7 @@ index d09511f..1cb4fc5 100644
      
      # Updated the ConfigParser with the changed values    
      cfgOptions = repo.cfg.options(repo.id)
-@@ -1069,7 +1268,7 @@ def writeRawRepoFile(repo,only=None):
+@@ -1069,7 +1271,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
@@ -198802,7 +198821,7 @@ index 0000000..1cc207f
 +    return txmbrs
 +
 diff --git a/yum/yumRepo.py b/yum/yumRepo.py
-index e5e9ece..e371676 100644
+index e5e9ece..67bb7c9 100644
 --- a/yum/yumRepo.py
 +++ b/yum/yumRepo.py
 @@ -20,10 +20,12 @@ import time
@@ -199155,7 +199174,7 @@ index e5e9ece..e371676 100644
  
          if proxy_string is not None:
              self._proxy_dict['http'] = proxy_string
-@@ -483,22 +605,62 @@ class YumRepository(Repository, config.RepoConf):
+@@ -483,22 +605,63 @@ class YumRepository(Repository, config.RepoConf):
  
          ugopts = self._default_grabopts()
          self._grabfunc = URLGrabber(progress_obj=self.callback,
@@ -199165,6 +199184,9 @@ index e5e9ece..e371676 100644
                                      copy_local=self.copy_local,
                                      reget='simple',
                                      **ugopts)
+-
+-        self._grab = mgclass(self._grabfunc, self.urls,
+-                             failure_callback=self.mirror_failure_obj)
 +        def add_mc(url):
 +            host = urlparse.urlsplit(url).netloc.split('@')[-1]
 +            mc = self.metalink_data._host2mc.get(host)
@@ -199185,9 +199207,10 @@ index e5e9ece..e371676 100644
 +        def mirror_failure(obj):
 +            action = {}
 +
-+            # timeouts and 503 errors may retry
++            # timeout, refused connect, and HTTP 503 may retry
 +            e = obj.exception
-+            if e.errno == 12 or getattr(e, 'code', 0) == 503:
++            if e.errno == 12 or \
++               e.errno == 14 and getattr(e, 'code', 0) in (7, 503):
 +                tries = getattr(obj, 'tries', self.retries)
 +                if tries <= self.retries - len(self.urls):
 +                    # don't remove this mirror yet
@@ -199203,9 +199226,7 @@ index e5e9ece..e371676 100644
 +                action.update(fun(obj, *arg, **karg))
 +
 +            return action
- 
--        self._grab = mgclass(self._grabfunc, self.urls,
--                             failure_callback=self.mirror_failure_obj)
++
 +        self._grab = mgclass(self._grabfunc, urls,
 +                             failure_callback=mirror_failure)
  
@@ -199221,7 +199242,7 @@ index e5e9ece..e371676 100644
                   'http_headers': tuple(self.__headersListFromDict(cache=cache)),
                   'ssl_verify_peer': self.sslverify,
                   'ssl_verify_host': self.sslverify,
-@@ -509,6 +671,10 @@ class YumRepository(Repository, config.RepoConf):
+@@ -509,6 +672,10 @@ class YumRepository(Repository, config.RepoConf):
                   'username': self.username,
                   'password': self.password,
                   }
@@ -199232,7 +199253,7 @@ index e5e9ece..e371676 100644
          return opts
  
      def _getgrabfunc(self):
-@@ -531,9 +697,6 @@ class YumRepository(Repository, config.RepoConf):
+@@ -531,9 +698,6 @@ class YumRepository(Repository, config.RepoConf):
          if os.path.exists(dpath) and os.path.isdir(dpath):
              return
  
@@ -199242,7 +199263,7 @@ index e5e9ece..e371676 100644
          try:
              os.makedirs(dpath, mode=0755)
          except OSError, e:
-@@ -561,7 +724,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -561,7 +725,7 @@ class YumRepository(Repository, config.RepoConf):
          cookie = self.cachedir + '/' + self.metadata_cookie_fn
          self.setAttribute('_dir_setup_metadata_cookie', cookie)
  
@@ -199251,7 +199272,7 @@ index e5e9ece..e371676 100644
              self._dirSetupMkdir_p(dir)
  
          # persistdir is really root-only but try the make anyway and just
-@@ -714,15 +877,15 @@ class YumRepository(Repository, config.RepoConf):
+@@ -714,15 +878,15 @@ class YumRepository(Repository, config.RepoConf):
              local = self.metalink_filename + '.tmp'
              if not self._metalinkCurrent():
                  url = misc.to_utf8(self.metalink)
@@ -199271,7 +199292,7 @@ index e5e9ece..e371676 100644
                          raise Errors.RepoError, msg
                      #  Now, we have an old usable metalink, so we can't move to
                      # a newer repomd.xml ... or checksums won't match.
-@@ -749,9 +912,22 @@ class YumRepository(Repository, config.RepoConf):
+@@ -749,9 +913,22 @@ class YumRepository(Repository, config.RepoConf):
                                                                value),
                               fdel=lambda self: setattr(self, "_metalink", None))
  
@@ -199295,7 +199316,7 @@ index e5e9ece..e371676 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 +944,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -768,7 +945,7 @@ class YumRepository(Repository, config.RepoConf):
  
          if local is None or relative is None:
              raise Errors.RepoError, \
@@ -199304,7 +199325,7 @@ index e5e9ece..e371676 100644
  
          if self.cache == 1:
              if os.path.exists(local): # FIXME - we should figure out a way
-@@ -778,7 +954,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -778,7 +955,7 @@ class YumRepository(Repository, config.RepoConf):
                  raise Errors.RepoError, \
                      "Caching enabled but no local cache of %s from %s" % (local,
  
@@ -199313,7 +199334,7 @@ index e5e9ece..e371676 100644
  
          if url:
              (scheme, netloc, path, query, fragid) = urlparse.urlsplit(url)
-@@ -796,6 +972,16 @@ class YumRepository(Repository, config.RepoConf):
+@@ -796,6 +973,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,))
  
@@ -199330,7 +199351,7 @@ index e5e9ece..e371676 100644
          if url and scheme != "media":
              ugopts = self._default_grabopts(cache=cache)
              ug = URLGrabber(progress_obj = self.callback,
-@@ -815,15 +1001,11 @@ class YumRepository(Repository, config.RepoConf):
+@@ -815,15 +1002,11 @@ class YumRepository(Repository, config.RepoConf):
                                      range=(start, end),
                                      )
              except URLGrabError, e:
@@ -199351,7 +199372,7 @@ index e5e9ece..e371676 100644
  
          else:
              headers = tuple(self.__headersListFromDict(cache=cache))
-@@ -835,19 +1017,21 @@ class YumRepository(Repository, config.RepoConf):
+@@ -835,19 +1018,21 @@ class YumRepository(Repository, config.RepoConf):
                                             reget = reget,
                                             checkfunc=checkfunc,
                                             http_headers=headers,
@@ -199380,7 +199401,7 @@ index e5e9ece..e371676 100644
          remote = package.relativepath
          local = package.localPkg()
          basepath = package.basepath
-@@ -857,15 +1041,30 @@ class YumRepository(Repository, config.RepoConf):
+@@ -857,15 +1042,30 @@ class YumRepository(Repository, config.RepoConf):
                  return local
              misc.unlink_f(local)
  
@@ -199412,7 +199433,7 @@ index e5e9ece..e371676 100644
      def getHeader(self, package, checkfunc = None, reget = 'simple',
              cache = True):
  
-@@ -894,19 +1093,16 @@ class YumRepository(Repository, config.RepoConf):
+@@ -894,19 +1094,16 @@ class YumRepository(Repository, config.RepoConf):
  
          mC_def = self.withinCacheAge(self.metadata_cookie, self.metadata_expire)
          if not mC_def: # Normal path...
@@ -199432,7 +199453,7 @@ index e5e9ece..e371676 100644
              return False
  
          self._metadataCurrent = True
-@@ -933,7 +1129,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -933,7 +1130,7 @@ class YumRepository(Repository, config.RepoConf):
              self._metadataCurrent = False
          return self._metadataCurrent
  
@@ -199441,7 +199462,7 @@ index e5e9ece..e371676 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 +1140,24 @@ class YumRepository(Repository, config.RepoConf):
             file. If any of them are newer then invalidate the cache
             """
  
@@ -199466,7 +199487,7 @@ index e5e9ece..e371676 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 +1206,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):
@@ -199475,7 +199496,7 @@ index e5e9ece..e371676 100644
          if self.cache or self.metadataCurrent():
              return True
          return False
-@@ -1020,7 +1234,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1020,7 +1235,7 @@ class YumRepository(Repository, config.RepoConf):
              if grab_can_fail:
                  return None
              raise Errors.RepoError, 'Error downloading file %s: %s' % (local, e)
@@ -199484,7 +199505,7 @@ index e5e9ece..e371676 100644
              misc.unlink_f(tfname)
              if grab_can_fail:
                  return None
-@@ -1047,7 +1261,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1047,7 +1262,7 @@ class YumRepository(Repository, config.RepoConf):
                  parse_can_fail = 'old_repo_XML' in self._oldRepoMDData
              if parse_can_fail:
                  return None
@@ -199493,7 +199514,7 @@ index e5e9ece..e371676 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 +1289,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:
@@ -199502,7 +199523,7 @@ index e5e9ece..e371676 100644
  
          if 'old_repo_XML' not in self._oldRepoMDData:
              self._oldRepoMDData = {}
-@@ -1250,7 +1464,6 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1250,7 +1465,6 @@ class YumRepository(Repository, config.RepoConf):
              self._revertOldRepoXML()
              return False
  
@@ -199510,7 +199531,7 @@ index e5e9ece..e371676 100644
          if caching:
              return False # Skip any work.
  
-@@ -1260,6 +1473,9 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1260,6 +1474,9 @@ class YumRepository(Repository, config.RepoConf):
          return True
  
      def _check_db_version(self, mdtype, repoXML=None):
@@ -199520,7 +199541,7 @@ index e5e9ece..e371676 100644
          if repoXML is None:
              repoXML = self.repoXML
          if mdtype in repoXML.repoData:
-@@ -1277,11 +1493,11 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1277,11 +1494,11 @@ class YumRepository(Repository, config.RepoConf):
              return None
  
          if not file_check:
@@ -199535,7 +199556,7 @@ index e5e9ece..e371676 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 +1519,17 @@ class YumRepository(Repository, config.RepoConf):
              into the delete list, this means metadata can change filename
              without us leaking it. """
  
@@ -199553,7 +199574,7 @@ index e5e9ece..e371676 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 +1549,14 @@ class YumRepository(Repository, config.RepoConf):
              return True
  
          all_mdtypes = self.retrieved.keys()
@@ -199568,7 +199589,7 @@ index e5e9ece..e371676 100644
          if mdtypes is None:
              mdtypes = all_mdtypes
  
-@@ -1332,9 +1567,8 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1332,9 +1568,8 @@ class YumRepository(Repository, config.RepoConf):
              self._oldRepoMDData['old_MD_files'] = reverts
  
          # Inited twice atm. ... sue me
@@ -199580,7 +199601,7 @@ index e5e9ece..e371676 100644
          for mdtype in all_mdtypes:
              (nmdtype, ndata) = self._get_mdtype_data(mdtype)
  
-@@ -1371,43 +1605,16 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1371,43 +1606,16 @@ class YumRepository(Repository, config.RepoConf):
              # No old repomd data, but we might still have uncompressed MD
              if self._groupCheckDataMDValid(ndata, nmdtype, mdtype):
                  continue
@@ -199601,9 +199622,7 @@ index e5e9ece..e371676 100644
 -        local_size  = 0
 -        for (ndata, nmdtype) in downloading_with_size: # Get total size...
 -            remote_size += int(ndata.size)
-+    def _commonRetrieveDataMD_done(self, downloading):
-+        """ Uncompress the downloaded metadata """
- 
+-
 -        for (ndata, nmdtype) in downloading_with_size:
 -            urlgrabber.progress.text_meter_total_size(remote_size, local_size)
 -            if not self._retrieveMD(nmdtype, retrieve_can_fail=True):
@@ -199615,7 +199634,9 @@ index e5e9ece..e371676 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)
@@ -199630,7 +199651,7 @@ index e5e9ece..e371676 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 +1629,11 @@ class YumRepository(Repository, config.RepoConf):
              self._commonRetrieveDataMD(mdtypes)
  
      def _mdpolicy2mdtypes(self):
@@ -199646,7 +199667,7 @@ index e5e9ece..e371676 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 +1644,7 @@ class YumRepository(Repository, config.RepoConf):
          if not mdtypes or 'group:all' in mdtypes:
              mdtypes = None
          else:
@@ -199654,7 +199675,7 @@ index e5e9ece..e371676 100644
              mdtypes = sorted(list(mdtypes))
          return mdtypes
  
-@@ -1446,17 +1654,12 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1446,17 +1655,12 @@ class YumRepository(Repository, config.RepoConf):
          except KeyboardInterrupt:
              self._revertOldRepoXML() # Undo metadata cookie?
              raise
@@ -199674,7 +199695,7 @@ index e5e9ece..e371676 100644
          return self._repoXML
  
  
-@@ -1480,7 +1683,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1480,7 +1684,7 @@ class YumRepository(Repository, config.RepoConf):
                  result = self._getFile(relative='repodata/repomd.xml.asc',
                                         copy_local=1,
                                         local = sigfile,
@@ -199683,7 +199704,7 @@ index e5e9ece..e371676 100644
                                         reget=None,
                                         checkfunc=None,
                                         cache=self.http_caching == 'all',
-@@ -1508,6 +1711,18 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1508,6 +1712,18 @@ class YumRepository(Repository, config.RepoConf):
              raise URLGrabError(-1, 'repomd.xml does not match metalink for %s' %
                                 self)
  
@@ -199702,7 +199723,7 @@ index e5e9ece..e371676 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 +1753,16 @@ class YumRepository(Repository, config.RepoConf):
          if size is not None:
              size = int(size)
  
@@ -199719,7 +199740,7 @@ index e5e9ece..e371676 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 +1771,20 @@ class YumRepository(Repository, config.RepoConf):
              raise URLGrabError(-3, 'Error performing checksum')
  
          if l_csum == r_csum:
@@ -199743,7 +199764,7 @@ index e5e9ece..e371676 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 +1800,38 @@ class YumRepository(Repository, config.RepoConf):
              # got it, move along
              return local
  
@@ -199802,7 +199823,7 @@ index e5e9ece..e371676 100644
              local = self._getFile(relative=remote,
                                    local=local, 
                                    copy_local=1,
-@@ -1613,8 +1838,9 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1613,8 +1839,9 @@ class YumRepository(Repository, config.RepoConf):
                                    checkfunc=checkfunc, 
                                    text=text,
                                    cache=self.http_caching == 'all',
@@ -199814,7 +199835,7 @@ index e5e9ece..e371676 100644
              if retrieve_can_fail:
                  return None
              raise
-@@ -1622,9 +1848,8 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1622,9 +1849,8 @@ class YumRepository(Repository, config.RepoConf):
              if retrieve_can_fail:
                  return None
              raise Errors.RepoError, \
@@ -199825,7 +199846,7 @@ index e5e9ece..e371676 100644
              return local
  
  
-@@ -1646,13 +1871,21 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1646,13 +1872,21 @@ class YumRepository(Repository, config.RepoConf):
  
      def getGroups(self):
          """gets groups and returns group file path for the repository, if there
@@ -199850,7 +199871,7 @@ index e5e9ece..e371676 100644
          self._callbacks_changed = True
  
      def setFailureObj(self, failure_obj):
-@@ -1681,7 +1914,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1681,7 +1915,7 @@ class YumRepository(Repository, config.RepoConf):
                  print "Could not read mirrorlist %s, error was \n%s" %(url, e)
                  content = []
              for line in content:
@@ -199859,7 +199880,7 @@ index e5e9ece..e371676 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 +1935,8 @@ class YumRepository(Repository, config.RepoConf):
          fo = None
  
          cacheok = False
@@ -199869,7 +199890,7 @@ index e5e9ece..e371676 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 +1948,7 @@ class YumRepository(Repository, config.RepoConf):
              ugopts = self._default_grabopts()
              try:
                  fo = urlgrabber.grabber.urlopen(url, **ugopts)
@@ -199878,7 +199899,7 @@ index e5e9ece..e371676 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 +1975,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
@@ -199891,7 +199912,7 @@ index e5e9ece..e371676 100644
          return True
  
      def _preload_file_from_system_cache(self, filename, subdir='',
-@@ -1877,7 +2115,7 @@ def getMirrorList(mirrorlist, pdict = None):
+@@ -1877,7 +2116,7 @@ def getMirrorList(mirrorlist, pdict = None):
  
      try:
          fo = urlresolver.urlopen(url, proxies=pdict)
diff --git a/yum.spec b/yum.spec
index 45f1355..ddb821d 100644
--- a/yum.spec
+++ b/yum.spec
@@ -5,17 +5,25 @@
 %define yum_cron_systemd 1
 %define yum_makecache_systemd 1
 
+%if 0%{?rhel}
+# If we are building for RHEL ...
+
 %if 0%{?rhel} <= 6
 # rhel-6 doesn't have the systemd stuff...
 %define yum_cron_systemd 0
 %define yum_makecache_systemd 0
 %endif
 
-%if ! 0%{?rhel}
-# we don't have this in rhel yet...
-BuildRequires: bash-completion
+# END OF: If we are building for RHEL ...
 %endif
 
+
+%if 0%{?fedora}
+# If we are building for Fedora ...
+
+# we don't have this as of RHEL-7.0.
+BuildRequires: bash-completion
+
 %if 0%{?fedora} <= 18
 # yum in Fedora <= 18 doesn't use systemd unit files...
 %define yum_cron_systemd 0
@@ -26,6 +34,10 @@ BuildRequires: bash-completion
 %define yum_makecache_systemd 0
 %endif
 
+# END OF: If we are building for Fedora ...
+%endif
+
+
 %if %{auto_sitelib}
 
 %{!?python_sitelib: %define python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
@@ -48,7 +60,7 @@ BuildRequires: bash-completion
 Summary: RPM package installer/updater/manager
 Name: yum
 Version: 3.4.3
-Release: 113%{?dist}
+Release: 114%{?dist}
 License: GPLv2+
 Group: System Environment/Base
 Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz
@@ -429,6 +441,12 @@ exit 0
 %endif
 
 %changelog
+* Sun Nov 10 2013 James Antill <james at fedoraproject.org> - 3.4.3-114
+- Update to latest HEAD.
+- Fixup always turning cron/makecache systemd stuff off.
+- _readRawRepoFile: return only valid (ini, section_id). BZ 1018795.
+- Same-mirror retry on refused connections. Helps BZ 853432.
+
 * Thu Oct 31 2013 James Antill <james at fedoraproject.org> - 3.4.3-113
 - Update to latest HEAD.
 - Mostly backwards compat. change to how distroverpkg config. works. BZ 1002977.


More information about the scm-commits mailing list