[yum] update to latest HEAD Tweak "yum provides" Don't access the repos. for saved_tx, if doing a removal.

James Antill james at fedoraproject.org
Tue May 24 21:30:04 UTC 2011


commit 0cd36c086975457488ba4829a4b747d2240ce3cb
Author: James Antill <james at and.org>
Date:   Tue May 24 17:26:50 2011 -0400

    update to latest HEAD
    Tweak "yum provides"
    Don't access the repos. for saved_tx, if doing a removal.
    Fix a couple of old minor bugs:
    Remove usage of INFO_* from yumcommands, as -q supresses that. BZ 689241.
    Don't show depsolve failure messages for non-depsolving problems. BZ 597336.

 yum-HEAD.patch |  194 ++++++++++++++++++++++++++++++++++++++++++++++++++++----
 yum.spec       |   10 +++-
 2 files changed, 191 insertions(+), 13 deletions(-)
---
diff --git a/yum-HEAD.patch b/yum-HEAD.patch
index a323e8b..99dd54c 100644
--- a/yum-HEAD.patch
+++ b/yum-HEAD.patch
@@ -1,3 +1,39 @@
+diff --git a/cli.py b/cli.py
+index 957c182..f4bd7b1 100644
+--- a/cli.py
++++ b/cli.py
+@@ -1143,17 +1143,23 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+         cb = self.matchcallback_verbose
+         matching = self.searchPackageProvides(args, callback=cb,
+                                               callback_has_matchfor=True)
+-        self.conf.showdupesfromrepos = old_sdup
+-        
+         if len(matching) == 0:
++            #  Try to be a bit clever, for commands, and python modules.
++            # Maybe want something so we can do perl/etc. too?
++            paths = set(sys.path + os.environ['PATH'].split(':'))
++            nargs = []
+             for arg in args:
+-                if '*' in arg or (arg and arg[0] == '/'):
++                if yum.misc.re_filename(arg) or yum.misc.re_glob(arg):
+                     continue
+-                self.logger.warning(_('Warning: 3.0.x versions of yum would erroneously match against filenames.\n You can use "%s*/%s%s" and/or "%s*bin/%s%s" to get that behaviour'),
+-                                    self.term.MODE['bold'], arg,
+-                                    self.term.MODE['normal'],
+-                                    self.term.MODE['bold'], arg,
+-                                    self.term.MODE['normal'])
++                for path in paths:
++                    if not path:
++                        continue
++                    nargs.append("%s/%s" % (path, arg))
++            matching = self.searchPackageProvides(nargs, callback=cb,
++                                                  callback_has_matchfor=True)
++        self.conf.showdupesfromrepos = old_sdup
++
++        if len(matching) == 0:
+             return 0, ['No Matches found']
+         
+         return 0, []
 diff --git a/docs/yum.8 b/docs/yum.8
 index 522f15f..1b5d161 100644
 --- a/docs/yum.8
@@ -47,6 +83,21 @@ index 522f15f..1b5d161 100644
  
  The addon-info command takes a transaction ID, and the packages-list command
  takes a package (with wildcards).
