[yum/f18] update to latest HEAD.

James Antill james at fedoraproject.org
Tue Oct 23 20:53:19 UTC 2012


commit 31cab97c3b6cf804dc726c138f591625e0c1bacd
Author: James Antill <james at and.org>
Date:   Tue Oct 23 16:52:56 2012 -0400

    update to latest HEAD.
    
    - Minor upstream fixes, mainly for ppc64p7.

 yum-HEAD.patch |  757 +++++++++++++++++++++++++++++++++++++++-----------------
 yum.spec       |   12 +-
 2 files changed, 540 insertions(+), 229 deletions(-)
---
diff --git a/yum-HEAD.patch b/yum-HEAD.patch
index a2b10b9..6aba05e 100644
--- a/yum-HEAD.patch
+++ b/yum-HEAD.patch
@@ -96,7 +96,7 @@ index 2f6154e..2e5a052 100644
 diff --git a/cli.py b/cli.py
 old mode 100644
 new mode 100755
-index 6056d38..cf2c369
+index 6056d38..4122d5d
 --- a/cli.py
 +++ b/cli.py
 @@ -25,7 +25,7 @@ import sys
@@ -1524,7 +1524,7 @@ index 6056d38..cf2c369
          if not args:
              (opts, cmds) = self.parse_args()
          else:
-@@ -1533,16 +2075,20 @@ class YumOptionParser(OptionParser):
+@@ -1533,16 +2075,22 @@ class YumOptionParser(OptionParser):
          try:
              # config file is parsed and moving us forward
              # set some things in it.
@@ -1535,13 +1535,16 @@ index 6056d38..cf2c369
              # Handle remaining options
              if opts.assumeyes:
 -                self.base.conf.assumeyes =1
-+                self.base.conf.assumeyes = 1
-+            if opts.assumeno:
-+                self.base.conf.assumeno  = 1
- 
+-
 -            #  Instead of going cache-only for a non-root user, try to use a
 -            # user writable cachedir. If that fails fall back to cache-only.
 -            if opts.cacheonly:
++                self.base.conf.assumeyes = 1
++            if opts.assumeno:
++                self.base.conf.assumeno  = 1
++            self.base.conf.downloadonly = opts.dlonly
++            self.base.conf.downloaddir = opts.dldir
++
 +            #  Treat users like root as much as possible:
 +            if not self.base.setCacheDir():
                  self.base.conf.cache = 1
@@ -1550,7 +1553,7 @@ index 6056d38..cf2c369
                  self.base.conf.cache = 1
  
              if opts.obsoletes:
-@@ -1610,10 +2156,6 @@ class YumOptionParser(OptionParser):
+@@ -1610,10 +2158,6 @@ class YumOptionParser(OptionParser):
                      self.base.usage()
                      sys.exit(1)
  
@@ -1561,7 +1564,7 @@ index 6056d38..cf2c369
              # Disable all gpg key checking, if requested.
              if opts.nogpgcheck:
                  #  Altering the normal configs. doesn't work too well, esp. with
-@@ -1640,10 +2182,18 @@ class YumOptionParser(OptionParser):
+@@ -1640,10 +2184,18 @@ class YumOptionParser(OptionParser):
          sys.exit(1)
  
      def getRoot(self,opts):
@@ -1581,7 +1584,7 @@ index 6056d38..cf2c369
              if os.access(opts.installroot+'/'+opts.conffile, os.R_OK):
                  opts.conffile = opts.installroot+'/'+opts.conffile
              elif opts.conffile == '/etc/yum/yum.conf':
-@@ -1701,6 +2251,9 @@ class YumOptionParser(OptionParser):
+@@ -1701,6 +2253,9 @@ class YumOptionParser(OptionParser):
          group.add_option("--showduplicates", dest="showdupesfromrepos",
                          action="store_true",
                  help=_("show duplicates, in repos, in list/search commands"))
@@ -1591,7 +1594,7 @@ index 6056d38..cf2c369
          group.add_option("-e", "--errorlevel", dest="errorlevel", default=None,
                  help=_("error output level"), type='int',
                  metavar='[error level]')
-@@ -1713,6 +2266,10 @@ class YumOptionParser(OptionParser):
+@@ -1713,6 +2268,10 @@ class YumOptionParser(OptionParser):
                          help=_("verbose operation"))
          group.add_option("-y", "--assumeyes", dest="assumeyes",
                  action="store_true", help=_("answer yes for all questions"))
@@ -1602,6 +1605,17 @@ index 6056d38..cf2c369
          group.add_option("--version", action="store_true", 
                  help=_("show Yum version and exit"))
          group.add_option("--installroot", help=_("set install root"), 
+@@ -1748,6 +2307,10 @@ class YumOptionParser(OptionParser):
+                 help=_("control whether color is used"))
+         group.add_option("", "--releasever", dest="releasever", default=None, 
+                 help=_("set value of $releasever in yum config and repo files"))
++        group.add_option("--downloadonly", dest="dlonly", action="store_true",
++                help=_("don't update, just download"))
++        group.add_option("--downloaddir", dest="dldir", default=None,
++                help=_("specifies an alternate directory to store packages"))
+         group.add_option("", "--setopt", dest="setopts", default=[],
+                 action="append", help=_("set arbitrary config and repo options"))
+ 
 diff --git a/completion-helper.py b/completion-helper.py
 new file mode 100755
 index 0000000..05801d1
@@ -2297,7 +2311,7 @@ index 0000000..d2a0ed1
 +if __name__ == "__main__":
 +    generateAll(os.getcwd(), os.getcwd())
 diff --git a/docs/yum.8 b/docs/yum.8
-index 1a8202a..dab01f6 100644
+index 1a8202a..65ff448 100644
 --- a/docs/yum.8
 +++ b/docs/yum.8
 @@ -52,6 +52,7 @@ gnome\-packagekit application\&.
@@ -2567,13 +2581,19 @@ index 1a8202a..dab01f6 100644
  options are: 'critical', 'emergency', 'error', 'warn' and 'debug'.
  .br
  Configuration Option: \fBrpmverbosity\fP
-@@ -506,7 +583,8 @@ option will corrupt your cache (and you can use $releasever in your cachedir
+@@ -506,7 +583,14 @@ option will corrupt your cache (and you can use $releasever in your cachedir
  configuration to stop this).
  .PP 
  .IP "\fB\-t, \-\-tolerant\fP"
 -This option currently does nothing.
 +This option makes yum go slower, checking for things that shouldn't be possible
 +making it more tolerant of external errors.
++.br
++.IP "\fB\-\-downloadonly\fP"
++Don't update, just download.
++.br
++.IP "\fB\-\-downloaddir=directory\fP"
++Specifies an alternate directory to store packages.
  .br
  .IP "\fB\-\-setopt=option=value\fP"
  Set any config option in yum config or repo files. For options in the global 
@@ -3153,7 +3173,7 @@ index c60fa08..0000000
 -ts run
 -exit
 diff --git a/etc/yum.bash b/etc/yum.bash
-index f1e06e8..b21c594 100644
+index f1e06e8..d484f8d 100644
 --- a/etc/yum.bash
 +++ b/etc/yum.bash
 @@ -1,53 +1,17 @@
@@ -3227,16 +3247,20 @@ index f1e06e8..b21c594 100644
      COMPREPLY+=( $( compgen -W '$( command grep -il "^\s*enabled\s*=\s*$val" \
          /etc/yum/pluginconf.d/*.conf 2>/dev/null \
          | sed -ne "s|^.*/\([^/]\{1,\}\)\.conf$|\1|p" )' -- "$2" ) )
-@@ -75,7 +39,7 @@ _yum_baseopts()
+@@ -75,9 +39,10 @@ _yum_baseopts()
  {
      local opts='--help --tolerant --cacheonly --config --randomwait
          --debuglevel --showduplicates --errorlevel --rpmverbosity --quiet
 -        --verbose --assumeyes --version --installroot --enablerepo
 +        --verbose --assumeyes --assumeno --version --installroot --enablerepo
          --disablerepo --exclude --disableexcludes --obsoletes --noplugins
-         --nogpgcheck --skip-broken --color --releasever --setopt'
+-        --nogpgcheck --skip-broken --color --releasever --setopt'
++        --nogpgcheck --skip-broken --color --releasever --setopt --downloadonly
++        --downloaddir'
      [[ $COMP_LINE == *--noplugins* ]] || \
-@@ -89,6 +53,16 @@ _yum_transactions()
+         opts+=" --disableplugin --enableplugin"
+     printf %s "$opts"
+@@ -89,6 +54,16 @@ _yum_transactions()
          sed -ne 's/^[[:space:]]*\([0-9]\{1,\}\).*/\1/p' )" -- "$cur" ) )
  }
  
@@ -3253,7 +3277,7 @@ index f1e06e8..b21c594 100644
  # arguments:
  #   1 = current word to be completed
  #   2 = previous word
-@@ -119,17 +93,17 @@ _yum_complete_baseopts()
+@@ -119,17 +94,17 @@ _yum_complete_baseopts()
              ;;
  
          --enablerepo)
@@ -3274,7 +3298,7 @@ index f1e06e8..b21c594 100644
              COMPREPLY=( $( compgen -W '${COMPREPLY[@]} all main' -- "$1" ) )
              return 0
              ;;
