[yum/f17] update to latest HEAD.

Zdeněk Pavlas zpavlas at fedoraproject.org
Mon Jun 25 08:09:08 UTC 2012


commit 5126a3325eb7d306fe7191bdee1e5778c8f154f6
Author: Zdeněk Pavlas <zpavlas at redhat.com>
Date:   Mon Jun 25 10:05:43 2012 +0200

    update to latest HEAD.
    
    - No async downloading when --cacheonly.  BZ 830523.
    - compare mtime without sub second precision. BZ 831918
    - show_lock_owner: report errors if we fail.  BZ 745281
    - quote uids to keep cachedir ascii-clean.  BZ 832195
    - A solution to the obsoletes but don't provide problem. BZ 834530
    - completion-helper: use the system cachedir

 yum-HEAD.patch |  302 ++++++++++++++++++++++++++++++++++++++++++--------------
 yum.spec       |   11 ++-
 2 files changed, 236 insertions(+), 77 deletions(-)
---
diff --git a/yum-HEAD.patch b/yum-HEAD.patch
index de0e1fc..3e9193b 100644
--- a/yum-HEAD.patch
+++ b/yum-HEAD.patch
@@ -1240,10 +1240,10 @@ index 6056d38..597efd6
          group.add_option("--installroot", help=_("set install root"), 
 diff --git a/completion-helper.py b/completion-helper.py
 new file mode 100755
-index 0000000..0e4b96b
+index 0000000..52a5463
 --- /dev/null
 +++ b/completion-helper.py
-@@ -0,0 +1,90 @@
+@@ -0,0 +1,91 @@
 +#!/usr/bin/python -t
 +# -*- coding: utf-8 -*-
 +#
@@ -1316,6 +1316,7 @@ index 0000000..0e4b96b
 +
 +def main(args):
 +    base = cli.YumBaseCli()
++    base.setCacheDir = lambda *x: True # use the system cachedir
 +    base.yum_cli_commands.clear()
 +    base.registerCommand(GroupsCompletionCommand())
 +    base.registerCommand(ListCompletionCommand())
@@ -148560,7 +148561,7 @@ index 0000000..a98341d
 +        self.assertResult( (p.installed_1, p.update_4) )
 +
 diff --git a/test/simpleobsoletestests.py b/test/simpleobsoletestests.py
-index 97a9923..70dde98 100644
+index 97a9923..55e6f14 100644
 --- a/test/simpleobsoletestests.py
 +++ b/test/simpleobsoletestests.py
 @@ -244,6 +244,42 @@ class SimpleObsoletesTests(OperationsTests):
@@ -148606,6 +148607,35 @@ index 97a9923..70dde98 100644
      def _MultiObsHelper(self):
          ret = {'zsh'  : FakePackage('zsh', '1', '1', '0', 'noarch'),
                 'ksh'  : FakePackage('ksh', '1', '1', '0', 'noarch'),
+@@ -588,6 +624,28 @@ class SimpleObsoletesTests(OperationsTests):
+         # self.assert_(res=='err', msg)
+         self.assertResult([])
+ 
++    def testRLOpenSSLMess1(self):
++        osl1  = FakePackage('openssl',      '1.0.0', '1', arch='i386')
++        osl1.addProvides('libssl.1', 'EQ', ('0', '1', '1'))
++        osl2  = FakePackage('openssl',      '1.0.1', '1', arch='i386')
++        osll2 = FakePackage('openssl-libs', '1.0.1', '1', arch='i386')
++        osll2.addProvides('libssl.2', 'EQ', ('0', '2', '1'))
++        osll2.addObsoletes('openssl', 'LT', (None, '1.0.1', None))
++
++        oc1   = FakePackage('openconnect',  '2.0.1', '1', arch='i386')
++        oc1.addRequires('openssl', 'GE', ('0', '0.9.9', '1'))
++        oc2   = FakePackage('openconnect',  '2.0.2', '1', arch='i386')
++        oc2.addRequires('openssl', 'GE', ('0', '0.9.9', '1'))
++
++        res, msg = self.runOperation(['upgrade', 'openssl'],
++                                     [oc1, osl1],
++                                     [oc1, oc2, osl1, osl2, osll2])
++
++        # In theory don't need to upgrade oc1 => oc2
++        self.assertResult((oc2, osl2, osll2))
++
++
++
+ class GitMetapackageObsoletesTests(OperationsTests):
+ 
+     @staticmethod
 diff --git a/test/simpleupdatetests.py b/test/simpleupdatetests.py
 index 6177fb1..2c8bcb3 100644
 --- a/test/simpleupdatetests.py
@@ -148684,7 +148714,7 @@ index 6177fb1..2c8bcb3 100644
 +        # self.assertResult((foo11, bar12, cbar11))
 +        self.assertResult((foo12, bar12, cbar11))
 diff --git a/test/testbase.py b/test/testbase.py
-index d0f22be..0a931f1 100644
+index d0f22be..608da70 100644
 --- a/test/testbase.py
 +++ b/test/testbase.py
 @@ -55,6 +55,9 @@ class FakeConf(object):
@@ -148697,6 +148727,22 @@ index d0f22be..0a931f1 100644
  
  class FakeSack:
      """ Fake PackageSack to use with FakeRepository"""
+@@ -138,6 +141,7 @@ class FakePackage(packages.YumAvailablePackage):
+         self.yumdb_info = FakeYumDBInfo()
+ 
+         self.prco['provides'].append((name, 'EQ', (epoch, version, release)))
++        self.prco['strong_requires'] = []
+ 
+         # Just a unique integer
+         self.id = self.__hash__()
+@@ -149,6 +153,7 @@ class FakePackage(packages.YumAvailablePackage):
+         self.prco['provides'].append((name, flag, evr))
+     def addRequires(self, name, flag=None, evr=(None, None, None)):
+         self.prco['requires'].append((name, flag, evr))
++        self.prco['strong_requires'].append((name, flag, evr))
+     def addRequiresPkg(self, pkg):
+         self.required_pkgs.append(pkg)
+     def addRequiringPkg(self, pkg):
 diff --git a/test/yum-leak-test.py b/test/yum-leak-test.py
 index 760b770..dd64483 100755
 --- a/test/yum-leak-test.py
@@ -149115,7 +149161,7 @@ index fa3e57c..ea4e683 100644
 diff --git a/utils.py b/utils.py
 old mode 100644
 new mode 100755
-index ced6ba0..08b09fb
+index ced6ba0..e465cf7
 --- a/utils.py
 +++ b/utils.py
 @@ -13,6 +13,9 @@
@@ -149191,10 +149237,24 @@ index ced6ba0..08b09fb
      if not pid:
          return
  
-@@ -106,6 +136,16 @@ def get_process_info(pid):
+@@ -63,12 +93,6 @@ def get_process_info(pid):
+     except ValueError, e:
+         return
+         
+-    # Maybe true if /proc isn't mounted, or not Linux ... or something.
+-    if (not os.path.exists("/proc/%d/status" % pid) or
+-        not os.path.exists("/proc/stat") or
+-        not os.path.exists("/proc/%d/stat" % pid)):
+-        return
+-
+     ps = {}
+     for line in open("/proc/%d/status" % pid):
+         if line[-1] != '\n':
+@@ -106,7 +130,21 @@ def get_process_info(pid):
      return ps
  
  def show_lock_owner(pid, logger):
+-    ps = get_process_info(pid)
 +    """Output information about another process that is holding the
 +    yum lock.
 +
@@ -149205,10 +149265,15 @@ index ced6ba0..08b09fb
 +       This is the same as the dictionary returned by
 +       :func:`get_process_info`.
 +    """
-     ps = get_process_info(pid)
++    try:
++        ps = get_process_info(pid)
++    except IOError, e:
++        logger.critical("%s", exception2msg(e))
++        ps = None
      if not ps:
          return None
-@@ -129,28 +169,9 @@ def show_lock_owner(pid, logger):
+ 
+@@ -129,28 +167,9 @@ def show_lock_owner(pid, logger):
      return ps
  
  
@@ -149239,7 +149304,7 @@ index ced6ba0..08b09fb
      def __init__(self,name,ver,usage):
          YumBaseCli.__init__(self)
          self._parser = YumOptionParser(base=self,utils=True,usage=usage)
-@@ -167,11 +188,22 @@ class YumUtilBase(YumBaseCli):
+@@ -167,11 +186,22 @@ class YumUtilBase(YumBaseCli):
              self.run_with_package_names.add("yum-utils")
  
      def exUserCancel(self):
@@ -149262,7 +149327,7 @@ index ced6ba0..08b09fb
          if e.errno == 32:
              self.logger.critical(_('\n\nExiting on Broken Pipe'))
          else:
-@@ -180,10 +212,13 @@ class YumUtilBase(YumBaseCli):
+@@ -180,10 +210,13 @@ class YumUtilBase(YumBaseCli):
          return 1
  
      def exPluginExit(self, e):
@@ -149279,7 +149344,7 @@ index ced6ba0..08b09fb
          exitmsg = exception2msg(e)
          if exitmsg:
              self.logger.warn('\n\n%s', exitmsg)
-@@ -191,11 +226,20 @@ class YumUtilBase(YumBaseCli):
+@@ -191,11 +224,20 @@ class YumUtilBase(YumBaseCli):
          return 1
  
      def exFatal(self, e):
@@ -149300,7 +149365,7 @@ index ced6ba0..08b09fb
          try:
              self.closeRpmDB()
              self.doUnlock()
-@@ -205,13 +249,27 @@ class YumUtilBase(YumBaseCli):
+@@ -205,13 +247,27 @@ class YumUtilBase(YumBaseCli):
          
          
      def getOptionParser(self):
@@ -149329,7 +149394,7 @@ index ced6ba0..08b09fb
          lockerr = ""
          while True:
              try:
-@@ -233,6 +291,13 @@ class YumUtilBase(YumBaseCli):
+@@ -233,6 +289,13 @@ class YumUtilBase(YumBaseCli):
          print "%s - %s (yum - %s)" % (self._utilName,self._utilVer,yum.__version__)
          
      def doUtilConfigSetup(self,args = sys.argv[1:],pluginsTypes=(plugins.TYPE_CORE,)):
@@ -149343,7 +149408,7 @@ index ced6ba0..08b09fb
          # Parse only command line options that affect basic yum setup
          opts = self._parser.firstParse(args)
  
-@@ -305,8 +370,9 @@ class YumUtilBase(YumBaseCli):
+@@ -305,8 +368,9 @@ class YumUtilBase(YumBaseCli):
          return opts
  
      def doUtilYumSetup(self):
@@ -149355,7 +149420,7 @@ index ced6ba0..08b09fb
          # FIXME - we need another way to do this, I think.
          try:
              self.waitForLock()
-@@ -319,6 +385,11 @@ class YumUtilBase(YumBaseCli):
+@@ -319,6 +383,11 @@ class YumUtilBase(YumBaseCli):
              sys.exit(1)
  
      def doUtilBuildTransaction(self, unfinished_transactions_check=True):
@@ -149367,7 +149432,7 @@ index ced6ba0..08b09fb
          try:
              (result, resultmsgs) = self.buildTransaction(unfinished_transactions_check = unfinished_transactions_check)
          except plugins.PluginYumExit, e:
-@@ -361,6 +432,7 @@ class YumUtilBase(YumBaseCli):
+@@ -361,6 +430,7 @@ class YumUtilBase(YumBaseCli):
          self.verbose_logger.log(logginglevels.INFO_2, _('\nDependencies Resolved'))
          
      def doUtilTransaction(self):
@@ -154894,7 +154959,7 @@ index d09511f..2bf4f45 100644
  
          if name not in cfgOptions and option.default == value:
 diff --git a/yum/depsolve.py b/yum/depsolve.py
-index 6d744c0..449cf48 100644
+index 6d744c0..5e95662 100644
 --- a/yum/depsolve.py
 +++ b/yum/depsolve.py
 @@ -31,13 +31,15 @@ from transactioninfo import TransactionMember
@@ -155103,7 +155168,40 @@ index 6d744c0..449cf48 100644
                      msg = self._err_missing_requires(requiringPo, requirement)
                      self.verbose_logger.log(logginglevels.DEBUG_2, _('No update paths found for %s. Failure!'), requiringPo)
                      return self._requiringFromTransaction(requiringPo, requirement, errorlist)
-@@ -696,6 +776,13 @@ class Depsolve(object):
+@@ -405,12 +485,30 @@ class Depsolve(object):
+             # try to update the requiring package in hopes that all this problem goes away :(
+             self.verbose_logger.log(logginglevels.DEBUG_2, _('Trying to update %s to resolve dep'), requiringPo)
+             txmbrs = self.update(po=requiringPo, requiringPo=requiringPo)
++            fixed = False
+             if not txmbrs:
+                 msg = self._err_missing_requires(requiringPo, requirement)
+-                self.verbose_logger.log(logginglevels.DEBUG_2, _('No update paths found for %s. Failure!'), requiringPo)
++                self.verbose_logger.log(logginglevels.DEBUG_2, _('No update paths found for %s. Failure due to requirement: %s!'), requiringPo, msg)
++            else:
++                req_lookup = (needname, needflags,
++                              rpmUtils.miscutils.stringToVersion(needversion))
++
++            for txmbr in txmbrs:
++                #  This works for upgrades, and for obsoletes, on one side.
++                # Also catches upgrades that don't work on the other.
++                if txmbr.output_state in TS_INSTALL_STATES:
++                    if txmbr.po.checkPrco('requires', req_lookup):
++                        fixed = False
++                        break
++                    else:
++                        fixed = True
++            if txmbrs and not fixed:
++                msg = self._err_missing_requires(requiringPo, requirement)
++                self.verbose_logger.log(logginglevels.DEBUG_2, _("Update for %s. Doesn't fix requirement: %s!"), requiringPo, msg)
++
++            if not fixed:
+                 return self._requiringFromTransaction(requiringPo, requirement, errorlist)
+             checkdeps = 1
+-
+             
+         if needmode in ['e']:
+             self.verbose_logger.log(logginglevels.DEBUG_2, _('TSINFO: %s package requiring %s marked as erase'),
+@@ -696,6 +794,13 @@ class Depsolve(object):
                  self.tsInfo.remove(txmbr.pkgtup)
  
      def prof_resolveDeps(self):
@@ -155117,7 +155215,7 @@ index 6d744c0..449cf48 100644
          fn = "anaconda.prof.0"
          import hotshot, hotshot.stats
          prof = hotshot.Profile(fn)
-@@ -709,6 +796,13 @@ class Depsolve(object):
+@@ -709,6 +814,13 @@ class Depsolve(object):
          return rc
  
      def cprof_resolveDeps(self):
@@ -155131,7 +155229,7 @@ index 6d744c0..449cf48 100644
          import cProfile, pstats
          prof = cProfile.Profile()
          rc = prof.runcall(self.resolveDeps)
-@@ -722,7 +816,17 @@ class Depsolve(object):
+@@ -722,7 +834,17 @@ class Depsolve(object):
          return rc
  
      def resolveDeps(self, full_check=True, skipping_broken=False):
@@ -155150,7 +155248,7 @@ index 6d744c0..449cf48 100644
          if not len(self.tsInfo):
              return (0, [_('Success - empty transaction')])
  
-@@ -778,6 +882,25 @@ class Depsolve(object):
+@@ -778,6 +900,25 @@ class Depsolve(object):
                      if checkdep:
                          break # The next conflict might be the same pkg
  
@@ -155176,7 +155274,7 @@ index 6d744c0..449cf48 100644
                  if CheckDeps:
                      if self.dsCallback: self.dsCallback.restartLoop()
                      self.verbose_logger.log(logginglevels.DEBUG_1, _('Restarting Loop'))
-@@ -920,9 +1043,12 @@ class Depsolve(object):
+@@ -920,9 +1061,12 @@ class Depsolve(object):
  
          # if this is an update, we should check what the old
          # requires were to make things faster
@@ -155191,7 +155289,7 @@ index 6d744c0..449cf48 100644
          oldreqs = set(oldreqs)
  
          ret = []
-@@ -1150,6 +1276,11 @@ class Depsolve(object):
+@@ -1150,6 +1294,11 @@ class Depsolve(object):
          return ret
  
      def isPackageInstalled(self, pkgname):
@@ -155203,7 +155301,7 @@ index 6d744c0..449cf48 100644
          lst = self.tsInfo.matchNaevr(name = pkgname)
          for txmbr in lst:
              if txmbr.output_state in TS_INSTALL_STATES:
-@@ -1166,7 +1297,7 @@ class Depsolve(object):
+@@ -1166,7 +1315,7 @@ class Depsolve(object):
          return True
      _isPackageInstalled = isPackageInstalled
  
@@ -155212,7 +155310,7 @@ index 6d744c0..449cf48 100644
          """take the list of pkgs and score them based on the requesting package
             return a dictionary of po=score"""
          self.verbose_logger.log(logginglevels.DEBUG_4,
-@@ -1210,6 +1341,24 @@ class Depsolve(object):
+@@ -1210,6 +1359,24 @@ class Depsolve(object):
                  return None
              return x
  
@@ -155237,7 +155335,7 @@ index 6d744c0..449cf48 100644
          #  Actual start of _compare_providers().
  
          # Do a NameArch filtering, based on repo. __cmp__
-@@ -1332,6 +1481,26 @@ class Depsolve(object):
+@@ -1332,6 +1499,26 @@ class Depsolve(object):
                          _('common prefix of %s between %s and %s' % (cpl, po, reqpo)))
                  
                      pkgresults[po] += cpl*2
@@ -155264,7 +155362,7 @@ index 6d744c0..449cf48 100644
                  
          #  If we have more than one "best", see what would happen if we picked
          # each package ... ie. what things do they require that _aren't_ already
-@@ -1393,42 +1562,52 @@ class Depsolve(object):
+@@ -1393,42 +1580,52 @@ class Depsolve(object):
  
  
  class DepCheck(object):
@@ -155307,12 +155405,12 @@ index 6d744c0..449cf48 100644
  
  class Requires(object):
 -
--    """
--    A pure data class for holding a package and the list of things it
--    requires.
 +    """A pure data class for holding a package and the list of things
 +    it requires.
      """
+-    A pure data class for holding a package and the list of things it
+-    requires.
+-    """
 -
      def __init__(self, pkg,requires):
          self.pkg = pkg # po of requiring pkg
@@ -156165,7 +156263,7 @@ index aaa4f25..51895fd 100755
                  continue
  
 diff --git a/yum/misc.py b/yum/misc.py
-index 2f6ddfe..59aff5d 100644
+index 2f6ddfe..4cae42b 100644
 --- a/yum/misc.py
 +++ b/yum/misc.py
 @@ -8,6 +8,7 @@ import os
@@ -156176,7 +156274,15 @@ index 2f6ddfe..59aff5d 100644
  import struct
  import re
  import errno
-@@ -410,6 +411,17 @@ def procgpgkey(rawkey):
+@@ -21,6 +22,7 @@ import fnmatch
+ import bz2
+ import gzip
+ import shutil
++import urllib
+ _available_compression = ['gz', 'bz2']
+ try:
+     import lzma
+@@ -410,6 +412,17 @@ def procgpgkey(rawkey):
      # Decode and return
      return base64.decodestring(block.getvalue())
  
@@ -156194,7 +156300,16 @@ index 2f6ddfe..59aff5d 100644
  def getgpgkeyinfo(rawkey, multiple=False):
      '''Return a dict of info for the given ASCII armoured key text
  
-@@ -746,6 +758,8 @@ def _decompress_chunked(source, dest, ztype):
+@@ -611,6 +624,8 @@ def getCacheDir(tmpdir='/var/tmp', reuse=True, prefix='yum-'):
+     try:
+         usertup = pwd.getpwuid(uid)
+         username = usertup[0]
++        # we prefer ascii-only paths
++        username = urllib.quote(username)
+     except KeyError:
+         return None # if it returns None then, well, it's bollocksed
+ 
+@@ -746,6 +761,8 @@ def _decompress_chunked(source, dest, ztype):
              data = s_fn.read(1024000)
          except IOError:
              break
@@ -156203,7 +156318,7 @@ index 2f6ddfe..59aff5d 100644
          
          if not data: break
  
-@@ -940,14 +954,16 @@ def unlink_f(filename):
+@@ -940,14 +957,16 @@ def unlink_f(filename):
          if e.errno != errno.ENOENT:
              raise
  
@@ -156224,7 +156339,7 @@ index 2f6ddfe..59aff5d 100644
  
  def _getloginuid():
      """ Get the audit-uid/login-uid, if available. None is returned if there
-@@ -992,9 +1008,17 @@ def setup_locale(override_codecs=True, override_time=False):
+@@ -992,9 +1011,17 @@ def setup_locale(override_codecs=True, override_time=False):
          locale.setlocale(locale.LC_ALL, 'C')
          
      if override_codecs:
@@ -156245,7 +156360,7 @@ index 2f6ddfe..59aff5d 100644
  
  
  def get_my_lang_code():
-@@ -1105,17 +1129,26 @@ def decompress(filename, dest=None, fn_only=False, check_timestamps=False):
+@@ -1105,17 +1132,28 @@ def decompress(filename, dest=None, fn_only=False, check_timestamps=False):
              out = filename.replace('.xz', '')
          
      else:
@@ -156262,7 +156377,9 @@ index 2f6ddfe..59aff5d 100644
 +        fi = stat_f(filename)
 +        fo = stat_f(out)
 +        if fi and fo:
-+            if fo.st_mtime == fi.st_mtime:
++            # Eliminate sub second precision in mtime before comparision,
++            # see http://bugs.python.org/issue14127
++            if int(fo.st_mtime) == int(fi.st_mtime):
                  return out
 +            if fn_only:
 +                # out exists but not valid
@@ -156302,10 +156419,29 @@ index 4af563a..47832fc 100644
          self.obsoletes = {} #obs[obsoletename] = [pkg1, pkg2, pkg3] 
                   #the package lists are packages that obsolete the key name
 diff --git a/yum/packages.py b/yum/packages.py
-index 5ef9951..da31971 100644
+index 5ef9951..f67169f 100644
 --- a/yum/packages.py
 +++ b/yum/packages.py
-@@ -243,34 +243,87 @@ class PackageObject(object):
+@@ -106,14 +106,16 @@ def buildPkgRefDict(pkgs, casematch=True):
+     return pkgdict
+        
+ def parsePackages(pkgs, usercommands, casematch=0,
+-                  unique='repo-epoch-name-version-release-arch'):
++                  unique='repo-epoch-name-version-release-arch',
++                  pkgdict=None):
+     """matches up the user request versus a pkg list:
+        for installs/updates available pkgs should be the 'others list' 
+        for removes it should be the installed list of pkgs
+        takes an optional casematch option to determine if case should be matched
+        exactly. Defaults to not matching."""
+ 
+-    pkgdict = buildPkgRefDict(pkgs, bool(casematch))
++    if pkgdict is None:
++        pkgdict = buildPkgRefDict(pkgs, bool(casematch))
+     exactmatch = []
+     matched = []
+     unmatched = []
+@@ -243,34 +245,87 @@ class PackageObject(object):
          
      def _ui_envra(self):
          if self.epoch == '0':
@@ -156413,7 +156549,7 @@ index 5ef9951..da31971 100644
      def __str__(self):
          return self.ui_envra
  
-@@ -481,15 +534,14 @@ class RpmBase(object):
+@@ -481,15 +536,14 @@ class RpmBase(object):
              if prcotuple in self._prco_lookup[prcotype]:
                  return 1
  
@@ -156437,7 +156573,7 @@ index 5ef9951..da31971 100644
  
          return 0
  
-@@ -611,15 +663,18 @@ class RpmBase(object):
+@@ -611,15 +665,18 @@ class RpmBase(object):
      dirlist = property(fget=lambda self: self.returnFileEntries(ftype='dir'))
      ghostlist = property(fget=lambda self: self.returnFileEntries(ftype='ghost'))
      requires = property(fget=lambda self: self.returnPrco('requires'))
@@ -156456,7 +156592,7 @@ index 5ef9951..da31971 100644
      conflicts_print = property(fget=lambda self: self.returnPrco('conflicts', True))
      obsoletes_print = property(fget=lambda self: self.returnPrco('obsoletes', True))
      changelog = property(fget=lambda self: self.returnChangelog())
-@@ -1083,7 +1138,7 @@ class YumAvailablePackage(PackageObject, RpmBase):
+@@ -1083,7 +1140,7 @@ class YumAvailablePackage(PackageObject, RpmBase):
           misc.to_unicode(misc.to_xml(self.summary)), 
           misc.to_unicode(misc.to_xml(self.description)), 
           packager, url, self.filetime, 
@@ -156465,7 +156601,7 @@ index 5ef9951..da31971 100644
          
          msg += self._return_remote_location()
          return msg
-@@ -1133,7 +1188,7 @@ class YumAvailablePackage(PackageObject, RpmBase):
+@@ -1133,7 +1190,7 @@ class YumAvailablePackage(PackageObject, RpmBase):
          msg = ""
          mylist = getattr(self, pcotype)
          if mylist: msg = "\n    <rpm:%s>\n" % pcotype
@@ -156474,7 +156610,7 @@ index 5ef9951..da31971 100644
              pcostring = '''      <rpm:entry name="%s"''' % misc.to_xml(name, attrib=True)
              if flags:
                  pcostring += ''' flags="%s"''' % misc.to_xml(flags, attrib=True)
-@@ -1161,11 +1216,11 @@ class YumAvailablePackage(PackageObject, RpmBase):
+@@ -1161,11 +1218,11 @@ class YumAvailablePackage(PackageObject, RpmBase):
              dirs = self.returnFileEntries('dir', primary_only=True)
              ghosts = self.returnFileEntries('ghost', primary_only=True)
                  
@@ -156489,7 +156625,7 @@ index 5ef9951..da31971 100644
              msg += """    <file type="ghost">%s</file>\n""" % misc.to_xml(fn)
          
          return msg
-@@ -1194,8 +1249,8 @@ class YumAvailablePackage(PackageObject, RpmBase):
+@@ -1194,8 +1251,8 @@ class YumAvailablePackage(PackageObject, RpmBase):
                          continue
                      newlist.append(i)
                  mylist = newlist
@@ -156500,7 +156636,7 @@ index 5ef9951..da31971 100644
              if name.startswith('rpmlib('):
                  continue
              # this drops out requires that the pkg provides for itself.
-@@ -1217,13 +1272,16 @@ class YumAvailablePackage(PackageObject, RpmBase):
+@@ -1217,13 +1274,16 @@ class YumAvailablePackage(PackageObject, RpmBase):
                      prcostring += ''' ver="%s"''' % misc.to_xml(v, attrib=True)
                  if r:
                      prcostring += ''' rel="%s"''' % misc.to_xml(r, attrib=True)
@@ -156519,7 +156655,7 @@ index 5ef9951..da31971 100644
          return msg
  
      def _dump_changelog(self, clog_limit):
-@@ -1272,6 +1330,13 @@ class YumAvailablePackage(PackageObject, RpmBase):
+@@ -1272,6 +1332,13 @@ class YumAvailablePackage(PackageObject, RpmBase):
          return misc.to_utf8(msg)
  
  
@@ -156533,7 +156669,7 @@ index 5ef9951..da31971 100644
  
  #  This is a tweak on YumAvailablePackage() and is a base class for packages
  # which are actual rpms.
-@@ -1299,7 +1364,8 @@ class YumHeaderPackage(YumAvailablePackage):
+@@ -1299,7 +1366,8 @@ class YumHeaderPackage(YumAvailablePackage):
          self.pkgid = self.hdr[rpm.RPMTAG_SHA1HEADER]
          if not self.pkgid:
              self.pkgid = "%s.%s" %(self.hdr['name'], self.hdr['buildtime'])
@@ -156543,7 +156679,7 @@ index 5ef9951..da31971 100644
          self.__mode_cache = {}
          self.__prcoPopulated = False
  
-@@ -1353,6 +1419,12 @@ class YumHeaderPackage(YumAvailablePackage):
+@@ -1353,6 +1421,12 @@ class YumHeaderPackage(YumAvailablePackage):
                  continue
  
              lst = hdr[getattr(rpm, 'RPMTAG_%sFLAGS' % tag)]
@@ -156556,7 +156692,7 @@ index 5ef9951..da31971 100644
              flag = map(rpmUtils.miscutils.flagToString, lst)
              flag = map(misc.share_data, flag)
  
-@@ -1363,6 +1435,10 @@ class YumHeaderPackage(YumAvailablePackage):
+@@ -1363,6 +1437,10 @@ class YumHeaderPackage(YumAvailablePackage):
  
              prcotype = tag2prco[tag]
              self.prco[prcotype] = map(misc.share_data, zip(name,flag,vers))
@@ -156567,7 +156703,7 @@ index 5ef9951..da31971 100644
      
      def tagByName(self, tag):
          warnings.warn("tagByName() will go away in a furture version of Yum.\n",
-@@ -1447,7 +1523,7 @@ class YumHeaderPackage(YumAvailablePackage):
+@@ -1447,7 +1525,7 @@ class YumHeaderPackage(YumAvailablePackage):
          raise NotImplementedError()
  
      def _size(self):
@@ -157162,7 +157298,7 @@ index bfc49b7..9ddcae6 100644
      b = parsever(b)
  
 diff --git a/yum/repos.py b/yum/repos.py
-index 3793bad..4b1d52e 100644
+index 3793bad..3cbbe25 100644
 --- a/yum/repos.py
 +++ b/yum/repos.py
 @@ -22,6 +22,7 @@ import misc
@@ -157173,7 +157309,7 @@ index 3793bad..4b1d52e 100644
  
  from weakref import proxy as weakref
  
-@@ -67,6 +68,38 @@ class RepoStorage:
+@@ -67,6 +68,40 @@ class RepoStorage:
          self._cache_enabled_repos = []
          self.quick_enable_disable = {}
  
@@ -157187,13 +157323,15 @@ index 3793bad..4b1d52e 100644
 +
 +        repos = []
 +        for repo in self.listEnabled():
++            if repo.cache:
++                continue
 +            if repo._async and repo._commonLoadRepoXML(repo):
 +                mdtypes = repo._mdpolicy2mdtypes()
 +                downloading = repo._commonRetrieveDataMD_list(mdtypes)
 +                repos.append((repo, downloading, [False]))
 +
 +        # with sizes first, then without sizes..
-+	for no_size in (False, True):
++        for no_size in (False, True):
 +            for repo, downloading, error in repos:
 +                def failfunc(obj, error=error):
 +                    error[0] = True
@@ -157212,7 +157350,7 @@ index 3793bad..4b1d52e 100644
      def doSetup(self, thisrepo = None):
          
          self.ayum.plugins.run('prereposetup')
-@@ -89,6 +122,7 @@ class RepoStorage:
+@@ -89,6 +124,7 @@ class RepoStorage:
                  self.disableRepo(repo.id)
                  
          self._setup = True
@@ -157220,7 +157358,7 @@ index 3793bad..4b1d52e 100644
          self.ayum.plugins.run('postreposetup')
          
      def __str__(self):
-@@ -223,8 +257,9 @@ class RepoStorage:
+@@ -223,8 +259,9 @@ class RepoStorage:
          
          self._cachedir = cachedir
          for repo in self.repos.values():
@@ -157232,13 +157370,15 @@ index 3793bad..4b1d52e 100644
  
  
      def setProgressBar(self, obj):
-@@ -288,6 +323,14 @@ class RepoStorage:
+@@ -288,6 +325,16 @@ class RepoStorage:
          else:
              data = [ mdtype ]
           
 +        if hasattr(urlgrabber.grabber, 'parallel_wait'):
 +            # download all metadata in parallel
 +            for repo in myrepos:
++                if repo.cache:
++                    continue
 +                if repo._async:
 +                    sack = repo.getPackageSack()
 +                    sack._retrieve_async(repo, data)
@@ -157561,7 +157701,7 @@ index 2cb1acb..7da6a08 100644
          self._md[item] = val
  
 diff --git a/yum/yumRepo.py b/yum/yumRepo.py
-index e5e9ece..57a1a29 100644
+index e5e9ece..128795b 100644
 --- a/yum/yumRepo.py
 +++ b/yum/yumRepo.py
 @@ -20,10 +20,12 @@ import time
@@ -157766,6 +157906,15 @@ index e5e9ece..57a1a29 100644
                   'http_headers': tuple(self.__headersListFromDict(cache=cache)),
                   'ssl_verify_peer': self.sslverify,
                   'ssl_verify_host': self.sslverify,
+@@ -714,7 +793,7 @@ class YumRepository(Repository, config.RepoConf):
+             local = self.metalink_filename + '.tmp'
+             if not self._metalinkCurrent():
+                 url = misc.to_utf8(self.metalink)
+-                ugopts = self._default_grabopts()
++                ugopts = self._default_grabopts(cache=self.http_caching=='all')
+                 try:
+                     ug = URLGrabber(progress_obj = self.callback, **ugopts)
+                     result = ug.urlgrab(url, local, text=self.id + "/metalink")
 @@ -751,7 +830,7 @@ class YumRepository(Repository, config.RepoConf):
  
      def _getFile(self, url=None, relative=None, local=None, start=None, end=None,
@@ -160486,7 +160635,7 @@ index 4dcbea7..bc30bd4 100644
          return True
  
 diff --git a/yummain.py b/yummain.py
-index 9f79f4f..e3a232b 100755
+index 9f79f4f..648cf86 100755
 --- a/yummain.py
 +++ b/yummain.py
 @@ -29,13 +29,13 @@ from yum import Errors
@@ -160548,29 +160697,30 @@ index 9f79f4f..e3a232b 100755
      lockerr = ""
      while True:
          try:
-@@ -120,16 +126,16 @@ def main(args):
+@@ -120,16 +126,14 @@ def main(args):
              if exception2msg(e) != lockerr:
                  lockerr = exception2msg(e)
                  logger.critical(lockerr)
 -            if (e.errno not in (errno.EPERM, errno.EACCES) and
 -                not base.conf.exit_on_lock):
+-                logger.critical(_("Another app is currently holding the yum lock; waiting for it to exit..."))
+-                tm = 0.1
+-                if show_lock_owner(e.pid, logger):
+-                    tm = 2
+-                time.sleep(tm)
+-            elif e.errno in (errno.EPERM, errno.EACCES):
 +            if e.errno in (errno.EPERM, errno.EACCES, errno.ENOSPC):
-+                logger.critical(_("Can't create lock file; exiting"))
-+                return 1
+                 logger.critical(_("Can't create lock file; exiting"))
+                 return 1
 +
 +            if not base.conf.exit_on_lock:
-                 logger.critical(_("Another app is currently holding the yum lock; waiting for it to exit..."))
-                 tm = 0.1
-                 if show_lock_owner(e.pid, logger):
-                     tm = 2
-                 time.sleep(tm)
--            elif e.errno in (errno.EPERM, errno.EACCES):
--                logger.critical(_("Can't create lock file; exiting"))
--                return 1
++                logger.critical(_("Another app is currently holding the yum lock; waiting for it to exit..."))
++                show_lock_owner(e.pid, logger)
++                time.sleep(2)
              else:
                  logger.critical(_("Another app is currently holding the yum lock; exiting as configured by exit_on_lock"))
                  return 1
-@@ -154,7 +160,7 @@ def main(args):
+@@ -154,7 +158,7 @@ def main(args):
          for msg in resultmsgs:
              verbose_logger.log(logginglevels.INFO_2, '%s', msg)
          if unlock(): return 200
@@ -160579,7 +160729,7 @@ index 9f79f4f..e3a232b 100755
      elif result == 1:
          # Fatal error
          for msg in resultmsgs:
-@@ -193,7 +199,7 @@ def main(args):
+@@ -193,7 +197,7 @@ def main(args):
      if result == 0:
          # Normal exit
          if unlock(): return 200
@@ -160588,7 +160738,7 @@ index 9f79f4f..e3a232b 100755
      elif result == 1:
          # Fatal error
          for msg in resultmsgs:
-@@ -238,16 +244,27 @@ def main(args):
+@@ -238,16 +242,27 @@ def main(args):
          rpmdb_warn_checks()
          return_code = result
          if base._ts_save_file:
@@ -160618,7 +160768,7 @@ index 9f79f4f..e3a232b 100755
      import hotshot.stats
      fn = os.path.expanduser("~/yum.prof")
      prof = hotshot.Profile(fn)
-@@ -257,6 +274,11 @@ def hotshot(func, *args, **kwargs):
+@@ -257,6 +272,11 @@ def hotshot(func, *args, **kwargs):
      return rc
  
  def cprof(func, *args, **kwargs):
@@ -160630,7 +160780,7 @@ index 9f79f4f..e3a232b 100755
      import cProfile, pstats
      fn = os.path.expanduser("~/yum.prof")
      prof = cProfile.Profile()
-@@ -266,6 +288,10 @@ def cprof(func, *args, **kwargs):
+@@ -266,6 +286,10 @@ def cprof(func, *args, **kwargs):
      return rc
  
  def print_stats(stats):
@@ -160641,7 +160791,7 @@ index 9f79f4f..e3a232b 100755
      stats.strip_dirs()
      stats.sort_stats('time', 'calls')
      stats.print_stats(20)
-@@ -273,7 +299,14 @@ def print_stats(stats):
+@@ -273,7 +297,14 @@ def print_stats(stats):
      stats.print_stats(40)
  
  def user_main(args, exit_code=False):
diff --git a/yum.spec b/yum.spec
index 9dfe3af..04f8f30 100644
--- a/yum.spec
+++ b/yum.spec
@@ -18,7 +18,7 @@
 Summary: RPM package installer/updater/manager
 Name: yum
 Version: 3.4.3
-Release: 27%{?dist}
+Release: 28%{?dist}
 License: GPLv2+
 Group: System Environment/Base
 Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz
@@ -313,6 +313,15 @@ exit 0
 %endif
 
 %changelog
+* Mon Jun 25 2012 Zdenek Pavlas <zpavlas at redhat.com> - 3.4.3-28
+- update to latest HEAD.
+- No async downloading when --cacheonly.  BZ 830523.
+- compare mtime without sub second precision. BZ 831918
+- show_lock_owner: report errors if we fail.  BZ 745281
+- quote uids to keep cachedir ascii-clean.  BZ 832195
+- A solution to the obsoletes but don't provide problem. BZ 834530
+- completion-helper: use the system cachedir
+
 * Fri Jun  8 2012 James Antill <james at fedoraproject.org> - 3.4.3-27
 - update to latest HEAD.
 - Fix for ppc64p7 detection.


More information about the scm-commits mailing list