+diff --git a/docs/yum.conf.5 b/docs/yum.conf.5
+index e6037c2..bebc050 100644
+--- a/docs/yum.conf.5
++++ b/docs/yum.conf.5
+@@ -492,8 +492,8 @@ bugtrackers.
+ 
+ .IP
+ \fBcolor \fR
+-Display colorized output automatically, depending on the output terminal,
+-always (using ANSI codes) or never.
++Whether to display colorized output automatically, depending on the output
++terminal, can be changed to always (using ANSI codes) or never.
+ Default is `auto'.
+ Possible values are: auto, never, always.
+ Command-line option: \fB\-\-color\fP
 diff --git a/etc/yum.bash b/etc/yum.bash
 index 31f0c83..f1e06e8 100644
 --- a/etc/yum.bash
@@ -129732,7 +129783,7 @@ index cdb1cb6..aea4550 100644
      """Takes a transaction set and a package, check it's sigs, 
      return 0 if they are all fine
 diff --git a/yum/__init__.py b/yum/__init__.py
-index 1291da9..740273e 100644
+index 1291da9..61c71cf 100644
 --- a/yum/__init__.py
 +++ b/yum/__init__.py
 @@ -726,7 +726,10 @@ class YumBase(depsolve.Depsolve):
@@ -129747,7 +129798,45 @@ index 1291da9..740273e 100644
              obs_init = time.time()    
              #  Note: newest=True here is semi-required for repos. with multiple
              # versions. The problem is that if pkgA-2 _accidentally_ obsoletes
-@@ -3183,7 +3186,23 @@ class YumBase(depsolve.Depsolve):
+@@ -997,6 +1000,10 @@ class YumBase(depsolve.Depsolve):
+         if self.tsInfo.pkgSack is not None: # rm Transactions don't have pkgSack
+             self.tsInfo.pkgSack.dropCachedData()
+ 
++        # FIXME: This is horrible, see below and yummain. Maybe create a real
++        #        rescode object? :(
++        self._depsolving_failed = rescode == 1
++
+         txmbrs = []
+         if rescode == 2 and self.conf.protected_multilib and self.arch.multilib:
+             txmbrs = self.tsInfo.getMembersWithState(None, TS_INSTALL_STATES)
+@@ -1033,6 +1040,7 @@ class YumBase(depsolve.Depsolve):
+                 xrestring.append(msg % (first, other))
+         if xrestring:
+             rescode = 1
++            self._depsolving_failed = False
+             restring = xrestring
+ 
+         #  This is a version of the old "protect-packages" plugin, it allows
+@@ -1085,6 +1093,7 @@ class YumBase(depsolve.Depsolve):
+             for pkgname in sorted(bad_togo):
+                 restring.append(_('Trying to remove "%s", which is protected') %
+                                 pkgname)
++            self._depsolving_failed = False
+ 
+         if rescode == 2:
+             self.save_ts(auto=True)
+@@ -2688,9 +2697,7 @@ class YumBase(depsolve.Depsolve):
+                 where = self.returnInstalledPackagesByDep(arg)
+                 usedDepString = True
+                 for po in where:
+-                    tmpvalues = []
+-                    msg = _('Provides-match: %s') % to_unicode(arg)
+-                    tmpvalues.append(msg)
++                    tmpvalues = [arg]
+ 
+                     if len(tmpvalues) > 0:
+                         if callback:
+@@ -3183,7 +3190,23 @@ class YumBase(depsolve.Depsolve):
      def _pkg2obspkg(self, po):
          """ Given a package return the package it's obsoleted by and so
              we should install instead. Or None if there isn't one. """
@@ -129772,7 +129861,7 @@ index 1291da9..740273e 100644
          if po.pkgtup in thispkgobsdict:
              obsoleting  = thispkgobsdict[po.pkgtup]
              oobsoleting = []
-@@ -3316,10 +3335,19 @@ class YumBase(depsolve.Depsolve):
+@@ -3316,10 +3339,19 @@ class YumBase(depsolve.Depsolve):
                      installed_pkg =  self.getInstalledPackageObject(inst_tup)
                      yield installed_pkg
          else:
@@ -129796,7 +129885,7 @@ index 1291da9..740273e 100644
  
      def _add_prob_flags(self, *flags):
          """ Add all of the passed flags to the tsInfo.probFilterFlags array. """
-@@ -3466,7 +3494,8 @@ class YumBase(depsolve.Depsolve):
+@@ -3466,7 +3498,8 @@ class YumBase(depsolve.Depsolve):
                      continue
              
              # make sure this shouldn't be passed to update:
@@ -129806,7 +129895,7 @@ index 1291da9..740273e 100644
                  txmbrs = self.update(po=po)
                  tx_return.extend(txmbrs)
                  continue
-@@ -3474,7 +3503,9 @@ class YumBase(depsolve.Depsolve):
+@@ -3474,7 +3507,9 @@ class YumBase(depsolve.Depsolve):
              #  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.
@@ -129817,7 +129906,7 @@ index 1291da9..740273e 100644
              if obsoleting_pkg is not None:
                  # this is not a definitive check but it'll make sure we don't
                  # pull in foo.i586 when foo.x86_64 already obsoletes the pkg and
-@@ -3543,8 +3574,9 @@ class YumBase(depsolve.Depsolve):
+@@ -3543,8 +3578,9 @@ class YumBase(depsolve.Depsolve):
                      break
              
              # it doesn't obsolete anything. If it does, mark that in the tsInfo, too
@@ -129829,6 +129918,23 @@ index 1291da9..740273e 100644
                      txmbr = self.tsInfo.addObsoleting(po, obsoletee)
                      self.tsInfo.addObsoleted(obsoletee, po)
                      tx_return.append(txmbr)
+@@ -5095,9 +5131,13 @@ class YumBase(depsolve.Depsolve):
+         
+         msg = "%s\n" % self.rpmdb.simpleVersion(main_only=True)[0]
+         msg += "%s\n" % self.ts.getTsFlags()
+-        msg += "%s\n" % len(self.repos.listEnabled())
+-        for r in self.repos.listEnabled():
+-            msg += "%s:%s:%s\n" % (r.id, len(r.sack), r.repoXML.revision)
++        if self.tsInfo.pkgSack is None: # rm Transactions don't have pkgSack
++            msg += "0\n"
++        else:
++            msg += "%s\n" % len(self.repos.listEnabled())
++            for r in self.repos.listEnabled():
++                msg += "%s:%s:%s\n" % (r.id, len(r.sack), r.repoXML.revision)
++
+         msg += "%s\n" % len(self.tsInfo.getMembers())
+         for txmbr in self.tsInfo.getMembers():
+             msg += txmbr._dump()
 diff --git a/yum/packages.py b/yum/packages.py
 index 264aa9a..95c50a1 100644
 --- a/yum/packages.py
@@ -129860,9 +129966,18 @@ index 264aa9a..95c50a1 100644
                  for i in mylist:
                      if i[0].startswith('libc.so.6') and i != best:
 diff --git a/yumcommands.py b/yumcommands.py
-index d3014c5..fb70f3e 100644
+index d3014c5..a950011 100644
 --- a/yumcommands.py
 +++ b/yumcommands.py
+@@ -158,7 +158,7 @@ class YumCommand:
+ 
+     def doneCommand(self, base, msg, *args):
+         if not self.done_command_once:
+-            base.verbose_logger.log(logginglevels.INFO_2, msg, *args)
++            base.verbose_logger.info(msg, *args)
+         self.done_command_once = True
+ 
+     def getNames(self):
 @@ -1017,6 +1017,10 @@ class RepoListCommand(YumCommand):
                          out += [base.fmtKeyValFill(_("Repo-excluded: "),
                                                     ui_excludes_num)]
@@ -129874,7 +129989,44 @@ index d3014c5..fb70f3e 100644
                      base.verbose_logger.log(logginglevels.DEBUG_3,
                                              "%s\n",
                                              "\n".join(map(misc.to_unicode, out)))
-@@ -1350,7 +1354,7 @@ class HistoryCommand(YumCommand):
+@@ -1056,14 +1060,14 @@ class RepoListCommand(YumCommand):
+             txt_rid  = utf8_width_fill(_('repo id'), id_len)
+             txt_rnam = utf8_width_fill(_('repo name'), nm_len, nm_len)
+             if arg == 'disabled': # Don't output a status column.
+-                base.verbose_logger.log(logginglevels.INFO_2,"%s %s",
++                base.verbose_logger.info("%s %s",
+                                         txt_rid, txt_rnam)
+             else:
+-                base.verbose_logger.log(logginglevels.INFO_2,"%s %s %s",
++                base.verbose_logger.info("%s %s %s",
+                                         txt_rid, txt_rnam, _('status'))
+             for (rid, rname, (ui_enabled, ui_endis_wid), ui_num) in cols:
+                 if arg == 'disabled': # Don't output a status column.
+-                    base.verbose_logger.log(logginglevels.INFO_2, "%s %s",
++                    base.verbose_logger.info("%s %s",
+                                             utf8_width_fill(rid, id_len),
+                                             utf8_width_fill(rname, nm_len,
+                                                             nm_len))
+@@ -1071,7 +1075,7 @@ class RepoListCommand(YumCommand):
+ 
+                 if ui_num:
+                     ui_num = utf8_width_fill(ui_num, ui_len, left=False)
+-                base.verbose_logger.log(logginglevels.INFO_2, "%s %s %s%s",
++                base.verbose_logger.info("%s %s %s%s",
+                                         utf8_width_fill(rid, id_len),
+                                         utf8_width_fill(rname, nm_len, nm_len),
+                                         ui_enabled, ui_num)
+@@ -1140,8 +1144,7 @@ class HelpCommand(YumCommand):
+     def doCommand(self, base, basecmd, extcmds):
+         if extcmds[0] in base.yum_cli_commands:
+             command = base.yum_cli_commands[extcmds[0]]
+-            base.verbose_logger.log(logginglevels.INFO_2,
+-                    self._makeOutput(command))
++            base.verbose_logger.info(self._makeOutput(command))
+         return 0, []
+ 
+     def needTs(self, base, basecmd, extcmds):
+@@ -1350,7 +1353,7 @@ class HistoryCommand(YumCommand):
          return ['history']
  
      def getUsage(self):
@@ -129883,7 +130035,7 @@ index d3014c5..fb70f3e 100644
  
      def getSummary(self):
          return _("Display, or use, the transaction history")
-@@ -1375,11 +1379,52 @@ class HistoryCommand(YumCommand):
+@@ -1375,11 +1378,52 @@ class HistoryCommand(YumCommand):
          if base.history_undo(old):
              return 2, ["Undoing transaction %u" % (old.tid,)]
  
@@ -129936,7 +130088,7 @@ index d3014c5..fb70f3e 100644
                  'addon', 'addon-info',
                  'pkg', 'pkgs', 'pkg-list', 'pkgs-list',
                  'package', 'package-list', 'packages', 'packages-list')
-@@ -1387,7 +1432,7 @@ class HistoryCommand(YumCommand):
+@@ -1387,7 +1431,7 @@ class HistoryCommand(YumCommand):
              base.logger.critical(_('Invalid history sub-command, use: %s.'),
                                   ", ".join(cmds))
              raise cli.CliError
@@ -129945,7 +130097,7 @@ index d3014c5..fb70f3e 100644
              checkRootUID(base)
              checkGPGKey(base)
          elif not os.access(base.history._db_file, os.R_OK):
-@@ -1415,6 +1460,8 @@ class HistoryCommand(YumCommand):
+@@ -1415,6 +1459,8 @@ class HistoryCommand(YumCommand):
              ret = self._hcmd_undo(base, extcmds)
          elif vcmd in ('redo', 'repeat'):
              ret = self._hcmd_redo(base, extcmds)
@@ -129954,7 +130106,7 @@ index d3014c5..fb70f3e 100644
          elif vcmd == 'new':
              ret = self._hcmd_new(base, extcmds)
  
-@@ -1426,7 +1473,7 @@ class HistoryCommand(YumCommand):
+@@ -1426,7 +1472,7 @@ class HistoryCommand(YumCommand):
          vcmd = 'list'
          if extcmds:
              vcmd = extcmds[0]
@@ -129963,3 +130115,21 @@ index d3014c5..fb70f3e 100644
  
  
  class CheckRpmdbCommand(YumCommand):
+diff --git a/yummain.py b/yummain.py
+index 1b94153..ea85926 100755
+--- a/yummain.py
++++ b/yummain.py
+@@ -189,9 +189,10 @@ def main(args):
+             prefix = _('Error: %s')
+             prefix2nd = (' ' * (utf8_width(prefix) - 2))
+             logger.critical(prefix, msg.replace('\n', '\n' + prefix2nd))
+-        if not base.conf.skip_broken:
+-            verbose_logger.info(_(" You could try using --skip-broken to work around the problem"))
+-        rpmdb_warn_checks()
++        if base._depsolving_failed:
++            if not base.conf.skip_broken:
++                verbose_logger.info(_(" You could try using --skip-broken to work around the problem"))
++            rpmdb_warn_checks()
+         if unlock(): return 200
+         return 1
+     elif result == 2:
diff --git a/yum.spec b/yum.spec
index b60c20d..200d6a8 100644
--- a/yum.spec
+++ b/yum.spec
@@ -7,7 +7,7 @@
 Summary: RPM package installer/updater/manager
 Name: yum
 Version: 3.4.1
-Release: 2%{?dist}
+Release: 3%{?dist}
 License: GPLv2+
 Group: System Environment/Base
 Source0: http://yum.baseurl.org/download/3.2/%{name}-%{version}.tar.gz
@@ -246,6 +246,14 @@ exit 0
 %config(noreplace) %{_sysconfdir}/sysconfig/yum-cron
 
 %changelog
+* Tue May 24 2011 James Antill <james at fedoraproject.org> - 3.4.1-3
+- update to latest HEAD
+- Tweak "yum provides"
+- Don't access the repos. for saved_tx, if doing a removal.
+- Fix a couple of old minor bugs:
+- Remove usage of INFO_* from yumcommands, as -q supresses that. BZ 689241.
+- Don't show depsolve failure messages for non-depsolving problems. BZ 597336.
+
 * Wed May  4 2011 James Antill <james at fedoraproject.org> - 3.4.1-2
 - update to latest HEAD
 - Fix consolidate_libc.


More information about the scm-commits mailing list