-@@ -183,16 +157,16 @@ _yum()
+@@ -183,16 +158,16 @@ _yum()
  
      # Commands offered as completions
      local cmds=( check check-update clean deplist distro-sync downgrade
@@ -3295,7 +3319,7 @@ index f1e06e8..b21c594 100644
              [[ ${words[i]} == $c ]] && cmd=$c && break
          done
      done
-@@ -205,13 +179,12 @@ _yum()
+@@ -205,13 +180,12 @@ _yum()
              return 0
              ;;
  
@@ -3311,7 +3335,7 @@ index f1e06e8..b21c594 100644
                  COMPREPLY=( $( compgen -W 'expire-cache packages headers
                      metadata cache dbcache all' -- "$cur" ) )
              return 0
-@@ -224,59 +197,83 @@ _yum()
+@@ -224,59 +198,83 @@ _yum()
              ;;
  
          distro-sync|distribution-synchronization)
@@ -3411,7 +3435,7 @@ index f1e06e8..b21c594 100644
                      ;;
              esac
              return 0
-@@ -288,42 +285,56 @@ _yum()
+@@ -288,42 +286,56 @@ _yum()
              ;;
  
          install)
@@ -3475,7 +3499,7 @@ index f1e06e8..b21c594 100644
                  COMPREPLY=( $( compgen -W 'all installed available nogroups
                      grouplist groupinfo' -- "$cur" ) )
              return 0
-@@ -337,7 +348,11 @@ _yum()
+@@ -337,7 +349,11 @@ _yum()
  
      $split && return 0
  
@@ -151105,10 +151129,10 @@ index 1ce4720..25e3022
      gobject.threads_init()
      dbus.glib.threads_init()
 diff --git a/yum.spec b/yum.spec
-index abd203f..65c62a9 100644
+index abd203f..4ad6804 100644
 --- a/yum.spec
 +++ b/yum.spec
-@@ -1,24 +1,51 @@
+@@ -1,24 +1,53 @@
 -Summary: RPM installer/updater
 +%define move_yum_conf_back 1
 +%define auto_sitelib 1
@@ -151162,11 +151186,13 @@ index abd203f..65c62a9 100644
  Requires: yum-metadata-parser >= 1.1.0
 -Requires: python-iniparse
  Requires: pygpgme
++# rawhide is >= 0.5.3-7.fc18 ... as this is added.
++Requires: pyliblzma
 +
  Conflicts: rpm >= 5-0
  # Zif is a re-implementation of yum in C, however:
  #
-@@ -34,18 +61,26 @@ Conflicts: rpm >= 5-0
+@@ -34,18 +63,28 @@ Conflicts: rpm >= 5-0
  # zif experts).
  #
  # ...so we have two sane choices: i) Conflict with it. 2) Stop developing yum.
@@ -151195,12 +151221,14 @@ index abd203f..65c62a9 100644
 +Provides: yum-protect-packages = 1.1.27-0.yum
 +Provides: yum-plugin-protect-packages = 1.1.27-0.yum
 +Obsoletes: yum-plugin-download-order <= 0.2-2
++Obsoletes: yum-plugin-downloadonly <= 1.1.31-6.fc19
++Provides: yum-plugin-downloadonly = 3.4.3-44.yum
 +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 +
  
  %description
  Yum is a utility that can check for and automatically download and
-@@ -58,9 +93,11 @@ Group: Applications/System
+@@ -58,9 +97,11 @@ Group: Applications/System
  Requires: yum = %{version}-%{release}
  Requires: dbus-python
  Requires: pygobject2
@@ -151214,7 +151242,7 @@ index abd203f..65c62a9 100644
  Requires(postun): /sbin/service
  
  
-@@ -83,18 +120,46 @@ Requires(postun): /sbin/service
+@@ -83,18 +124,46 @@ Requires(postun): /sbin/service
  These are the files needed to run yum updates as a cron job.
  Install this package if you want auto yum updates nightly via cron.
  
@@ -151263,7 +151291,7 @@ index abd203f..65c62a9 100644
  
  # Ghost files:
  mkdir -p $RPM_BUILD_ROOT/var/lib/yum/history
-@@ -102,12 +167,18 @@ mkdir -p $RPM_BUILD_ROOT/var/lib/yum/plugins
+@@ -102,12 +171,18 @@ 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
  
@@ -151282,7 +151310,7 @@ index abd203f..65c62a9 100644
  %post updatesd
  /sbin/chkconfig --add yum-updatesd
  /sbin/service yum-updatesd condrestart >/dev/null 2>&1
-@@ -119,6 +190,7 @@ if [ $1 = 0 ]; then
+@@ -119,6 +194,7 @@ if [ $1 = 0 ]; then
   /sbin/service yum-updatesd stop >/dev/null 2>&1
  fi
  exit 0
@@ -151290,7 +151318,7 @@ index abd203f..65c62a9 100644
  
  
  %post cron
-@@ -165,21 +237,30 @@ exit 0
+@@ -165,21 +241,30 @@ exit 0
  
  
  %files -f %{name}.lang
@@ -151326,7 +151354,7 @@ index abd203f..65c62a9 100644
  %dir /var/cache/yum
  %dir /var/lib/yum
  %ghost /var/lib/yum/uuid
-@@ -188,20 +269,24 @@ exit 0
+@@ -188,20 +273,24 @@ exit 0
  %ghost /var/lib/yum/yumdb
  %{_mandir}/man*/yum.*
  %{_mandir}/man*/yum-shell*
@@ -151358,7 +151386,7 @@ index abd203f..65c62a9 100644
  %files updatesd
  %defattr(-, root, root)
  %config(noreplace) %{_sysconfdir}/yum/yum-updatesd.conf
-@@ -210,8 +295,12 @@ exit 0
+@@ -210,8 +299,12 @@ exit 0
  %{_datadir}/yum-cli/yumupd.py*
  %{_sbindir}/yum-updatesd
  %{_mandir}/man*/yum-updatesd*
@@ -151399,10 +151427,18 @@ index c1af4ad..e3e3956 100644
      pass
      
 diff --git a/yum/__init__.py b/yum/__init__.py
-index 99039e0..a1b045f 100644
+index 99039e0..604ccce 100644
 --- a/yum/__init__.py
 +++ b/yum/__init__.py
-@@ -46,8 +46,13 @@ import operator
+@@ -21,6 +21,7 @@ The Yum RPM software updater.
+ import os
+ import os.path
+ import rpm
++import sys
+ 
+ def _rpm_ver_atleast(vertup):
+     """ Check if rpm is at least the current vertup. Can return False/True/None
+@@ -46,8 +47,13 @@ import operator
  import tempfile
  
  import yum.i18n
@@ -151418,7 +151454,7 @@ index 99039e0..a1b045f 100644
  
  import config
  from config import ParsingError, ConfigParser
-@@ -73,6 +78,7 @@ import logginglevels
+@@ -73,6 +79,7 @@ import logginglevels
  import yumRepo
  import callbacks
  import yum.history
@@ -151426,7 +151462,7 @@ index 99039e0..a1b045f 100644
  
  import warnings
  warnings.simplefilter("ignore", Errors.YumFutureDeprecationWarning)
-@@ -82,7 +88,7 @@ from packages import YumAvailablePackage, YumLocalPackage, YumInstalledPackage
+@@ -82,7 +89,7 @@ from packages import YumAvailablePackage, YumLocalPackage, YumInstalledPackage
  from packages import YumUrlPackage, YumNotFoundPackage
  from constants import *
  from yum.rpmtrans import RPMTransaction,SimpleCliCallBack
@@ -151435,7 +151471,7 @@ index 99039e0..a1b045f 100644
  
  import string
  import StringIO
-@@ -102,10 +108,12 @@ default_grabber.opts.user_agent += " yum/" + __version__
+@@ -102,10 +109,12 @@ default_grabber.opts.user_agent += " yum/" + __version__
  
  
  class _YumPreBaseConf:
@@ -151452,7 +151488,7 @@ index 99039e0..a1b045f 100644
      def __init__(self):
          self.fn = '/etc/yum/yum.conf'
          self.root = '/'
-@@ -125,12 +133,15 @@ class _YumPreBaseConf:
+@@ -125,12 +134,15 @@ class _YumPreBaseConf:
  
  
  class _YumPreRepoConf:
@@ -151472,7 +151508,7 @@ index 99039e0..a1b045f 100644
          self.callback = None
          self.failure_callback = None
          self.interrupt_callback = None
-@@ -164,11 +175,11 @@ class _YumCostExclude:
+@@ -164,11 +176,11 @@ class _YumCostExclude:
          return False
  
  class YumBase(depsolve.Depsolve):
@@ -151489,7 +151525,7 @@ index 99039e0..a1b045f 100644
      def __init__(self):
          depsolve.Depsolve.__init__(self)
          self._conf = None
-@@ -177,6 +188,7 @@ class YumBase(depsolve.Depsolve):
+@@ -177,6 +189,7 @@ class YumBase(depsolve.Depsolve):
          self._up = None
          self._comps = None
          self._history = None
@@ -151497,7 +151533,7 @@ index 99039e0..a1b045f 100644
          self._pkgSack = None
          self._lockfile = None
          self._tags = None
-@@ -204,6 +216,7 @@ class YumBase(depsolve.Depsolve):
+@@ -204,6 +217,7 @@ class YumBase(depsolve.Depsolve):
  
          self.run_with_package_names = set()
          self._cleanup = []
@@ -151505,7 +151541,7 @@ index 99039e0..a1b045f 100644
  
      def __del__(self):
          self.close()
-@@ -213,10 +226,15 @@ class YumBase(depsolve.Depsolve):
+@@ -213,10 +227,15 @@ class YumBase(depsolve.Depsolve):
          for cb in self._cleanup: cb()
  
      def close(self):
@@ -151521,7 +151557,7 @@ index 99039e0..a1b045f 100644
          if self._repos:
              self._repos.close()
  
-@@ -225,15 +243,33 @@ class YumBase(depsolve.Depsolve):
+@@ -225,15 +244,33 @@ class YumBase(depsolve.Depsolve):
          return transactioninfo.TransactionData()
  
      def doGenericSetup(self, cache=0):
@@ -151557,7 +151593,7 @@ index 99039e0..a1b045f 100644
          warnings.warn(_('doConfigSetup() will go away in a future version of Yum.\n'),
                  Errors.YumFutureDeprecationWarning, stacklevel=2)
  
-@@ -297,15 +333,17 @@ class YumBase(depsolve.Depsolve):
+@@ -297,15 +334,17 @@ class YumBase(depsolve.Depsolve):
              # Try the old default
              fn = '/etc/yum.conf'
  
@@ -151578,7 +151614,7 @@ index 99039e0..a1b045f 100644
  
          if debuglevel != None:
              startupconf.debuglevel = debuglevel
-@@ -336,6 +374,12 @@ class YumBase(depsolve.Depsolve):
+@@ -336,6 +375,12 @@ class YumBase(depsolve.Depsolve):
  
          self._conf = config.readMainConfig(startupconf)
  
@@ -151591,7 +151627,7 @@ index 99039e0..a1b045f 100644
          #  We don't want people accessing/altering preconf after it becomes
          # worthless. So we delete it, and thus. it'll raise AttributeError
          del self.preconf
-@@ -367,22 +411,36 @@ class YumBase(depsolve.Depsolve):
+@@ -367,22 +412,36 @@ class YumBase(depsolve.Depsolve):
      def doLoggingSetup(self, debuglevel, errorlevel,
                         syslog_ident=None, syslog_facility=None,
                         syslog_device='/dev/log'):
@@ -151635,7 +151671,7 @@ index 99039e0..a1b045f 100644
          if repo_age is None:
              repo_age = os.stat(repofn)[8]
          
-@@ -391,8 +449,7 @@ class YumBase(depsolve.Depsolve):
+@@ -391,8 +450,7 @@ class YumBase(depsolve.Depsolve):
          try:
              parser.readfp(confpp_obj)
          except ParsingError, e:
@@ -151645,7 +151681,7 @@ index 99039e0..a1b045f 100644
  
          # Check sections in the .repo file that was just slurped up
          for section in parser.sections():
-@@ -429,7 +486,15 @@ class YumBase(depsolve.Depsolve):
+@@ -429,7 +487,15 @@ class YumBase(depsolve.Depsolve):
  
                  thisrepo.base_persistdir = self.conf._repos_persistdir
  
@@ -151662,7 +151698,7 @@ index 99039e0..a1b045f 100644
              if thisrepo.id in self.repo_setopts:
                  for opt in self.repo_setopts[thisrepo.id].items:
                      if not hasattr(thisrepo, opt):
-@@ -440,6 +505,20 @@ class YumBase(depsolve.Depsolve):
+@@ -440,6 +506,20 @@ class YumBase(depsolve.Depsolve):
              if validate and not validate(thisrepo):
                  continue
                      
@@ -151683,7 +151719,7 @@ index 99039e0..a1b045f 100644
              # Got our list of repo objects, add them to the repos
              # collection
              try:
-@@ -448,8 +527,11 @@ class YumBase(depsolve.Depsolve):
+@@ -448,8 +528,11 @@ class YumBase(depsolve.Depsolve):
                  self.logger.warning(e)
          
      def getReposFromConfig(self):
@@ -151697,7 +151733,7 @@ index 99039e0..a1b045f 100644
          # Read .repo files from directories specified by the reposdir option
          # (typically /etc/yum/repos.d)
          repo_config_age = self.conf.config_file_age
-@@ -466,18 +548,22 @@ class YumBase(depsolve.Depsolve):
+@@ -466,18 +549,22 @@ class YumBase(depsolve.Depsolve):
  
              if os.path.isdir(reposdir):
                  for repofn in sorted(glob.glob('%s/*.repo' % reposdir)):
@@ -151725,7 +151761,7 @@ index 99039e0..a1b045f 100644
          repo = yumRepo.YumRepository(section)
          try:
              repo.populate(parser, section, self.conf)
-@@ -493,38 +579,40 @@ class YumBase(depsolve.Depsolve):
+@@ -493,38 +580,40 @@ class YumBase(depsolve.Depsolve):
          repo.name = to_unicode(repo.name)
  
          # Set attributes not from the config file
@@ -151788,7 +151824,7 @@ index 99039e0..a1b045f 100644
          if isinstance(self.plugins, plugins.YumPlugins):
              raise RuntimeError(_("plugins already initialised"))
  
-@@ -533,6 +621,8 @@ class YumBase(depsolve.Depsolve):
+@@ -533,6 +622,8 @@ class YumBase(depsolve.Depsolve):
  
      
      def doRpmDBSetup(self):
@@ -151797,7 +151833,7 @@ index 99039e0..a1b045f 100644
          warnings.warn(_('doRpmDBSetup() will go away in a future version of Yum.\n'),
                  Errors.YumFutureDeprecationWarning, stacklevel=2)
  
-@@ -552,7 +642,8 @@ class YumBase(depsolve.Depsolve):
+@@ -552,7 +643,8 @@ class YumBase(depsolve.Depsolve):
          return self._rpmdb
  
      def closeRpmDB(self):
@@ -151807,7 +151843,7 @@ index 99039e0..a1b045f 100644
          if self._rpmdb is not None:
              self._rpmdb.ts = None
              self._rpmdb.dropCachedData()
-@@ -567,6 +658,12 @@ class YumBase(depsolve.Depsolve):
+@@ -567,6 +659,12 @@ class YumBase(depsolve.Depsolve):
          self._ts = None
  
      def doRepoSetup(self, thisrepo=None):
@@ -151820,7 +151856,7 @@ index 99039e0..a1b045f 100644
          warnings.warn(_('doRepoSetup() will go away in a future version of Yum.\n'),
                  Errors.YumFutureDeprecationWarning, stacklevel=2)
  
-@@ -588,7 +685,8 @@ class YumBase(depsolve.Depsolve):
+@@ -588,7 +686,8 @@ class YumBase(depsolve.Depsolve):
              prerepoconf = self.prerepoconf
              del self.prerepoconf
  
@@ -151830,7 +151866,7 @@ index 99039e0..a1b045f 100644
              self.repos.callback = prerepoconf.callback
              self.repos.setFailureCallback(prerepoconf.failure_callback)
              self.repos.setInterruptCallback(prerepoconf.interrupt_callback)
-@@ -630,6 +728,14 @@ class YumBase(depsolve.Depsolve):
+@@ -630,6 +729,14 @@ class YumBase(depsolve.Depsolve):
          self._repos = RepoStorage(self)
      
      def doSackSetup(self, archlist=None, thisrepo=None):
@@ -151845,7 +151881,7 @@ index 99039e0..a1b045f 100644
          warnings.warn(_('doSackSetup() will go away in a future version of Yum.\n'),
                  Errors.YumFutureDeprecationWarning, stacklevel=2)
  
-@@ -711,6 +817,9 @@ class YumBase(depsolve.Depsolve):
+@@ -711,6 +818,9 @@ class YumBase(depsolve.Depsolve):
              
             
      def doUpdateSetup(self):
@@ -151855,7 +151891,7 @@ index 99039e0..a1b045f 100644
          warnings.warn(_('doUpdateSetup() will go away in a future version of Yum.\n'),
                  Errors.YumFutureDeprecationWarning, stacklevel=2)
  
-@@ -765,6 +874,8 @@ class YumBase(depsolve.Depsolve):
+@@ -765,6 +875,8 @@ class YumBase(depsolve.Depsolve):
          return self._up
      
      def doGroupSetup(self):
@@ -151864,7 +151900,7 @@ index 99039e0..a1b045f 100644
          warnings.warn(_('doGroupSetup() will go away in a future version of Yum.\n'),
                  Errors.YumFutureDeprecationWarning, stacklevel=2)
  
-@@ -820,16 +931,10 @@ class YumBase(depsolve.Depsolve):
+@@ -820,16 +932,14 @@ class YumBase(depsolve.Depsolve):
              self.verbose_logger.log(logginglevels.DEBUG_4,
                  _('Adding group file from repository: %s'), repo)
              groupfile = repo.getGroups()
@@ -151874,6 +151910,10 @@ index 99039e0..a1b045f 100644
 -                                                     cached=repo.cache)
 -                # Do we want a RepoError here?
 -                
++            if not groupfile:
++                msg = _('Failed to retrieve group file for repository: %s') % repo
++                self.logger.critical(msg)
++                continue
              try:
                  self._comps.add(groupfile)
              except (Errors.GroupsError,Errors.CompsException), e:
@@ -151882,7 +151922,7 @@ index 99039e0..a1b045f 100644
                  self.logger.critical(msg)
              else:
                  repo.groups_added = True
-@@ -837,7 +942,10 @@ class YumBase(depsolve.Depsolve):
+@@ -837,7 +947,10 @@ class YumBase(depsolve.Depsolve):
          if self._comps.compscount == 0:
              raise Errors.GroupsError, _('No Groups Available in any repository')
  
@@ -151894,7 +151934,7 @@ index 99039e0..a1b045f 100644
          self.verbose_logger.debug('group time: %0.3f' % (time.time() - group_st))                
          return self._comps
  
-@@ -868,7 +976,7 @@ class YumBase(depsolve.Depsolve):
+@@ -868,7 +981,7 @@ class YumBase(depsolve.Depsolve):
                      # feed it into _tags.add()
                      self._tags.add(repo.id, tag_sqlite)
                  except (Errors.RepoError, Errors.PkgTagsError), e:
@@ -151903,7 +151943,7 @@ index 99039e0..a1b045f 100644
                      self.logger.critical(msg)
                      
                  
-@@ -881,9 +989,18 @@ class YumBase(depsolve.Depsolve):
+@@ -881,9 +994,18 @@ class YumBase(depsolve.Depsolve):
          if self._history is None:
              pdb_path = self.conf.persistdir + "/history"
              self._history = yum.history.YumHistory(root=self.conf.installroot,
@@ -151923,7 +151963,7 @@ index 99039e0..a1b045f 100644
      # properties so they auto-create themselves with defaults
      repos = property(fget=lambda self: self._getRepos(),
                       fset=lambda self, value: setattr(self, "_repos", value),
-@@ -921,6 +1038,11 @@ class YumBase(depsolve.Depsolve):
+@@ -921,6 +1043,11 @@ class YumBase(depsolve.Depsolve):
                         fdel=lambda self: setattr(self, "_history", None),
                         doc="Yum History Object")
  
@@ -151935,7 +151975,7 @@ index 99039e0..a1b045f 100644
      pkgtags = property(fget=lambda self: self._getTags(),
                         fset=lambda self, value: setattr(self, "_tags",value),
                         fdel=lambda self: setattr(self, "_tags", None),
-@@ -928,9 +1050,10 @@ class YumBase(depsolve.Depsolve):
+@@ -928,9 +1055,10 @@ class YumBase(depsolve.Depsolve):
      
      
      def doSackFilelistPopulate(self):
@@ -151949,7 +151989,7 @@ index 99039e0..a1b045f 100644
          necessary = False
          
          # I can't think of a nice way of doing this, we have to have the sack here
-@@ -951,8 +1074,12 @@ class YumBase(depsolve.Depsolve):
+@@ -951,8 +1079,12 @@ class YumBase(depsolve.Depsolve):
              self.repos.populateSack(mdtype='filelists')
             
      def yumUtilsMsg(self, func, prog):
@@ -151964,7 +152004,7 @@ index 99039e0..a1b045f 100644
          if self.rpmdb.contains(name="yum-utils"):
              return
  
-@@ -964,8 +1091,17 @@ class YumBase(depsolve.Depsolve):
+@@ -964,8 +1096,17 @@ class YumBase(depsolve.Depsolve):
               (hibeg, prog, hiend))
  
      def buildTransaction(self, unfinished_transactions_check=True):
@@ -151984,7 +152024,7 @@ index 99039e0..a1b045f 100644
          if (unfinished_transactions_check and
              misc.find_unfinished_transactions(yumlibpath=self.conf.persistdir)):
              msg = _('There are unfinished transactions remaining. You might ' \
-@@ -1004,7 +1140,7 @@ class YumBase(depsolve.Depsolve):
+@@ -1004,7 +1145,7 @@ class YumBase(depsolve.Depsolve):
              # If transaction was changed by postresolve plugins then we should run skipbroken again
              (rescode, restring) = self._doSkipBroken(rescode, restring, clear_skipped=False )
  
@@ -151993,7 +152033,7 @@ index 99039e0..a1b045f 100644
              self.tsInfo.pkgSack.dropCachedData()
  
          # FIXME: This is horrible, see below and yummain. Maybe create a real
-@@ -1044,6 +1180,37 @@ class YumBase(depsolve.Depsolve):
+@@ -1044,6 +1185,39 @@ class YumBase(depsolve.Depsolve):
                  if first.verEQ(other):
                      continue
                  msg = _('Protected multilib versions: %s != %s')
@@ -152003,14 +152043,16 @@ index 99039e0..a1b045f 100644
 +                    bigmsg = _("""\
 + Multilib version problems found. This often means that the root
 +cause is something else and multilib version checking is just
-+pointing it that there is a problem. Eg.:
++pointing out that there is a problem. Eg.:
 +
 +  1. You have an upgrade for %(name)s which is missing some
 +     dependency that another package requires. Yum is trying to
 +     solve this by installing an older version of %(name)s of the
 +     different architecture. If you exclude the bad architecture
 +     yum will tell you what the root cause is (which package
-+     requires what).
++     requires what). You can try redoing the upgrade with
++     --exclude %(name)s.otherarch ... this should give you an error
++     message showing the root cause of the problem.
 +
 +  2. You have multiple architectures of %(name)s installed, but
 +     yum can only see an upgrade for one of those arcitectures.
@@ -152031,7 +152073,7 @@ index 99039e0..a1b045f 100644
                  xrestring.append(msg % (first, other))
          if xrestring:
              rescode = 1
-@@ -1242,13 +1409,15 @@ class YumBase(depsolve.Depsolve):
+@@ -1242,13 +1416,15 @@ class YumBase(depsolve.Depsolve):
          if None in pkgtup:
              return None
          return pkgtup
@@ -152051,7 +152093,7 @@ index 99039e0..a1b045f 100644
          if pkgtup is None:
              return
          self._not_found_i[pkgtup] = YumNotFoundPackage(pkgtup)
-@@ -1454,8 +1623,14 @@ class YumBase(depsolve.Depsolve):
+@@ -1454,8 +1630,14 @@ class YumBase(depsolve.Depsolve):
          return probs
  
      def runTransaction(self, cb):
@@ -152067,7 +152109,7 @@ index 99039e0..a1b045f 100644
          self.plugins.run('pretrans')
  
          #  We may want to put this other places, eventually, but for now it's
-@@ -1516,10 +1691,23 @@ class YumBase(depsolve.Depsolve):
+@@ -1516,10 +1698,23 @@ class YumBase(depsolve.Depsolve):
                  pass
          self._ts_save_file = None
          
@@ -152091,7 +152133,7 @@ index 99039e0..a1b045f 100644
          
          # make resultobject - just a plain yumgenericholder object
          resultobject = misc.GenericHolder()
-@@ -1567,13 +1755,24 @@ class YumBase(depsolve.Depsolve):
+@@ -1567,13 +1762,24 @@ class YumBase(depsolve.Depsolve):
          self.plugins.run('posttrans')
          # sync up what just happened versus what is in the rpmdb
          if not self.ts.isTsFlagSet(rpm.RPMTRANS_FLAG_TEST):
@@ -152121,7 +152163,7 @@ index 99039e0..a1b045f 100644
          # check to see that the rpmdb and the tsInfo roughly matches
          # push package object metadata outside of rpmdb into yumdb
          # delete old yumdb metadata entries
-@@ -1584,9 +1783,16 @@ class YumBase(depsolve.Depsolve):
+@@ -1584,9 +1790,16 @@ class YumBase(depsolve.Depsolve):
          #    that there is not also an install of this pkg in the tsInfo (reinstall)
          # for any kind of install add from_repo to the yumdb, and the cmdline
          # and the install reason
@@ -152138,7 +152180,7 @@ index 99039e0..a1b045f 100644
          for txmbr in self.tsInfo:
              if txmbr.output_state in TS_INSTALL_STATES:
                  if not self.rpmdb.contains(po=txmbr.po):
-@@ -1596,7 +1802,9 @@ class YumBase(depsolve.Depsolve):
+@@ -1596,7 +1809,9 @@ class YumBase(depsolve.Depsolve):
                                             ' but is not!' % txmbr.po))
                      # Note: Get Panu to do te.Failed() so we don't have to
                      txmbr.output_state = TS_FAILED
@@ -152148,7 +152190,7 @@ index 99039e0..a1b045f 100644
                  po = self.getInstalledPackageObject(txmbr.pkgtup)
                  rpo = txmbr.po
                  po.yumdb_info.from_repo = rpo.repoid
-@@ -1630,6 +1838,10 @@ class YumBase(depsolve.Depsolve):
+@@ -1630,6 +1845,10 @@ class YumBase(depsolve.Depsolve):
                      if md:
                          po.yumdb_info.from_repo_timestamp = str(md.timestamp)
  
@@ -152159,7 +152201,7 @@ index 99039e0..a1b045f 100644
                  loginuid = misc.getloginuid()
                  if txmbr.updates or txmbr.downgrades or txmbr.reinstall:
                      if txmbr.updates:
-@@ -1640,11 +1852,16 @@ class YumBase(depsolve.Depsolve):
+@@ -1640,11 +1859,16 @@ class YumBase(depsolve.Depsolve):
                          opo = po
                      if 'installed_by' in opo.yumdb_info:
                          po.yumdb_info.installed_by = opo.yumdb_info.installed_by
@@ -152176,7 +152218,7 @@ index 99039e0..a1b045f 100644
          # Remove old ones after installing new ones, so we can copy values.
          for txmbr in self.tsInfo:
              if txmbr.output_state in TS_INSTALL_STATES:
-@@ -1662,10 +1879,13 @@ class YumBase(depsolve.Depsolve):
+@@ -1662,10 +1886,13 @@ class YumBase(depsolve.Depsolve):
                                                 ' but is not!' % txmbr.po))
                          # Note: Get Panu to do te.Failed() so we don't have to
                          txmbr.output_state = TS_FAILED
@@ -152190,7 +152232,7 @@ index 99039e0..a1b045f 100644
                  self.verbose_logger.log(logginglevels.DEBUG_2, 'What is this? %s' % txmbr.po)
  
          self.plugins.run('postverifytrans')
-@@ -1680,10 +1900,11 @@ class YumBase(depsolve.Depsolve):
+@@ -1680,10 +1907,11 @@ class YumBase(depsolve.Depsolve):
          self.verbose_logger.debug('VerifyTransaction time: %0.3f' % (time.time() - vt_st))
  
      def costExcludePackages(self):
@@ -152206,7 +152248,7 @@ index 99039e0..a1b045f 100644
          # if all the repo.costs are equal then don't bother running things
          costs = {}
          for r in self.repos.listEnabled():
-@@ -1705,10 +1926,12 @@ class YumBase(depsolve.Depsolve):
+@@ -1705,10 +1933,12 @@ class YumBase(depsolve.Depsolve):
              done = True
  
      def excludePackages(self, repo=None):
@@ -152222,7 +152264,7 @@ index 99039e0..a1b045f 100644
          if "all" in self.conf.disable_excludes:
              return
          
-@@ -1735,9 +1958,11 @@ class YumBase(depsolve.Depsolve):
+@@ -1735,9 +1965,11 @@ class YumBase(depsolve.Depsolve):
              self.pkgSack.addPackageExcluder(repoid, exid,'exclude.match', match)
  
      def includePackages(self, repo):
@@ -152237,7 +152279,7 @@ index 99039e0..a1b045f 100644
          includelist = repo.getIncludePkgList()
          
          if len(includelist) == 0:
-@@ -1757,8 +1982,11 @@ class YumBase(depsolve.Depsolve):
+@@ -1757,8 +1989,11 @@ class YumBase(depsolve.Depsolve):
          self.pkgSack.addPackageExcluder(repo.id, exid, 'exclude.marked')
          
      def doLock(self, lockfile = YUM_PID_FILE):
@@ -152251,7 +152293,7 @@ index 99039e0..a1b045f 100644
          if self.conf.uid != 0:
              #  If we are a user, assume we are using the root cache ... so don't
              # bother locking.
-@@ -1774,38 +2002,26 @@ class YumBase(depsolve.Depsolve):
+@@ -1774,38 +2009,26 @@ class YumBase(depsolve.Depsolve):
          
          mypid=str(os.getpid())    
          while not self._lock(lockfile, mypid, 0644):
@@ -152305,7 +152347,7 @@ index 99039e0..a1b045f 100644
          # if we're not root then we don't lock - just return nicely
          #  Note that we can get here from __del__, so if we haven't created
          # YumBase.conf we don't want to do so here as creating stuff inside
-@@ -1830,31 +2046,69 @@ class YumBase(depsolve.Depsolve):
+@@ -1830,31 +2053,69 @@ class YumBase(depsolve.Depsolve):
          self._unlock(lockfile)
          self._lockfile = None
          
@@ -152385,7 +152427,7 @@ index 99039e0..a1b045f 100644
          failed = False
  
          if type(fo) is types.InstanceType:
-@@ -1894,9 +2148,16 @@ class YumBase(depsolve.Depsolve):
+@@ -1894,9 +2155,16 @@ class YumBase(depsolve.Depsolve):
          
          
      def verifyChecksum(self, fo, checksumType, csum):
@@ -152405,7 +152447,7 @@ index 99039e0..a1b045f 100644
          try:
              filesum = misc.checksum(checksumType, fo)
          except Errors.MiscError, e:
-@@ -1908,6 +2169,17 @@ class YumBase(depsolve.Depsolve):
+@@ -1908,6 +2176,17 @@ class YumBase(depsolve.Depsolve):
          return 0
  
      def downloadPkgs(self, pkglist, callback=None, callback_total=None):
@@ -152423,7 +152465,43 @@ index 99039e0..a1b045f 100644
          def mediasort(apo, bpo):
              # FIXME: we should probably also use the mediaid; else we
              # could conceivably ping-pong between different disc1's
-@@ -1979,8 +2251,9 @@ class YumBase(depsolve.Depsolve):
+@@ -1943,6 +2222,7 @@ class YumBase(depsolve.Depsolve):
+         self.history.close()
+ 
+         self.plugins.run('predownload', pkglist=pkglist)
++        downloadonly = getattr(self.conf, 'downloadonly', False)
+         repo_cached = False
+         remote_pkgs = []
+         remote_size = 0
+@@ -1961,6 +2241,14 @@ class YumBase(depsolve.Depsolve):
+                     self.verbose_logger.debug(_("using local copy of %s") %(po,))
+                     continue
+                         
++            if downloadonly:
++                # download to temp file
++                rpmfile = po.localpath
++                po.localpath += '.%d.tmp' % os.getpid()
++                try: os.rename(rpmfile, po.localpath)
++                except OSError: pass
++                po.basepath # prefetch now; fails when repos are closed
++
+             remote_pkgs.append(po)
+             remote_size += po.size
+             
+@@ -1969,7 +2257,11 @@ class YumBase(depsolve.Depsolve):
+             # way to save this, report the error and return
+             if (self.conf.cache or repo_cached) and errors:
+                 return errors
+-                
++        if downloadonly:
++            # close DBs, unlock
++            self.repos.close()
++            self.closeRpmDB()
++            self.doUnlock()
+ 
+         remote_pkgs.sort(mediasort)
+         #  This is kind of a hack and does nothing in non-Fedora versions,
+@@ -1979,8 +2271,9 @@ class YumBase(depsolve.Depsolve):
              urlgrabber.progress.text_meter_total_size(remote_size)
          beg_download = time.time()
          i = 0
@@ -152434,7 +152512,7 @@ index 99039e0..a1b045f 100644
          for po in remote_pkgs:
              #  Recheck if the file is there, works around a couple of weird
              # edge cases.
-@@ -1992,52 +2265,47 @@ class YumBase(depsolve.Depsolve):
+@@ -1992,67 +2285,94 @@ class YumBase(depsolve.Depsolve):
                      remote_size -= po.size
                      if hasattr(urlgrabber.progress, 'text_meter_total_size'):
                          urlgrabber.progress.text_meter_total_size(remote_size,
@@ -152513,7 +152591,32 @@ index 99039e0..a1b045f 100644
          if hasattr(urlgrabber.progress, 'text_meter_total_size'):
              urlgrabber.progress.text_meter_total_size(0)
          if callback_total is not None and not errors:
-@@ -2052,7 +2320,22 @@ class YumBase(depsolve.Depsolve):
+             callback_total(remote_pkgs, remote_size, beg_download)
+ 
+-        self.plugins.run('postdownload', pkglist=pkglist, errors=errors)
++        if downloadonly:
++            for po in remote_pkgs:
++                rpmfile = po.localpath.rsplit('.', 2)[0]
++                if po in errors:
++                    # we may throw away partial file here- but we don't lock,
++                    # so can't rename tempfile to rpmfile safely
++                    misc.unlink_f(po.localpath)
++                if po not in errors:
++                    # verifyPkg() didn't complain, so (potentially)
++                    # overwriting another copy should not be a problem
++                    os.rename(po.localpath, rpmfile)
++                po.localpath = rpmfile
++        else:
++            # XXX: Run unlocked?  Skip this for now..
++            self.plugins.run('postdownload', pkglist=pkglist, errors=errors)
+ 
+         # Close curl object after we've downloaded everything.
+         if hasattr(urlgrabber.grabber, 'reset_curl_obj'):
+             urlgrabber.grabber.reset_curl_obj()
+ 
++        if downloadonly and not errors: # caller handles errors
++            self.verbose_logger.info(_('exiting because --downloadonly specified'))
++            sys.exit(self.exit_code)
          return errors
  
      def verifyHeader(self, fo, po, raiseError):
@@ -152537,7 +152640,7 @@ index 99039e0..a1b045f 100644
          if type(fo) is types.InstanceType:
              fo = fo.filename
              
-@@ -2076,9 +2359,12 @@ class YumBase(depsolve.Depsolve):
+@@ -2076,9 +2396,12 @@ class YumBase(depsolve.Depsolve):
          return 1
          
      def downloadHeader(self, po):
@@ -152552,7 +152655,7 @@ index 99039e0..a1b045f 100644
          if hasattr(po, 'pkgtype') and po.pkgtype == 'local':
              return
                  
-@@ -2122,15 +2408,17 @@ class YumBase(depsolve.Depsolve):
+@@ -2122,15 +2445,17 @@ class YumBase(depsolve.Depsolve):
              return
  
      def sigCheckPkg(self, po):
@@ -152578,7 +152681,7 @@ index 99039e0..a1b045f 100644
          if self._override_sigchecks:
              check = False
              hasgpgkey = 0
-@@ -2181,6 +2469,9 @@ class YumBase(depsolve.Depsolve):
+@@ -2181,6 +2506,9 @@ class YumBase(depsolve.Depsolve):
          return result, msg
  
      def cleanUsedHeadersPackages(self):
@@ -152588,7 +152691,7 @@ index 99039e0..a1b045f 100644
          filelist = []
          for txmbr in self.tsInfo:
              if txmbr.po.state not in TS_INSTALL_STATES:
-@@ -2218,27 +2509,42 @@ class YumBase(depsolve.Depsolve):
+@@ -2218,27 +2546,42 @@ class YumBase(depsolve.Depsolve):
                      _('%s removed'), fn)
          
      def cleanHeaders(self):
@@ -152633,7 +152736,7 @@ index 99039e0..a1b045f 100644
          cachedir = self.conf.persistdir + "/rpmdb-indexes/"
          if not os.path.exists(cachedir):
              filelist = []
-@@ -2272,8 +2578,29 @@ class YumBase(depsolve.Depsolve):
+@@ -2272,8 +2615,29 @@ class YumBase(depsolve.Depsolve):
  
      def doPackageLists(self, pkgnarrow='all', patterns=None, showdups=None,
                         ignore_case=False):
@@ -152665,7 +152768,7 @@ index 99039e0..a1b045f 100644
          if showdups is None:
              showdups = self.conf.showdupesfromrepos
          ygh = misc.GenericHolder(iter=pkgnarrow)
-@@ -2323,10 +2650,22 @@ class YumBase(depsolve.Depsolve):
+@@ -2323,10 +2687,22 @@ class YumBase(depsolve.Depsolve):
                      key = (pkg.name, pkg.arch)
                      if pkg.pkgtup in dinst:
                          reinstall_available.append(pkg)
@@ -152691,7 +152794,7 @@ index 99039e0..a1b045f 100644
  
          # produce the updates list of tuples
          elif pkgnarrow == 'updates':
-@@ -2461,14 +2800,13 @@ class YumBase(depsolve.Depsolve):
+@@ -2461,14 +2837,13 @@ class YumBase(depsolve.Depsolve):
  
          
      def findDeps(self, pkgs):
@@ -152711,7 +152814,7 @@ index 99039e0..a1b045f 100644
          results = {}
  
          for pkg in pkgs:
-@@ -2495,10 +2833,22 @@ class YumBase(depsolve.Depsolve):
+@@ -2495,10 +2870,22 @@ class YumBase(depsolve.Depsolve):
      # pre 3.2.10 API used to always showdups, so that's the default atm.
      def searchGenerator(self, fields, criteria, showdups=True, keys=False, 
                                               searchtags=True, searchrpmdb=True):
@@ -152738,7 +152841,7 @@ index 99039e0..a1b045f 100644
          sql_fields = []
          for f in fields:
              sql_fields.append(RPM_TO_SQLITE.get(f, f))
-@@ -2661,6 +3011,14 @@ class YumBase(depsolve.Depsolve):
+@@ -2661,6 +3048,14 @@ class YumBase(depsolve.Depsolve):
                      yield (po, vs)
  
      def searchPackageTags(self, criteria):
@@ -152753,7 +152856,7 @@ index 99039e0..a1b045f 100644
          results = {} # name = [(criteria, taglist)]
          for c in criteria:
              c = c.lower()
-@@ -2677,11 +3035,16 @@ class YumBase(depsolve.Depsolve):
+@@ -2677,11 +3072,16 @@ class YumBase(depsolve.Depsolve):
          return results
          
      def searchPackages(self, fields, criteria, callback=None):
@@ -152775,7 +152878,7 @@ index 99039e0..a1b045f 100644
          warnings.warn(_('searchPackages() will go away in a future version of Yum.\
                        Use searchGenerator() instead. \n'),
                  Errors.YumFutureDeprecationWarning, stacklevel=2)           
-@@ -2700,13 +3063,23 @@ class YumBase(depsolve.Depsolve):
+@@ -2700,13 +3100,23 @@ class YumBase(depsolve.Depsolve):
      
      def searchPackageProvides(self, args, callback=None,
                                callback_has_matchfor=False):
@@ -152803,7 +152906,7 @@ index 99039e0..a1b045f 100644
              else:
                  isglob = True
                  canBeFile = misc.re_filename(arg)
-@@ -2723,7 +3096,7 @@ class YumBase(depsolve.Depsolve):
+@@ -2723,7 +3133,7 @@ class YumBase(depsolve.Depsolve):
                  where = self.returnPackagesByDep(arg)
              else:
                  usedDepString = False
@@ -152812,7 +152915,7 @@ index 99039e0..a1b045f 100644
              self.verbose_logger.log(logginglevels.DEBUG_1,
                 P_('Searching %d package', 'Searching %d packages', len(where)), len(where))
              
-@@ -2817,25 +3190,160 @@ class YumBase(depsolve.Depsolve):
+@@ -2817,25 +3227,160 @@ class YumBase(depsolve.Depsolve):
              
          return matches
  
@@ -152985,7 +153088,7 @@ index 99039e0..a1b045f 100644
                  if uservisible:
                      if grp.user_visible:
                          installed.append(grp)
-@@ -2847,34 +3355,98 @@ class YumBase(depsolve.Depsolve):
+@@ -2847,34 +3392,98 @@ class YumBase(depsolve.Depsolve):
                          available.append(grp)
                  else:
                      available.append(grp)
@@ -153094,7 +153197,7 @@ index 99039e0..a1b045f 100644
          thesegroups = self.comps.return_groups(grpid)
          if not thesegroups:
              raise Errors.GroupsError, _("No Group named %s exists") % to_unicode(grpid)
-@@ -2898,13 +3470,58 @@ class YumBase(depsolve.Depsolve):
+@@ -2898,13 +3507,58 @@ class YumBase(depsolve.Depsolve):
                              self.tsInfo.remove(txmbr.po.pkgtup)
          
          
@@ -153160,7 +153263,7 @@ index 99039e0..a1b045f 100644
          """
  
          if not self.comps.has_group(grpid):
-@@ -2920,6 +3537,9 @@ class YumBase(depsolve.Depsolve):
+@@ -2920,6 +3574,9 @@ class YumBase(depsolve.Depsolve):
          if group_package_types:
              package_types = group_package_types
  
@@ -153170,7 +153273,7 @@ index 99039e0..a1b045f 100644
          for thisgroup in thesegroups:
              if thisgroup.selected:
                  continue
-@@ -2934,12 +3554,49 @@ class YumBase(depsolve.Depsolve):
+@@ -2934,12 +3591,49 @@ class YumBase(depsolve.Depsolve):
              if 'optional' in package_types:
                  pkgs.extend(thisgroup.optional_packages)
  
@@ -153221,7 +153324,7 @@ index 99039e0..a1b045f 100644
                  except Errors.InstallError, e:
                      self.verbose_logger.debug(_('No package named %s available to be installed'),
                          pkg)
-@@ -2953,7 +3610,9 @@ class YumBase(depsolve.Depsolve):
+@@ -2953,7 +3647,9 @@ class YumBase(depsolve.Depsolve):
                  group_conditionals = enable_group_conditionals
  
              count_cond_test = 0
@@ -153232,7 +153335,7 @@ index 99039e0..a1b045f 100644
                  for condreq, cond in thisgroup.conditional_packages.iteritems():
                      if self.isPackageInstalled(cond):
                          try:
-@@ -2990,17 +3649,22 @@ class YumBase(depsolve.Depsolve):
+@@ -2990,17 +3686,22 @@ class YumBase(depsolve.Depsolve):
                          if cond not in self.tsInfo.conditionals:
                              self.tsInfo.conditionals[cond] = []
                          self.tsInfo.conditionals[cond].extend(pkgs)
@@ -153261,7 +153364,7 @@ index 99039e0..a1b045f 100644
          
          if not self.comps.has_group(grpid):
              raise Errors.GroupsError, _("No Group named %s exists") % to_unicode(grpid)
-@@ -3008,7 +3672,8 @@ class YumBase(depsolve.Depsolve):
+@@ -3008,7 +3709,8 @@ class YumBase(depsolve.Depsolve):
          thesegroups = self.comps.return_groups(grpid)
          if not thesegroups:
              raise Errors.GroupsError, _("No Group named %s exists") % to_unicode(grpid)
@@ -153271,7 +153374,7 @@ index 99039e0..a1b045f 100644
          for thisgroup in thesegroups:
              thisgroup.selected = False
              
-@@ -3034,13 +3699,102 @@ class YumBase(depsolve.Depsolve):
+@@ -3034,13 +3736,102 @@ class YumBase(depsolve.Depsolve):
                          for pkg in self.tsInfo.conditionals.get(txmbr.name, []):
                              self.tsInfo.remove(pkg.pkgtup)
          
@@ -153380,7 +153483,7 @@ index 99039e0..a1b045f 100644
          # look it up in the self.localPackages first:
          for po in self.localPackages:
              if po.pkgtup == pkgtup:
-@@ -3049,7 +3803,7 @@ class YumBase(depsolve.Depsolve):
+@@ -3049,7 +3840,7 @@ class YumBase(depsolve.Depsolve):
          pkgs = self.pkgSack.searchPkgTuple(pkgtup)
  
          if len(pkgs) == 0:
@@ -153389,7 +153492,7 @@ index 99039e0..a1b045f 100644
              if allow_missing: #  This can happen due to excludes after .up has
                  return None   # happened.
              raise Errors.DepError, _('Package tuple %s could not be found in packagesack') % str(pkgtup)
-@@ -3065,13 +3819,21 @@ class YumBase(depsolve.Depsolve):
+@@ -3065,13 +3856,21 @@ class YumBase(depsolve.Depsolve):
          return result
  
      def getInstalledPackageObject(self, pkgtup):
@@ -153416,7 +153519,7 @@ index 99039e0..a1b045f 100644
              raise Errors.RpmDBError, _('Package tuple %s could not be found in rpmdb') % str(pkgtup)
  
          # Dito. FIXME from getPackageObject() for len() > 1 ... :)
-@@ -3079,9 +3841,11 @@ class YumBase(depsolve.Depsolve):
+@@ -3079,9 +3878,11 @@ class YumBase(depsolve.Depsolve):
          return po
          
      def gpgKeyCheck(self):
@@ -153430,7 +153533,7 @@ index 99039e0..a1b045f 100644
          gpgkeyschecked = self.conf.cachedir + '/.gpgkeyschecked.yum'
          if os.path.exists(gpgkeyschecked):
              return 1
-@@ -3106,9 +3870,13 @@ class YumBase(depsolve.Depsolve):
+@@ -3106,9 +3907,13 @@ class YumBase(depsolve.Depsolve):
              return 1
  
      def returnPackagesByDep(self, depstring):
@@ -153446,7 +153549,7 @@ index 99039e0..a1b045f 100644
          if not depstring:
              return []
  
-@@ -3135,9 +3903,16 @@ class YumBase(depsolve.Depsolve):
+@@ -3135,9 +3940,16 @@ class YumBase(depsolve.Depsolve):
          return self.pkgSack.getProvides(depname, depflags, depver).keys()
  
      def returnPackageByDep(self, depstring):
@@ -153466,7 +153569,7 @@ index 99039e0..a1b045f 100644
          # we get all sorts of randomness here
          errstring = depstring
          if type(depstring) not in types.StringTypes:
-@@ -3149,16 +3924,22 @@ class YumBase(depsolve.Depsolve):
+@@ -3149,16 +3961,22 @@ class YumBase(depsolve.Depsolve):
              raise Errors.YumBaseError, _('No Package found for %s') % errstring
          
          ps = ListPackageSack(pkglist)
@@ -153493,7 +153596,7 @@ index 99039e0..a1b045f 100644
          if not depstring:
              return []
  
-@@ -3184,12 +3965,47 @@ class YumBase(depsolve.Depsolve):
+@@ -3184,12 +4002,47 @@ class YumBase(depsolve.Depsolve):
  
          return self.rpmdb.getProvides(depname, depflags, depver).keys()
  
@@ -153543,7 +153646,7 @@ index 99039e0..a1b045f 100644
          
          
          if len(pkglist) == 0:
-@@ -3198,14 +4014,23 @@ class YumBase(depsolve.Depsolve):
+@@ -3198,14 +4051,23 @@ class YumBase(depsolve.Depsolve):
          if len(pkglist) == 1:
              return pkglist[0]
  
@@ -153573,7 +153676,7 @@ index 99039e0..a1b045f 100644
          returnlist = []
          compatArchList = self.arch.get_arch_list(arch)
          multiLib = []
-@@ -3222,9 +4047,9 @@ class YumBase(depsolve.Depsolve):
+@@ -3222,9 +4084,9 @@ class YumBase(depsolve.Depsolve):
                  singleLib.append(po)
                  
          # we now have three lists.  find the best package(s) of each
@@ -153586,7 +153689,7 @@ index 99039e0..a1b045f 100644
  
          if single_name and multi and single and multi.name != single.name:
              # Sinlge _must_ match multi, if we want a single package name
-@@ -3238,7 +4063,7 @@ class YumBase(depsolve.Depsolve):
+@@ -3238,7 +4100,7 @@ class YumBase(depsolve.Depsolve):
          # if there's a noarch and it's newer than the multilib, we want
          # just the noarch.  otherwise, we want multi + single
          elif multi:
@@ -153595,7 +153698,7 @@ index 99039e0..a1b045f 100644
              if best.arch == "noarch":
                  returnlist.append(no)
              else:
-@@ -3246,7 +4071,7 @@ class YumBase(depsolve.Depsolve):
+@@ -3246,7 +4108,7 @@ class YumBase(depsolve.Depsolve):
                  if single: returnlist.append(single)
          # similar for the non-multilib case
          elif single:
@@ -153604,7 +153707,7 @@ index 99039e0..a1b045f 100644
              if best.arch == "noarch":
                  returnlist.append(no)
              else:
-@@ -3350,28 +4175,58 @@ class YumBase(depsolve.Depsolve):
+@@ -3350,28 +4212,58 @@ class YumBase(depsolve.Depsolve):
              done = True
  
              slow = next_func(slow)
@@ -153668,7 +153771,7 @@ index 99039e0..a1b045f 100644
          try:
              txmbrs = self.groupRemove(group_string)
          except yum.Errors.GroupsError:
-@@ -3387,6 +4242,8 @@ class YumBase(depsolve.Depsolve):
+@@ -3387,6 +4279,8 @@ class YumBase(depsolve.Depsolve):
          assert pattern[0] == '@'
          grpid = pattern[1:]
  
@@ -153677,7 +153780,7 @@ index 99039e0..a1b045f 100644
          thesegroups = self.comps.return_groups(grpid)
          if not thesegroups:
              raise Errors.GroupsError, _("No Group named %s exists") % to_unicode(grpid)
-@@ -3398,7 +4255,11 @@ class YumBase(depsolve.Depsolve):
+@@ -3398,7 +4292,11 @@ class YumBase(depsolve.Depsolve):
      def _minus_deselect(self, pattern):
          """ Remove things from the transaction, like kickstart. """
          assert pattern[0] == '-'
@@ -153690,7 +153793,7 @@ index 99039e0..a1b045f 100644
  
          if pat and pat[0] == '@':
              pat = pat[1:]
-@@ -3437,14 +4298,61 @@ class YumBase(depsolve.Depsolve):
+@@ -3437,14 +4335,87 @@ class YumBase(depsolve.Depsolve):
              if flag not in self.tsInfo.probFilterFlags:
                  self.tsInfo.probFilterFlags.append(flag)
  
@@ -153719,6 +153822,32 @@ index 99039e0..a1b045f 100644
 +
 +        return False
 +
++    def _valid_install_arch(self, po, ipkgs=None):
++        ''' See if we can install this arch of package, mainly for
++            i386 vs. i586 or ppc64 vs. ppc64 etc. '''
++        if not ipkgs:
++            ipkgs = self.rpmdb.searchNames([po.name])
++        else:
++            ipkgs = ipkgs[:]
++
++        # Add these anyway, just to be sure.
++        for txmbr in self.tsInfo.matchNaevr(po.name):
++            if txmbr.output_state not in TS_INSTALL_STATES:
++                continue
++            ipkgs.append(txmbr.po)
++
++        for ipkg in ipkgs:
++            if po.arch == ipkg.arch:
++                continue
++            if not po.verEQ(ipkg):
++                continue
++            if canCoinstall(po.arch, ipkg.arch):
++                continue
++            self.verbose_logger.log(logginglevels.INFO_2,
++                    _("Package: %s - can't co-install with %s"), po, ipkg)
++            return False
++        return True
++
      def install(self, po=None, **kwargs):
 -        """try to mark for install the item specified. Uses provided package 
 -           object, if available. If not it uses the kwargs and gets the best
@@ -153758,7 +153887,7 @@ index 99039e0..a1b045f 100644
          pkgs = []
          was_pattern = False
          if po:
-@@ -3477,20 +4385,12 @@ class YumBase(depsolve.Depsolve):
+@@ -3477,20 +4448,12 @@ class YumBase(depsolve.Depsolve):
                      self.verbose_logger.debug(_('Checking for virtual provide or file-provide for %s'), 
                          arg)
  
@@ -153785,7 +153914,7 @@ index 99039e0..a1b045f 100644
              else:
                  nevra_dict = self._nevra_kwarg_parse(kwargs)
  
-@@ -3577,8 +4477,8 @@ class YumBase(depsolve.Depsolve):
+@@ -3577,17 +4540,20 @@ class YumBase(depsolve.Depsolve):
                      continue
              
              # make sure this shouldn't be passed to update:
@@ -153796,7 +153925,11 @@ index 99039e0..a1b045f 100644
                  txmbrs = self.update(po=po)
                  tx_return.extend(txmbrs)
                  continue
-@@ -3587,7 +4487,7 @@ class YumBase(depsolve.Depsolve):
++
++            if not self._valid_install_arch(po, ipkgs):
++                continue
+             
+             #  Make sure we're not installing a package which is obsoleted by
              # something else in the repo. Unless there is a obsoletion loop,
              # at which point ignore everything.
              obsoleting_pkg = None
@@ -153805,7 +153938,7 @@ index 99039e0..a1b045f 100644
                  obsoleting_pkg = self._test_loop(po, self._pkg2obspkg)
              if obsoleting_pkg is not None:
                  # this is not a definitive check but it'll make sure we don't
-@@ -3600,23 +4500,23 @@ class YumBase(depsolve.Depsolve):
+@@ -3600,23 +4566,23 @@ class YumBase(depsolve.Depsolve):
                      already_obs = pkgs[0]
  
                  if already_obs:
@@ -153836,7 +153969,7 @@ index 99039e0..a1b045f 100644
                      continue
  
              # make sure we don't have a name.arch of this already installed
-@@ -3630,7 +4530,7 @@ class YumBase(depsolve.Depsolve):
+@@ -3630,7 +4596,7 @@ class YumBase(depsolve.Depsolve):
                          found = True
                          break
                  if not found:
@@ -153845,7 +153978,7 @@ index 99039e0..a1b045f 100644
                      txmbrs = self.update(po=po)
                      tx_return.extend(txmbrs)
                      continue
-@@ -3719,19 +4619,47 @@ class YumBase(depsolve.Depsolve):
+@@ -3719,19 +4685,47 @@ class YumBase(depsolve.Depsolve):
          return txmbr
  
      def update(self, po=None, requiringPo=None, update_to=False, **kwargs):
@@ -153900,7 +154033,7 @@ index 99039e0..a1b045f 100644
          tx_return = []
          if not po and not kwargs: # update everything (the easy case)
              self.verbose_logger.log(logginglevels.DEBUG_2, _('Updating Everything'))
-@@ -3765,7 +4693,14 @@ class YumBase(depsolve.Depsolve):
+@@ -3765,7 +4759,14 @@ class YumBase(depsolve.Depsolve):
                      if new is None:
                          continue
                      tx_return.extend(self.update(po=new))
@@ -153916,7 +154049,7 @@ index 99039e0..a1b045f 100644
              return tx_return
  
          # complications
-@@ -3787,7 +4722,7 @@ class YumBase(depsolve.Depsolve):
+@@ -3787,7 +4788,7 @@ class YumBase(depsolve.Depsolve):
                  return self._minus_deselect(kwargs['pattern'])
  
              if kwargs['pattern'] and kwargs['pattern'][0] == '@':
@@ -153925,7 +154058,7 @@ index 99039e0..a1b045f 100644
  
              arg = kwargs['pattern']
              if not update_to:
-@@ -3843,7 +4778,7 @@ class YumBase(depsolve.Depsolve):
+@@ -3843,7 +4844,7 @@ class YumBase(depsolve.Depsolve):
                      availpkgs = self._compare_providers(availpkgs, requiringPo)
                      availpkgs = map(lambda x: x[0], availpkgs)
                  elif not availpkgs:
@@ -153934,10 +154067,13 @@ index 99039e0..a1b045f 100644
         
          # for any thing specified
          # get the list of available pkgs matching it (or take the po)
-@@ -3920,6 +4855,18 @@ class YumBase(depsolve.Depsolve):
+@@ -3920,6 +4921,21 @@ class YumBase(depsolve.Depsolve):
                      tx_return.append(txmbr)
                          
          for available_pkg in availpkgs:
++            if not self._valid_install_arch(available_pkg):
++                continue
++
 +            # "Just do it" if it's a local pkg.
 +            if isinstance(available_pkg, YumLocalPackage):
 +                n = available_pkg.name
@@ -153953,7 +154089,7 @@ index 99039e0..a1b045f 100644
              #  Make sure we're not installing a package which is obsoleted by
              # something else in the repo. Unless there is a obsoletion loop,
              # at which point ignore everything.
-@@ -3985,11 +4932,18 @@ class YumBase(depsolve.Depsolve):
+@@ -3985,11 +5001,18 @@ class YumBase(depsolve.Depsolve):
          return tx_return
          
      def remove(self, po=None, **kwargs):
@@ -153977,7 +154113,7 @@ index 99039e0..a1b045f 100644
          if not po and not kwargs:
              raise Errors.RemoveError, 'Nothing specified to remove'
          
-@@ -4055,17 +5009,19 @@ class YumBase(depsolve.Depsolve):
+@@ -4055,17 +5078,19 @@ class YumBase(depsolve.Depsolve):
          return tx_return
  
      def installLocal(self, pkg, po=None, updateonly=False):
@@ -154007,7 +154143,7 @@ index 99039e0..a1b045f 100644
          # read in the package into a YumLocalPackage Object
          # append it to self.localPackages
          # check if it can be installed or updated based on nevra versus rpmdb
-@@ -4183,16 +5139,15 @@ class YumBase(depsolve.Depsolve):
+@@ -4183,16 +5208,15 @@ class YumBase(depsolve.Depsolve):
          return tx_return
  
      def reinstallLocal(self, pkg, po=None):
@@ -154032,7 +154168,7 @@ index 99039e0..a1b045f 100644
          if not po:
              try:
                  po = YumUrlPackage(self, ts=self.rpmdb.readOnlyTS(), url=pkg,
-@@ -4215,9 +5170,19 @@ class YumBase(depsolve.Depsolve):
+@@ -4215,9 +5239,19 @@ class YumBase(depsolve.Depsolve):
          return self.reinstall(po=po)
  
      def reinstall(self, po=None, **kwargs):
@@ -154055,7 +154191,7 @@ index 99039e0..a1b045f 100644
          self._add_prob_flags(rpm.RPMPROB_FILTER_REPLACEPKG,
                               rpm.RPMPROB_FILTER_REPLACENEWFILES,
                               rpm.RPMPROB_FILTER_REPLACEOLDFILES)
-@@ -4259,16 +5224,15 @@ class YumBase(depsolve.Depsolve):
+@@ -4259,16 +5293,15 @@ class YumBase(depsolve.Depsolve):
          return tx_mbrs
          
      def downgradeLocal(self, pkg, po=None):
@@ -154080,7 +154216,7 @@ index 99039e0..a1b045f 100644
          if not po:
              try:
                  po = YumUrlPackage(self, ts=self.rpmdb.readOnlyTS(), url=pkg,
-@@ -4309,13 +5273,19 @@ class YumBase(depsolve.Depsolve):
+@@ -4309,13 +5342,19 @@ class YumBase(depsolve.Depsolve):
          return False
          
      def downgrade(self, po=None, **kwargs):
@@ -154107,7 +154243,18 @@ index 99039e0..a1b045f 100644
          if not po and not kwargs:
              raise Errors.DowngradeError, 'Nothing specified to downgrade'
  
-@@ -4421,6 +5391,9 @@ class YumBase(depsolve.Depsolve):
+@@ -4397,6 +5436,10 @@ class YumBase(depsolve.Depsolve):
+         # installed version. Indexed fromn the latest installed pkgtup.
+         downgrade_apkgs = {}
+         for pkg in sorted(apkgs):
++            # We are cleverer here, I think...
++            # if not self._valid_install_arch(pkg, ipkgs):
++            # continue
++
+             na  = (pkg.name, pkg.arch)
+ 
+             # Here we allow downgrades from .i386 => .noarch, or .i586 => .i386
+@@ -4421,6 +5464,9 @@ class YumBase(depsolve.Depsolve):
                  warned_nas.add(na)
                  continue
  
@@ -154117,7 +154264,7 @@ index 99039e0..a1b045f 100644
              if pkg.verGE(lipkg):
                  if na not in warned_nas:
                      msg = _('Only Upgrade available on package: %s') % pkg
-@@ -4457,7 +5430,7 @@ class YumBase(depsolve.Depsolve):
+@@ -4457,7 +5503,7 @@ class YumBase(depsolve.Depsolve):
          if e and v and r:
              evr = '%s:%s-%s' % (e, v, r)
          elif v and r:
@@ -154126,7 +154273,7 @@ index 99039e0..a1b045f 100644
          elif e and v:
              evr = '%s:%s' % (e, v)
          elif v: # e and r etc. is just too weird to print
-@@ -4500,12 +5473,24 @@ class YumBase(depsolve.Depsolve):
+@@ -4500,12 +5546,24 @@ class YumBase(depsolve.Depsolve):
  
          return returndict
  
@@ -154154,7 +154301,7 @@ index 99039e0..a1b045f 100644
          old_conf_obs = self.conf.obsoletes
          self.conf.obsoletes = False
          done = False
-@@ -4515,19 +5500,46 @@ class YumBase(depsolve.Depsolve):
+@@ -4515,19 +5573,46 @@ class YumBase(depsolve.Depsolve):
                      done = True
          for pkg in transaction.trans_data:
              if pkg.state == 'Downgrade':
@@ -154201,7 +154348,7 @@ index 99039e0..a1b045f 100644
                  if self.install(pkgtup=pkg.pkgtup):
                      done = True
          for pkg in transaction.trans_data:
-@@ -4538,8 +5550,14 @@ class YumBase(depsolve.Depsolve):
+@@ -4538,8 +5623,14 @@ class YumBase(depsolve.Depsolve):
          return done
  
      def history_undo(self, transaction):
@@ -154218,7 +154365,7 @@ index 99039e0..a1b045f 100644
          # NOTE: This is somewhat basic atm. ... for instance we don't check
          #       that we are going from the old new version. However it's still
          #       better than the RHN rollback code, and people pay for that :).
-@@ -4616,7 +5634,7 @@ class YumBase(depsolve.Depsolve):
+@@ -4616,7 +5707,7 @@ class YumBase(depsolve.Depsolve):
  
          except urlgrabber.grabber.URLGrabError, e:
              raise Errors.YumBaseError(_('GPG key retrieval failed: ') +
@@ -154227,7 +154374,7 @@ index 99039e0..a1b045f 100644
                                        
          # check for a .asc file accompanying it - that's our gpg sig on the key
          # suck it down and do the check
-@@ -4649,7 +5667,7 @@ class YumBase(depsolve.Depsolve):
+@@ -4649,7 +5740,7 @@ class YumBase(depsolve.Depsolve):
              keys_info = misc.getgpgkeyinfo(rawkey, multiple=True)
          except ValueError, e:
              raise Errors.YumBaseError(_('Invalid GPG Key from %s: %s') % 
@@ -154236,7 +154383,7 @@ index 99039e0..a1b045f 100644
          keys = []
          for keyinfo in keys_info:
              thiskey = {}
-@@ -4674,39 +5692,49 @@ class YumBase(depsolve.Depsolve):
+@@ -4674,39 +5765,49 @@ class YumBase(depsolve.Depsolve):
              if pkgs:
                  pkgs = sorted(pkgs)[-1]
                  msg = (_('Importing %s key 0x%s:\n'
@@ -154304,7 +154451,7 @@ index 99039e0..a1b045f 100644
          user_cb_fail = False
          for keyurl in keyurls:
              keys = self._retrievePublicKey(keyurl, repo)
-@@ -4725,7 +5753,9 @@ class YumBase(depsolve.Depsolve):
+@@ -4725,7 +5826,9 @@ class YumBase(depsolve.Depsolve):
                      # Try installing/updating GPG key
                      self._getKeyImportMessage(info, keyurl)
                      rc = False
@@ -154315,7 +154462,7 @@ index 99039e0..a1b045f 100644
                          rc = True
                          
                      # grab the .sig/.asc for the keyurl, if it exists
-@@ -4751,8 +5781,8 @@ class YumBase(depsolve.Depsolve):
+@@ -4751,8 +5854,8 @@ class YumBase(depsolve.Depsolve):
                  ts = self.rpmdb.readOnlyTS()
                  result = ts.pgpImportPubkey(misc.procgpgkey(info['raw_key']))
                  if result != 0:
@@ -154326,7 +154473,7 @@ index 99039e0..a1b045f 100644
                  self.logger.info(_('Key imported successfully'))
                  key_installed = True
  
-@@ -4760,18 +5790,20 @@ class YumBase(depsolve.Depsolve):
+@@ -4760,18 +5863,20 @@ class YumBase(depsolve.Depsolve):
              raise Errors.YumBaseError, _("Didn't install any keys")
  
          if not key_installed:
@@ -154352,7 +154499,7 @@ index 99039e0..a1b045f 100644
      
      def _getAnyKeyForRepo(self, repo, destdir, keyurl_list, is_cakey=False, callback=None):
          """
-@@ -4788,6 +5820,18 @@ class YumBase(depsolve.Depsolve):
+@@ -4788,6 +5893,18 @@ class YumBase(depsolve.Depsolve):
          """
  
          key_installed = False
@@ -154371,7 +154518,7 @@ index 99039e0..a1b045f 100644
          user_cb_fail = False
          for keyurl in keyurl_list:
              keys = self._retrievePublicKey(keyurl, repo, getSig=not is_cakey)
-@@ -4819,8 +5863,11 @@ class YumBase(depsolve.Depsolve):
+@@ -4819,8 +5936,11 @@ class YumBase(depsolve.Depsolve):
                  if not key_installed:
                      self._getKeyImportMessage(info, keyurl, keytype)
                      rc = False
@@ -154384,7 +154531,7 @@ index 99039e0..a1b045f 100644
                      elif callback:
                          rc = callback({"repo": repo, "userid": info['userid'],
                                          "hexkeyid": info['hexkeyid'], "keyurl": keyurl,
-@@ -4835,7 +5882,8 @@ class YumBase(depsolve.Depsolve):
+@@ -4835,7 +5955,8 @@ class YumBase(depsolve.Depsolve):
                  # Import the key
                  result = misc.import_key_to_pubring(info['raw_key'], info['hexkeyid'], gpgdir=destdir)
                  if not result:
@@ -154394,7 +154541,7 @@ index 99039e0..a1b045f 100644
                  self.logger.info(_('Key imported successfully'))
                  key_installed = True
                  # write out the key id to imported_cakeys in the repos basedir
-@@ -4851,36 +5899,35 @@ class YumBase(depsolve.Depsolve):
+@@ -4851,36 +5972,35 @@ class YumBase(depsolve.Depsolve):
                              pass
  
          if not key_installed and user_cb_fail:
@@ -154447,7 +154594,7 @@ index 99039e0..a1b045f 100644
          self._getAnyKeyForRepo(repo, repo.gpgcadir, repo.gpgcakey, is_cakey=True, callback=callback)
  
      def _limit_installonly_pkgs(self):
-@@ -4927,6 +5974,7 @@ class YumBase(depsolve.Depsolve):
+@@ -4927,6 +6047,7 @@ class YumBase(depsolve.Depsolve):
          ts = self.rpmdb.readOnlyTS()
          (cur_kernel_v, cur_kernel_r) = misc.get_running_kernel_version_release(ts)
          install_only_names = set(self.conf.installonlypkgs)
@@ -154455,7 +154602,7 @@ index 99039e0..a1b045f 100644
          for m in self.tsInfo.getMembers():
              if m.ts_state not in ('i', 'u'):
                  continue
-@@ -4937,12 +5985,21 @@ class YumBase(depsolve.Depsolve):
+@@ -4937,12 +6058,21 @@ class YumBase(depsolve.Depsolve):
              if not po_names.intersection(install_only_names):
                  continue
  
@@ -154481,7 +154628,7 @@ index 99039e0..a1b045f 100644
              for po in installed:
                  if (po.version, po.release) == (cur_kernel_v, cur_kernel_r): 
                      # don't remove running
-@@ -4959,19 +6016,22 @@ class YumBase(depsolve.Depsolve):
+@@ -4959,19 +6089,22 @@ class YumBase(depsolve.Depsolve):
              txmbr.depends_on.append(rel)
  
      def processTransaction(self, callback=None,rpmTestDisplay=None, rpmDisplay=None):
@@ -154517,7 +154664,7 @@ index 99039e0..a1b045f 100644
          
          if not callback:
              callback = callbacks.ProcessTransNoOutputCallback()
-@@ -5114,13 +6174,19 @@ class YumBase(depsolve.Depsolve):
+@@ -5114,13 +6247,19 @@ class YumBase(depsolve.Depsolve):
          return results
  
      def add_enable_repo(self, repoid, baseurls=[], mirrorlist=None, **kwargs):
@@ -154544,7 +154691,7 @@ index 99039e0..a1b045f 100644
          # out of place fixme - maybe we should make this the default repo addition
          # routine and use it from getReposFromConfigFile(), etc.
          newrepo = yumRepo.YumRepository(repoid)
-@@ -5167,9 +6233,15 @@ class YumBase(depsolve.Depsolve):
+@@ -5167,9 +6306,15 @@ class YumBase(depsolve.Depsolve):
  
      def setCacheDir(self, force=False, tmpdir=None, reuse=True,
                      suffix='/$basearch/$releasever'):
@@ -154563,7 +154710,7 @@ index 99039e0..a1b045f 100644
          if not force and os.geteuid() == 0:
              return True # We are root, not forced, so happy with the global dir.
          if tmpdir is None:
-@@ -5179,7 +6251,7 @@ class YumBase(depsolve.Depsolve):
+@@ -5179,7 +6324,7 @@ class YumBase(depsolve.Depsolve):
          try:
              cachedir = misc.getCacheDir(tmpdir, reuse)
          except (IOError, OSError), e:
@@ -154572,7 +154719,7 @@ index 99039e0..a1b045f 100644
              cachedir = None
              
          if cachedir is None:
-@@ -5190,6 +6262,7 @@ class YumBase(depsolve.Depsolve):
+@@ -5190,6 +6335,7 @@ class YumBase(depsolve.Depsolve):
              self.prerepoconf.cachedir = cachedir
          else:
              self.repos.setCacheDir(cachedir)
@@ -154580,7 +154727,7 @@ index 99039e0..a1b045f 100644
          self.conf.cachedir = cachedir
          return True # We got a new cache dir
  
-@@ -5220,13 +6293,24 @@ class YumBase(depsolve.Depsolve):
+@@ -5220,13 +6366,24 @@ class YumBase(depsolve.Depsolve):
          self.history.write_addon_data('config-repos', myrepos)
          
      def verify_plugins_cb(self, verify_package):
@@ -154608,7 +154755,7 @@ index 99039e0..a1b045f 100644
          if self.tsInfo._unresolvedMembers:
              if auto:
                  self.logger.critical(_("Dependencies not solved. Will not save unresolved transaction."))
-@@ -5234,7 +6318,7 @@ class YumBase(depsolve.Depsolve):
+@@ -5234,7 +6391,7 @@ class YumBase(depsolve.Depsolve):
              raise Errors.YumBaseError(_("Dependencies not solved. Will not save unresolved transaction."))
          
          if not filename:
@@ -154617,7 +154764,7 @@ index 99039e0..a1b045f 100644
              fd,filename = tempfile.mkstemp(suffix='.yumtx', prefix=prefix)
              f = os.fdopen(fd, 'w')
          else:
-@@ -5244,13 +6328,17 @@ class YumBase(depsolve.Depsolve):
+@@ -5244,13 +6401,17 @@ class YumBase(depsolve.Depsolve):
          
          msg = "%s\n" % self.rpmdb.simpleVersion(main_only=True)[0]
          msg += "%s\n" % self.ts.getTsFlags()
@@ -154638,7 +154785,7 @@ index 99039e0..a1b045f 100644
          msg += "%s\n" % len(self.tsInfo.getMembers())
          for txmbr in self.tsInfo.getMembers():
              msg += txmbr._dump()
-@@ -5260,13 +6348,25 @@ class YumBase(depsolve.Depsolve):
+@@ -5260,13 +6421,25 @@ class YumBase(depsolve.Depsolve):
          except (IOError, OSError), e:
              self._ts_save_file = None
              if auto:
@@ -154670,7 +154817,7 @@ index 99039e0..a1b045f 100644
          # check rpmversion - if not match throw a fit
          # check repoversions  (and repos)- if not match throw a fit
          # load each txmbr - if pkgs being updated don't exist, bail w/error
-@@ -5276,26 +6376,45 @@ class YumBase(depsolve.Depsolve):
+@@ -5276,26 +6449,45 @@ class YumBase(depsolve.Depsolve):
          try:
              data = open(filename, 'r').readlines()
          except (IOError, OSError), e:
@@ -154718,7 +154865,7 @@ index 99039e0..a1b045f 100644
              if ignorerpm:
                  msg += _(" ignoring, as requested.")
                  self.logger.critical(_(msg))
-@@ -5318,8 +6437,17 @@ class YumBase(depsolve.Depsolve):
+@@ -5318,8 +6510,17 @@ class YumBase(depsolve.Depsolve):
          numrepos = int(data[2].strip())
          repos = []
          rindex=3+numrepos
@@ -154737,7 +154884,7 @@ index 99039e0..a1b045f 100644
  
          # pkgs/txmbrs
          numpkgs = int(data[rindex].strip())
-@@ -5329,6 +6457,7 @@ class YumBase(depsolve.Depsolve):
+@@ -5329,6 +6530,7 @@ class YumBase(depsolve.Depsolve):
          pkgcount = 0
          pkgprob = False
          curpkg = None
@@ -154745,7 +154892,7 @@ index 99039e0..a1b045f 100644
          for l in data[pkgstart:]:
              l = l.rstrip()
              # our main txmbrs
-@@ -5356,6 +6485,7 @@ class YumBase(depsolve.Depsolve):
+@@ -5356,6 +6558,7 @@ class YumBase(depsolve.Depsolve):
                      if not ignoremissing:
                          raise Errors.YumBaseError(msg)
                      else:
@@ -154753,7 +154900,7 @@ index 99039e0..a1b045f 100644
                          self.logger.critical(msg)
                  else:
                      pkgcount += 1
-@@ -5432,12 +6562,18 @@ class YumBase(depsolve.Depsolve):
+@@ -5432,12 +6635,18 @@ class YumBase(depsolve.Depsolve):
          if pkgprob:
              msg = _("Transaction members, relations are missing or ts has been modified,")
              if ignoremissing:
@@ -154772,7 +154919,7 @@ index 99039e0..a1b045f 100644
          return self.tsInfo.getMembers()
  
      def _remove_old_deps(self):
-@@ -5470,18 +6606,6 @@ class YumBase(depsolve.Depsolve):
+@@ -5470,18 +6679,6 @@ class YumBase(depsolve.Depsolve):
                      if requiring == required: # if they are self-requiring skip them
                          continue
                          
@@ -154791,7 +154938,7 @@ index 99039e0..a1b045f 100644
                      #for tbi_pkg in self.tsInfo.getMembersWithState(output_states=TS_INSTALL_STATES):
                      #   for reqtuple in tbi_pkg.po.requires:
                      #        if required.provides_for(reqtuple):
-@@ -5533,7 +6657,24 @@ class YumBase(depsolve.Depsolve):
+@@ -5533,7 +6730,24 @@ class YumBase(depsolve.Depsolve):
                      # Debugging output
                      self.verbose_logger.log(logginglevels.DEBUG_2, _("%s has revdep %s which was user-installed."), pkg, curpkg)
                      ok_to_remove[pkg] = False
@@ -154816,7 +154963,7 @@ index 99039e0..a1b045f 100644
                  visited[curpkg] = True
              all_leaves_visited = True
              leaves = curpkg.requiring_packages()
-@@ -5547,4 +6688,3 @@ class YumBase(depsolve.Depsolve):
+@@ -5547,4 +6761,3 @@ class YumBase(depsolve.Depsolve):
          # Debugging output
          self.verbose_logger.log(logginglevels.DEBUG_2, _("%s has no user-installed revdeps."), pkg)
          return False
@@ -157766,7 +157913,7 @@ index aaa4f25..61aa586 100755
                  continue
  
 diff --git a/yum/misc.py b/yum/misc.py
-index 2f6ddfe..0fd3e90 100644
+index 2f6ddfe..a0bac7b 100644
 --- a/yum/misc.py
 +++ b/yum/misc.py
 @@ -8,6 +8,7 @@ import os
@@ -157785,7 +157932,27 @@ index 2f6ddfe..0fd3e90 100644
  _available_compression = ['gz', 'bz2']
  try:
      import lzma
-@@ -410,6 +412,17 @@ def procgpgkey(rawkey):
+@@ -95,6 +97,19 @@ def re_glob(s):
+         _re_compiled_glob_match = re.compile('[*?]|\[.+\]').search
+     return _re_compiled_glob_match(s)
+ 
++def compile_pattern(pat, ignore_case=False):
++    """ Compile shell wildcards, return a 'match' function. """
++    if re_glob(pat):
++        try:
++            flags = ignore_case and re.I or 0
++            return re.compile(fnmatch.translate(pat), flags).match
++        except re.error:
++            pass # fall back to exact match
++    if ignore_case:
++        pat = pat.lower()
++        return lambda s: s.lower() == pat
++    return lambda s: s == pat
++
+ _re_compiled_filename_match = None
+ def re_filename(s):
+     """ Tests if a string could be a filename. We still get negated character
+@@ -410,6 +425,17 @@ def procgpgkey(rawkey):
      # Decode and return
      return base64.decodestring(block.getvalue())
  
@@ -157803,7 +157970,7 @@ index 2f6ddfe..0fd3e90 100644
  def getgpgkeyinfo(rawkey, multiple=False):
      '''Return a dict of info for the given ASCII armoured key text
  
-@@ -611,6 +624,8 @@ def getCacheDir(tmpdir='/var/tmp', reuse=True, prefix='yum-'):
+@@ -611,6 +637,8 @@ def getCacheDir(tmpdir='/var/tmp', reuse=True, prefix='yum-'):
      try:
          usertup = pwd.getpwuid(uid)
          username = usertup[0]
@@ -157812,7 +157979,7 @@ index 2f6ddfe..0fd3e90 100644
      except KeyError:
          return None # if it returns None then, well, it's bollocksed
  
-@@ -744,8 +759,9 @@ def _decompress_chunked(source, dest, ztype):
+@@ -744,8 +772,9 @@ def _decompress_chunked(source, dest, ztype):
      while True:
          try:
              data = s_fn.read(1024000)
@@ -157824,7 +157991,7 @@ index 2f6ddfe..0fd3e90 100644
          
          if not data: break
  
-@@ -940,14 +956,16 @@ def unlink_f(filename):
+@@ -940,14 +969,16 @@ def unlink_f(filename):
          if e.errno != errno.ENOENT:
              raise
  
@@ -157845,7 +158012,7 @@ index 2f6ddfe..0fd3e90 100644
  
  def _getloginuid():
      """ Get the audit-uid/login-uid, if available. None is returned if there
-@@ -992,9 +1010,17 @@ def setup_locale(override_codecs=True, override_time=False):
+@@ -992,9 +1023,17 @@ def setup_locale(override_codecs=True, override_time=False):
          locale.setlocale(locale.LC_ALL, 'C')
          
      if override_codecs:
@@ -157866,7 +158033,7 @@ index 2f6ddfe..0fd3e90 100644
  
  
  def get_my_lang_code():
-@@ -1105,17 +1131,28 @@ def decompress(filename, dest=None, fn_only=False, check_timestamps=False):
+@@ -1105,17 +1144,28 @@ def decompress(filename, dest=None, fn_only=False, check_timestamps=False):
              out = filename.replace('.xz', '')
          
      else:
@@ -157903,7 +158070,7 @@ index 2f6ddfe..0fd3e90 100644
          
      return out
      
-@@ -1123,11 +1160,7 @@ def repo_gen_decompress(filename, generated_name, cached=False):
+@@ -1123,11 +1173,7 @@ def repo_gen_decompress(filename, generated_name, cached=False):
      """ This is a wrapper around decompress, where we work out a cached
          generated name, and use check_timestamps. filename _must_ be from
          a repo. and generated_name is the type of the file. """
@@ -157917,10 +158084,41 @@ index 2f6ddfe..0fd3e90 100644
      
  def read_in_items_from_dot_dir(thisglob, line_as_list=True):
 diff --git a/yum/packageSack.py b/yum/packageSack.py
-index 4af563a..47832fc 100644
+index 4af563a..a702ac1 100644
 --- a/yum/packageSack.py
 +++ b/yum/packageSack.py
-@@ -445,6 +445,7 @@ class MetaSack(PackageSackBase):
+@@ -282,11 +282,7 @@ class PackageSackBase(object):
+ 
+         specs = {}
+         for p in pkgspecs:
+-            if misc.re_glob(p):
+-                restring = fnmatch.translate(p)
+-                specs[p] = re.compile(restring)
+-            else:
+-                specs[p] = p
++            specs[p] = misc.compile_pattern(p)
+ 
+         #  We don't use simplePkgList() here because that loads all of the
+         # rpmdb, if we are Eg. doing a "remove PackageKit".
+@@ -304,13 +300,12 @@ class PackageSackBase(object):
+                 ))
+                 
+             for (term,query) in specs.items():
+-                if term == query:
+-                    if query in names:
+-                        exactmatch.append(self.searchPkgTuple(pkgtup)[0])
+-                        unmatched.discard(term)
++                if term in names:
++                    exactmatch.append(self.searchPkgTuple(pkgtup)[0])
++                    unmatched.discard(term)
+                 else:
+                     for n in names:
+-                        if query.match(n):
++                        if query(n):
+                             matched.append(self.searchPkgTuple(pkgtup)[0])
+                             unmatched.discard(term)
+         return misc.unique(exactmatch), misc.unique(matched), list(unmatched)
+@@ -445,6 +440,7 @@ class MetaSack(PackageSackBase):
          nobsdict = {}
          last_name = ''
          last_pkg = None
@@ -157928,7 +158126,7 @@ index 4af563a..47832fc 100644
          #  It takes about 0.2 of a second to convert these into packages, just
          # so we can sort them, which is ~40% of this functions time. So we sort
          # the pkgtups "by hand".
-@@ -624,6 +625,8 @@ class MetaSack(PackageSackBase):
+@@ -624,6 +620,8 @@ class MetaSack(PackageSackBase):
  class PackageSack(PackageSackBase):
      """represents sets (sacks) of Package Objects"""
      def __init__(self):
@@ -157938,7 +158136,7 @@ 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..07c555c 100644
+index 5ef9951..7a2624a 100644
 --- a/yum/packages.py
 +++ b/yum/packages.py
 @@ -106,14 +106,16 @@ def buildPkgRefDict(pkgs, casematch=True):
@@ -157960,7 +158158,21 @@ index 5ef9951..07c555c 100644
      exactmatch = []
      matched = []
      unmatched = []
-@@ -223,6 +225,10 @@ class FakeRepository:
+@@ -130,11 +132,10 @@ def parsePackages(pkgs, usercommands, casematch=0,
+                 trylist = pkgdict.keys()
+                 # command and pkgdict are already lowered if not casematch
+                 # so case sensitive is always fine
+-                restring = fnmatch.translate(command)
+-                regex = re.compile(restring)
++                regex = misc.compile_pattern(command)
+                 foundit = 0
+                 for item in trylist:
+-                    if regex.match(item):
++                    if regex(item):
+                         matched.extend(pkgdict[item])
+                         del pkgdict[item]
+                         foundit = 1
+@@ -223,6 +224,10 @@ class FakeRepository:
      def __str__(self):
          return self.id
  
@@ -157971,7 +158183,7 @@ index 5ef9951..07c555c 100644
  
  #  Goal for the below is to have a packageobject that can be used by generic
  # functions independent of the type of package - ie: installed or available
-@@ -243,34 +249,87 @@ class PackageObject(object):
+@@ -243,34 +248,87 @@ class PackageObject(object):
          
      def _ui_envra(self):
          if self.epoch == '0':
@@ -158079,7 +158291,7 @@ index 5ef9951..07c555c 100644
      def __str__(self):
          return self.ui_envra
  
-@@ -481,15 +540,14 @@ class RpmBase(object):
+@@ -481,15 +539,14 @@ class RpmBase(object):
              if prcotuple in self._prco_lookup[prcotype]:
                  return 1
  
@@ -158103,7 +158315,7 @@ index 5ef9951..07c555c 100644
  
          return 0
  
-@@ -611,15 +669,18 @@ class RpmBase(object):
+@@ -611,15 +668,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'))
@@ -158122,7 +158334,7 @@ index 5ef9951..07c555c 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 +1144,7 @@ class YumAvailablePackage(PackageObject, RpmBase):
+@@ -1083,7 +1143,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, 
@@ -158131,7 +158343,7 @@ index 5ef9951..07c555c 100644
          
          msg += self._return_remote_location()
          return msg
-@@ -1133,7 +1194,7 @@ class YumAvailablePackage(PackageObject, RpmBase):
+@@ -1133,7 +1193,7 @@ class YumAvailablePackage(PackageObject, RpmBase):
          msg = ""
          mylist = getattr(self, pcotype)
          if mylist: msg = "\n    <rpm:%s>\n" % pcotype
@@ -158140,7 +158352,7 @@ index 5ef9951..07c555c 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 +1222,11 @@ class YumAvailablePackage(PackageObject, RpmBase):
+@@ -1161,11 +1221,11 @@ class YumAvailablePackage(PackageObject, RpmBase):
              dirs = self.returnFileEntries('dir', primary_only=True)
              ghosts = self.returnFileEntries('ghost', primary_only=True)
                  
@@ -158155,7 +158367,7 @@ index 5ef9951..07c555c 100644
              msg += """    <file type="ghost">%s</file>\n""" % misc.to_xml(fn)
          
          return msg
-@@ -1194,8 +1255,8 @@ class YumAvailablePackage(PackageObject, RpmBase):
+@@ -1194,8 +1254,8 @@ class YumAvailablePackage(PackageObject, RpmBase):
                          continue
                      newlist.append(i)
                  mylist = newlist
@@ -158166,7 +158378,7 @@ index 5ef9951..07c555c 100644
              if name.startswith('rpmlib('):
                  continue
              # this drops out requires that the pkg provides for itself.
-@@ -1217,13 +1278,16 @@ class YumAvailablePackage(PackageObject, RpmBase):
+@@ -1217,13 +1277,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)
@@ -158185,7 +158397,7 @@ index 5ef9951..07c555c 100644
          return msg
  
      def _dump_changelog(self, clog_limit):
-@@ -1272,6 +1336,13 @@ class YumAvailablePackage(PackageObject, RpmBase):
+@@ -1272,6 +1335,13 @@ class YumAvailablePackage(PackageObject, RpmBase):
          return misc.to_utf8(msg)
  
  
@@ -158199,7 +158411,7 @@ index 5ef9951..07c555c 100644
  
  #  This is a tweak on YumAvailablePackage() and is a base class for packages
  # which are actual rpms.
-@@ -1299,7 +1370,8 @@ class YumHeaderPackage(YumAvailablePackage):
+@@ -1299,7 +1369,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'])
@@ -158209,7 +158421,7 @@ index 5ef9951..07c555c 100644
          self.__mode_cache = {}
          self.__prcoPopulated = False
  
-@@ -1353,6 +1425,12 @@ class YumHeaderPackage(YumAvailablePackage):
+@@ -1353,6 +1424,12 @@ class YumHeaderPackage(YumAvailablePackage):
                  continue
  
              lst = hdr[getattr(rpm, 'RPMTAG_%sFLAGS' % tag)]
@@ -158222,7 +158434,7 @@ index 5ef9951..07c555c 100644
              flag = map(rpmUtils.miscutils.flagToString, lst)
              flag = map(misc.share_data, flag)
  
-@@ -1363,6 +1441,10 @@ class YumHeaderPackage(YumAvailablePackage):
+@@ -1363,6 +1440,10 @@ class YumHeaderPackage(YumAvailablePackage):
  
              prcotype = tag2prco[tag]
              self.prco[prcotype] = map(misc.share_data, zip(name,flag,vers))
@@ -158233,7 +158445,7 @@ index 5ef9951..07c555c 100644
      
      def tagByName(self, tag):
          warnings.warn("tagByName() will go away in a furture version of Yum.\n",
-@@ -1447,7 +1529,7 @@ class YumHeaderPackage(YumAvailablePackage):
+@@ -1447,7 +1528,7 @@ class YumHeaderPackage(YumAvailablePackage):
          raise NotImplementedError()
  
      def _size(self):
@@ -158847,7 +159059,7 @@ index 31b1080..eb84123 100755
              tags += """ </tags>\n"""
              msg += tags
 diff --git a/yum/repos.py b/yum/repos.py
-index 3793bad..6d4c20e 100644
+index 3793bad..de5da1e 100644
 --- a/yum/repos.py
 +++ b/yum/repos.py
 @@ -22,6 +22,7 @@ import misc
@@ -158906,15 +159118,21 @@ index 3793bad..6d4c20e 100644
      def doSetup(self, thisrepo = None):
          
          self.ayum.plugins.run('prereposetup')
-@@ -89,6 +131,7 @@ class RepoStorage:
+@@ -87,8 +129,13 @@ class RepoStorage:
+             # so nothing else touches us
+             if not repo.enabled:
                  self.disableRepo(repo.id)
++            else:
++                pkgdir = getattr(self.ayum.conf, 'downloaddir', None)
++                if pkgdir:
++                    repo.pkgdir = pkgdir
                  
          self._setup = True
 +        self.retrieveAllMD()
          self.ayum.plugins.run('postreposetup')
          
      def __str__(self):
-@@ -223,15 +266,16 @@ class RepoStorage:
+@@ -223,15 +270,16 @@ class RepoStorage:
          
          self._cachedir = cachedir
          for repo in self.repos.values():
@@ -158935,7 +159153,7 @@ index 3793bad..6d4c20e 100644
  
      def setFailureCallback(self, obj):
          """sets the failure callback for all repos"""
-@@ -288,6 +332,16 @@ class RepoStorage:
+@@ -288,6 +336,16 @@ class RepoStorage:
          else:
              data = [ mdtype ]
           
@@ -158953,7 +159171,7 @@ index 3793bad..6d4c20e 100644
              sack = repo.getPackageSack()
              try:
 diff --git a/yum/rpmsack.py b/yum/rpmsack.py
-index e289a7a..a4da4ab 100644
+index e289a7a..302f613 100644
 --- a/yum/rpmsack.py
 +++ b/yum/rpmsack.py
 @@ -48,6 +48,17 @@ def _open_no_umask(*args):
@@ -158993,7 +159211,53 @@ index e289a7a..a4da4ab 100644
                  continue
  
              pkg = pkg[0]
-@@ -616,7 +628,7 @@ class RPMDBPackageSack(PackageSackBase):
+@@ -534,13 +546,11 @@ class RPMDBPackageSack(PackageSackBase):
+             qpat = pat[0]
+             if qpat in ('?', '*', '['):
+                 qpat = None
+-            if ignore_case:
+-                if qpat is not None:
+-                    qpat = qpat.lower()
+-                ret.append((qpat, re.compile(fnmatch.translate(pat), re.I)))
+-            else:
+-                ret.append((qpat, re.compile(fnmatch.translate(pat))))
++            elif ignore_case:
++                qpat = qpat.lower()
++            ret.append((qpat, misc.compile_pattern(pat, ignore_case)))
+         return ret
++
+     @staticmethod
+     def _match_repattern(repatterns, hdr, ignore_case):
+         """ This is basically parsePackages() but for rpm hdr objects. """
+@@ -558,20 +568,20 @@ class RPMDBPackageSack(PackageSackBase):
+                 qname = qname.lower()
+             if qpat is not None and qpat != qname and qpat != epoch[0]:
+                 continue
+-            if repat.match(hdr['name']):
++            if repat(hdr['name']):
+                 return True
+-            if repat.match("%(name)s-%(version)s-%(release)s.%(arch)s" % hdr):
++            if repat("%(name)s-%(version)s-%(release)s.%(arch)s" % hdr):
+                 return True
+-            if repat.match("%(name)s.%(arch)s" % hdr):
++            if repat("%(name)s.%(arch)s" % hdr):
+                 return True
+-            if repat.match("%(name)s-%(version)s" % hdr):
++            if repat("%(name)s-%(version)s" % hdr):
+                 return True
+-            if repat.match("%(name)s-%(version)s-%(release)s" % hdr):
++            if repat("%(name)s-%(version)s-%(release)s" % hdr):
+                 return True
+-            if repat.match(epoch + ":%(name)s-%(version)s-%(release)s.%(arch)s"
++            if repat(epoch + ":%(name)s-%(version)s-%(release)s.%(arch)s"
+                            % hdr):
+                 return True
+-            if repat.match("%(name)s-%(epoch)s:%(version)s-%(release)s.%(arch)s"
++            if repat("%(name)s-%(epoch)s:%(version)s-%(release)s.%(arch)s"
+                            % hdr):
+                 return True
+         return False
+@@ -616,7 +626,7 @@ class RPMDBPackageSack(PackageSackBase):
              for hdr, idx in self._get_packages():
                  if self._match_repattern(rpats, hdr, ignore_case):
                      self._makePackageObject(hdr, idx)
@@ -159002,7 +159266,7 @@ index e289a7a..a4da4ab 100644
  
          pkgobjlist = self._idx2pkg.values()
          # Remove gpg-pubkeys, as no sane callers expects/likes them...
-@@ -993,7 +1005,7 @@ class RPMDBPackageSack(PackageSackBase):
+@@ -993,7 +1003,7 @@ class RPMDBPackageSack(PackageSackBase):
              return
  
          if not load_packages:
@@ -159011,7 +159275,7 @@ index e289a7a..a4da4ab 100644
  
          for pkgtup in checksum_data:
              if checksum_data[pkgtup] is None:
-@@ -1002,7 +1014,8 @@ class RPMDBPackageSack(PackageSackBase):
+@@ -1002,7 +1012,8 @@ class RPMDBPackageSack(PackageSackBase):
              (n, a, e, v, r) = pkgtup
              pkg = self.searchNevra(n, e, v, r, a)
              if not pkg:
@@ -159021,7 +159285,7 @@ index e289a7a..a4da4ab 100644
                  continue
              pkg = pkg[0]
              (T, D) = checksum_data[pkgtup]
-@@ -1088,7 +1101,7 @@ class RPMDBPackageSack(PackageSackBase):
+@@ -1088,7 +1099,7 @@ class RPMDBPackageSack(PackageSackBase):
                  return
  
              try:
@@ -159030,7 +159294,7 @@ index e289a7a..a4da4ab 100644
              except (IOError, OSError), e:
                  return
  
-@@ -1456,7 +1469,7 @@ class RPMDBPackageSack(PackageSackBase):
+@@ -1456,7 +1467,7 @@ class RPMDBPackageSack(PackageSackBase):
          providers = set() # Speedup, as usual :)
          problems = []
          for pkg in sorted(pkgs): # The sort here is mainly for "UI"
@@ -159039,7 +159303,7 @@ index e289a7a..a4da4ab 100644
                  if rreq[0].startswith('rpmlib'): continue
                  if rreq in providers:            continue
  
-@@ -1562,11 +1575,11 @@ class RPMDBAdditionalData(object):
+@@ -1562,11 +1573,11 @@ class RPMDBAdditionalData(object):
          self._packages = {} # pkgid = dir
          if not os.path.exists(self.conf.db_path):
              try:
@@ -159054,7 +159318,7 @@ index e289a7a..a4da4ab 100644
          else:
              if os.access(self.conf.db_path, os.W_OK):
                  self.conf.writable = True
-@@ -1622,6 +1635,7 @@ class RPMDBAdditionalDataPackage(object):
+@@ -1622,6 +1633,7 @@ class RPMDBAdditionalDataPackage(object):
                                  'installed_by', 'changed_by',
                                  'from_repo', 'from_repo_revision',
                                  'from_repo_timestamp', 'releasever',
@@ -159062,7 +159326,7 @@ index e289a7a..a4da4ab 100644
                                  'command_line'])
  
      def __init__(self, conf, pkgdir, yumdb_cache=None):
-@@ -1708,7 +1722,7 @@ class RPMDBAdditionalDataPackage(object):
+@@ -1708,7 +1720,7 @@ class RPMDBAdditionalDataPackage(object):
      def _write(self, attr, value):
          # check for self._conf.writable before going on?
          if not os.path.exists(self._mydir):
@@ -159071,7 +159335,7 @@ index e289a7a..a4da4ab 100644
  
          attr = _sanitize(attr)
          if attr in self._read_cached_data:
-@@ -1753,7 +1767,7 @@ class RPMDBAdditionalDataPackage(object):
+@@ -1753,7 +1765,7 @@ class RPMDBAdditionalDataPackage(object):
          if attr.endswith('.tmp'):
              raise AttributeError, "%s has no attribute %s" % (self, attr)
  
@@ -159156,7 +159420,7 @@ index 9b265f9..74a0f3f 100644
 +
 +        self.display.verify_txmbr(self.base, txmbr, count)
 diff --git a/yum/sqlitesack.py b/yum/sqlitesack.py
-index 8a6f6f3..ed57408 100644
+index 8a6f6f3..a955895 100644
 --- a/yum/sqlitesack.py
 +++ b/yum/sqlitesack.py
 @@ -69,7 +69,7 @@ def _parse_pkg_n(match, regexp_match, n):
@@ -159207,6 +159471,31 @@ index 8a6f6f3..ed57408 100644
          
          if len(self.filelistsdb) == 0:
              # grab repo object from primarydb and force filelists population in this sack using repo
+@@ -1560,7 +1563,7 @@ class YumSqlitePackageSack(yumRepo.YumPackageSack):
+             patterns = tmp
+         return (need_full, patterns, fields, False)
+ 
+-    @catchSqliteException
++    # @catchSqliteException has no effect on generators
+     def _yieldSQLDataList(self, repoid, patterns, fields, ignore_case):
+         """Yields all the package data for the given params. Excludes are done
+            at this stage. """
+@@ -1593,6 +1596,7 @@ class YumSqlitePackageSack(yumRepo.YumPackageSack):
+                 for x in cur:
+                     yield (repo, x)
+ 
++    @catchSqliteException
+     def _buildPkgObjList(self, repoid=None, patterns=None, ignore_case=False):
+         """Builds a list of packages, only containing nevra information.
+            Excludes are done at this stage. """
+@@ -1666,6 +1670,7 @@ class YumSqlitePackageSack(yumRepo.YumPackageSack):
+ 
+         return returnList
+ 
++    @catchSqliteException
+     def simplePkgList(self, patterns=None, ignore_case=False):
+         """Returns a list of pkg tuples (n, a, e, v, r), optionally from a
+            single repoid. Note that the packages are always filtered to those
 diff --git a/yum/transactioninfo.py b/yum/transactioninfo.py
 index 4d89d83..e7377bf 100644
 --- a/yum/transactioninfo.py
@@ -159440,7 +159729,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..9b9cc72 100644
+index e5e9ece..e362c43 100644
 --- a/yum/yumRepo.py
 +++ b/yum/yumRepo.py
 @@ -20,10 +20,12 @@ import time
@@ -159947,7 +160236,7 @@ index e5e9ece..9b9cc72 100644
          # pretend everything is good until the revert.
          if not self.timestamp_check:
 -            raise Errors.RepoError, "Can't download or revert repomd.xml"
-+            raise Errors.RepoError, "Can't download or revert repomd.xml for:" % self.ui_id
++            raise Errors.RepoError, "Can't download or revert repomd.xml for %s" % self.ui_id
  
          if 'old_repo_XML' not in self._oldRepoMDData:
              self._oldRepoMDData = {}
@@ -160159,8 +160448,20 @@ index e5e9ece..9b9cc72 100644
          """ Internal function, use .retrieveMD() from outside yum. """
          #  Note that this can raise Errors.RepoMDError if mdtype doesn't exist
          # for this repo.
-@@ -1588,7 +1720,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1580,15 +1712,19 @@ class YumRepository(Repository, config.RepoConf):
+                 try:
+                     self.checkMD(local, mdtype)
+                 except URLGrabError, e:
++                    if retrieve_can_fail:
++                        return None
+                     raise Errors.RepoError, \
+                         "Caching enabled and local cache: %s does not match checksum" % local
+                 else:
+                     return local
+ 
              else: # ain't there - raise
++                if retrieve_can_fail:
++                    return None
                  raise Errors.RepoError, \
                      "Caching enabled but no local cache of %s from %s" % (local,
 -                           self)
@@ -160168,7 +160469,7 @@ index e5e9ece..9b9cc72 100644
  
          if (os.path.exists(local) or
              self._preload_md_from_system_cache(os.path.basename(local))):
-@@ -1597,8 +1729,10 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1597,8 +1733,10 @@ class YumRepository(Repository, config.RepoConf):
                  return local # it's the same return the local one
  
          try:
@@ -160181,7 +160482,7 @@ index e5e9ece..9b9cc72 100644
              if thisdata.size is None:
                  reget = None
              else:
-@@ -1613,8 +1747,9 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1613,8 +1751,9 @@ class YumRepository(Repository, config.RepoConf):
                                    checkfunc=checkfunc, 
                                    text=text,
                                    cache=self.http_caching == 'all',
@@ -160193,7 +160494,7 @@ index e5e9ece..9b9cc72 100644
              if retrieve_can_fail:
                  return None
              raise
-@@ -1622,9 +1757,8 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1622,9 +1761,8 @@ class YumRepository(Repository, config.RepoConf):
              if retrieve_can_fail:
                  return None
              raise Errors.RepoError, \
@@ -160204,7 +160505,7 @@ index e5e9ece..9b9cc72 100644
              return local
  
  
-@@ -1646,13 +1780,21 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1646,13 +1784,21 @@ class YumRepository(Repository, config.RepoConf):
  
      def getGroups(self):
          """gets groups and returns group file path for the repository, if there
@@ -160229,7 +160530,7 @@ index e5e9ece..9b9cc72 100644
          self._callbacks_changed = True
  
      def setFailureObj(self, failure_obj):
-@@ -1681,7 +1823,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1681,7 +1827,7 @@ class YumRepository(Repository, config.RepoConf):
                  print "Could not read mirrorlist %s, error was \n%s" %(url, e)
                  content = []
              for line in content:
@@ -160238,7 +160539,7 @@ index e5e9ece..9b9cc72 100644
                      continue
                  mirror = line.rstrip() # no more trailing \n's
                  mirror = mirror.replace('$ARCH', '$BASEARCH')
-@@ -1713,7 +1855,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1713,7 +1859,7 @@ class YumRepository(Repository, config.RepoConf):
              ugopts = self._default_grabopts()
              try:
                  fo = urlgrabber.grabber.urlopen(url, **ugopts)
@@ -160247,7 +160548,7 @@ index e5e9ece..9b9cc72 100644
                  print "Could not retrieve mirrorlist %s error was\n%s: %s" % (url, e.args[0], misc.to_unicode(e.args[1]))
                  fo = None
  
-@@ -1877,7 +2019,7 @@ def getMirrorList(mirrorlist, pdict = None):
+@@ -1877,7 +2023,7 @@ def getMirrorList(mirrorlist, pdict = None):
  
      try:
          fo = urlresolver.urlopen(url, proxies=pdict)
diff --git a/yum.spec b/yum.spec
index 7a6fd86..f7f6909 100644
--- a/yum.spec
+++ b/yum.spec
@@ -18,7 +18,7 @@
 Summary: RPM package installer/updater/manager
 Name: yum
 Version: 3.4.3
-Release: 45%{?dist}
+Release: 46%{?dist}
 License: GPLv2+
 Group: System Environment/Base
 Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz
@@ -56,6 +56,9 @@ Requires: python-sqlite
 Requires: python-urlgrabber >= 3.9.0-8
 Requires: yum-metadata-parser >= 1.1.0
 Requires: pygpgme
+# rawhide is >= 0.5.3-7.fc18 ... as this is added.
+Requires: pyliblzma
+
 
 Conflicts: rpm >= 5-0
 # Zif is a re-implementation of yum in C, however:
@@ -91,6 +94,8 @@ Provides: yum-protect-packages = 1.1.27-0.yum
 Provides: yum-plugin-protect-packages = 1.1.27-0.yum
 Obsoletes: yum-plugin-download-order <= 0.2-2
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Obsoletes: yum-plugin-downloadonly <= 1.1.31-6.fc19
+Provides: yum-plugin-downloadonly = 3.4.3-44.yum
 
 
 %description
@@ -272,6 +277,7 @@ exit 0
 %{_sysconfdir}/bash_completion.d
 %dir %{_datadir}/yum-cli
 %{_datadir}/yum-cli/*
+%exclude %{_datadir}/yum-cli/completion-helper.py?
 %if %{yum_updatesd}
 %exclude %{_datadir}/yum-cli/yumupd.py*
 %endif
@@ -315,6 +321,10 @@ exit 0
 %endif
 
 %changelog
+* Tue Oct 23 2012 James Antill <james at fedoraproject.org> - 3.4.3-46
+- update to latest HEAD.
+- Minor upstream fixes, mainly for ppc64p7.
+
 * Tue Oct  2 2012 Zdenek Pavlas <zpavlas at redhat.com> - 3.4.3-45
 - update to latest HEAD.
 - Don't skip loadts new rpmdbv check, when transaction changes. BZ 857961


More information about the scm-commits mailing list