[yum-utils/f19] Update to latest HEAD

Zdeněk Pavlas zpavlas at fedoraproject.org
Wed Apr 17 15:21:15 UTC 2013


commit 7add1a4b31181472884944e9e4e8aaa7b8d8c50a
Author: Zdenek Pavlas <zpavlas at redhat.com>
Date:   Wed Apr 17 17:21:00 2013 +0200

    Update to latest HEAD

 yum-utils-HEAD.patch |  159 +++++++++++++++++++++++++++++++++++++++++++------
 yum-utils.spec       |   10 +++-
 2 files changed, 148 insertions(+), 21 deletions(-)
---
diff --git a/yum-utils-HEAD.patch b/yum-utils-HEAD.patch
index 22a3c1c..f60a1ac 100644
--- a/yum-utils-HEAD.patch
+++ b/yum-utils-HEAD.patch
@@ -127,7 +127,7 @@ index e77696a..d159169 100644
 +library.  If this is what you want to do, use the GNU Lesser General
  Public License instead of this License.
 diff --git a/debuginfo-install.py b/debuginfo-install.py
-index 177c6c3..27d19ac 100755
+index 177c6c3..4215700 100755
 --- a/debuginfo-install.py
 +++ b/debuginfo-install.py
 @@ -7,11 +7,11 @@
@@ -145,6 +145,17 @@ index 177c6c3..27d19ac 100755
  # Copyright 2007 Seth Vidal
  
  import sys
+@@ -156,6 +156,10 @@ class DebugInfoInstall(YumUtilBase):
+                                 self.di_try_install(deppo)
+                             except yum.Errors.InstallError, e:
+                                 self.logger.critical('Could not find debuginfo pkg for dependency package %s' % deppo)
++
++        for pkgname in u:
++            self.logger.critical('Could not find a pacakge for: %s' % pkgname)
++
+         #  This is kinda hacky, accessing the option from the plugins code
+         # but I'm not sure of a better way of doing it
+         if not self.no_debuginfo_plugin and self.tsInfo:
 diff --git a/docs/Makefile b/docs/Makefile
 index d01c1e4..13ea4e7 100644
 --- a/docs/Makefile
@@ -1271,10 +1282,63 @@ index 202c203..ce98583 100644
  def _pkglist_to_dict(pl, priority, addArch = False):
      out = dict()
 diff --git a/plugins/versionlock/versionlock.py b/plugins/versionlock/versionlock.py
-index 40756b2..69458cd 100644
+index 40756b2..dfe4dd3 100644
 --- a/plugins/versionlock/versionlock.py
 +++ b/plugins/versionlock/versionlock.py
-@@ -170,6 +170,7 @@ class VersionLockCommand:
+@@ -56,6 +56,23 @@ def _read_locklist():
+         raise PluginYumExit('Unable to read version lock configuration: %s' % e)
+     return locklist
+ 
++def _match(ent, patterns):
++    # there should be an API for this in Yum
++    (n, v, r, e, a) = splitFilename(ent)
++    for name in (
++        '%s' % n,
++        '%s.%s' % (n, a),
++        '%s-%s' % (n, v),
++        '%s-%s-%s' % (n, v, r),
++        '%s-%s-%s.%s' % (n, v, r, a),
++        '%s:%s-%s-%s.%s' % (e, n, v, r, a),
++        '%s-%s:%s-%s.%s' % (n, e, v, r, a),
++    ):
++        for pat in patterns:
++            if fnmatch.fnmatch(name, pat):
++                return True
++    return False
++
+ class VersionLockCommand:
+     created = 1247693044
+ 
+@@ -99,9 +116,13 @@ class VersionLockCommand:
+             if not pkgs:
+                 pkgs = base.pkgSack.returnPackages(patterns=extcmds)
+ 
++            done = set()
++            for ent in _read_locklist():
++                (n, v, r, e, a) = splitFilename(ent)
++                done.add((n, a, e, v, r))
++
+             fo = open(filename, 'a')
+             count = 0
+-            done = set()
+             for pkg in pkgs:
+                 #  We ignore arch, so only add one entry for foo-1.i386 and
+                 # foo-1.x86_64.
+@@ -155,12 +176,7 @@ class VersionLockCommand:
+             out = os.fdopen(out, 'w', -1)
+             count = 0
+             for ent in _read_locklist():
+-                found = False
+-                for match in extcmds:
+-                    if fnmatch.fnmatch(ent, match):
+-                        found = True
+-                        break
+-                if found:
++                if _match(ent, extcmds):
+                     print "Deleting versionlock for:", ent
+                     count += 1
+                     continue
+@@ -170,6 +186,7 @@ class VersionLockCommand:
              if not count:
                  os.unlink(tmpfilename)
                  return 1, ['Error: versionlock delete: no matches']
@@ -1387,7 +1451,7 @@ index e710d8c..e5aae1b 100755
                  continue
              for (req, flags, (reqe, reqv, reqr)) in pkg.returnPrco('requires'):
 diff --git a/repodiff.py b/repodiff.py
-index 67c162e..c16c03e 100755
+index 67c162e..003294c 100755
 --- a/repodiff.py
 +++ b/repodiff.py
 @@ -10,8 +10,8 @@
@@ -1418,13 +1482,15 @@ index 67c162e..c16c03e 100755
  class DiffYum(yum.YumBase):
      def __init__(self):
          yum.YumBase.__init__(self)
-@@ -43,8 +51,12 @@ class DiffYum(yum.YumBase):
+@@ -43,8 +51,14 @@ class DiffYum(yum.YumBase):
          # make our new repo obj
          newrepo = yum.yumRepo.YumRepository(repoid)
          newrepo.name = repoid
 -        newrepo.baseurl = [baseurl]
 +        if baseurl.startswith("mirror:"):
 +            newrepo.mirrorlist = baseurl[len("mirror:"):]
++        elif baseurl.startswith("/"):
++            newrepo.baseurl = ["file:" + baseurl]
 +        else:
 +            newrepo.baseurl = [baseurl]
          newrepo.basecachedir = self.dy_basecachedir
@@ -1432,7 +1498,7 @@ index 67c162e..c16c03e 100755
          newrepo.metadata_expire = 0
          newrepo.timestamp_check = False
          # add our new repo
-@@ -157,6 +169,8 @@ def parseArgs(args):
+@@ -157,6 +171,8 @@ def parseArgs(args):
                        help="When comparing binary repos. also compare the arch of packages, to see if they are different")
      parser.add_option("-s", "--size", default=False, action='store_true',
                        help="Output size changes for any new->old packages")
@@ -1441,7 +1507,7 @@ index 67c162e..c16c03e 100755
      parser.add_option("--simple",  default=False, action='store_true',
                        help="output simple format")
      (opts, argsleft) = parser.parse_args()
-@@ -177,6 +191,47 @@ def parseArgs(args):
+@@ -177,6 +193,47 @@ def parseArgs(args):
      
      return opts
  
@@ -1489,7 +1555,7 @@ index 67c162e..c16c03e 100755
  def main(args):
      opts = parseArgs(args)
  
-@@ -221,6 +276,11 @@ def main(args):
+@@ -221,6 +278,11 @@ def main(args):
      total_sizechange = 0
      add_sizechange = 0
      remove_sizechange = 0
@@ -1501,7 +1567,7 @@ index 67c162e..c16c03e 100755
      if ygh.add:
          for pkg in sorted(ygh.add):
              if opts.compare_arch:
-@@ -243,49 +303,32 @@ def main(args):
+@@ -243,49 +305,32 @@ def main(args):
      if ygh.modified:
          print '\nUpdated Packages:\n'
          for (pkg, oldpkg) in sorted(ygh.modified):
@@ -1574,7 +1640,7 @@ index 67c162e..c16c03e 100755
  
      if (not ygh.add and not ygh.remove and not ygh.modified and
          not my.pkgSack.searchNevra(arch='src')):
-@@ -294,11 +337,33 @@ def main(args):
+@@ -294,11 +339,33 @@ def main(args):
      print '\nSummary:'
      print 'Added Packages: %s' % len(ygh.add)
      print 'Removed Packages: %s' % len(ygh.remove)
@@ -1632,7 +1698,7 @@ index ff77e0d..bef3b03 100755
  # (c) Copyright Seth Vidal 2004
  
 diff --git a/repoquery.py b/repoquery.py
-index a3bb111..0d3e33c 100755
+index a3bb111..303ee3e 100755
 --- a/repoquery.py
 +++ b/repoquery.py
 @@ -8,11 +8,11 @@
@@ -2044,7 +2110,17 @@ index a3bb111..0d3e33c 100755
      if opts.repofrompath:
          # setup the fake repos
          for repo in opts.repofrompath:
-@@ -1359,6 +1469,13 @@ def main(args):
+@@ -1328,7 +1438,8 @@ def main(args):
+                 baseurl = repopath
+                 
+             repoq.add_enable_repo(repoid, baseurls=[baseurl], 
+-                    basecachedir=repoq.conf.cachedir)
++                                  basecachedir=repoq.conf.cachedir,
++                                  timestamp_check=False)
+             if not opts.quiet:
+                 repoq.logger.info( "Added %s repo from %s" % (repoid,repopath))
+ 
+@@ -1359,6 +1470,13 @@ def main(args):
      if opts.show_dupes:
          repoq.conf.showdupesfromrepos = True
              
@@ -2058,7 +2134,7 @@ index a3bb111..0d3e33c 100755
      if opts.repoid:
          found_repos = set()
          for repo in repoq.repos.findRepos('*'):
-@@ -1396,10 +1513,15 @@ def main(args):
+@@ -1396,10 +1514,15 @@ def main(args):
      except (yum.Errors.RepoError, yum.Errors.GroupsError), e:
          repoq.logger.error(e)
          sys.exit(1)
@@ -3270,7 +3346,7 @@ index 8a4888e..c50159e 100755
          args.pop(0)
          if args:
 diff --git a/yumdownloader.py b/yumdownloader.py
-index e6107d4..990ab85 100755
+index e6107d4..4c5eefb 100755
 --- a/yumdownloader.py
 +++ b/yumdownloader.py
 @@ -7,11 +7,11 @@
@@ -3288,7 +3364,15 @@ index e6107d4..990ab85 100755
  
  import sys
  import os
-@@ -31,6 +31,8 @@ import shutil
+@@ -22,6 +22,7 @@ import yum
+ from yum.misc import setup_locale
+ from yum.packages import parsePackages
+ from yum.Errors import RepoError
++from yum.i18n import exception2msg
+ from utils import YumUtilBase
+ 
+ from urlparse import urljoin
+@@ -31,6 +32,8 @@ import shutil
  import rpmUtils
  import logging
  
@@ -3297,7 +3381,29 @@ index e6107d4..990ab85 100755
  # This is to fix Bug 469
  # To convert from a pkg to a source pkg, we have a problem in that all we have
  # is "sourcerpm", which can be a different nevra ... but just to make it fun
-@@ -92,53 +94,27 @@ class YumDownloader(YumUtilBase):
+@@ -68,7 +71,11 @@ class YumDownloader(YumUtilBase):
+                           
+         # Add util commandline options to the yum-cli ones
+         self.optparser = self.getOptionParser() 
+-        self.main()
++        try:
++            self.main()
++        except (OSError, IOError), e:
++            self.logger.error(exception2msg(e))
++            sys.exit(1)
+ 
+     def main(self):
+         # Add command line option specific to yumdownloader
+@@ -77,7 +84,7 @@ class YumDownloader(YumUtilBase):
+         try:
+             opts = self.doUtilConfigSetup()
+         except yum.Errors.RepoError, e:
+-            self.logger.error(str(e))
++            self.logger.error(exception2msg(e))
+             sys.exit(50)
+                 
+         # Check if there is anything to do.
+@@ -92,53 +99,27 @@ class YumDownloader(YumUtilBase):
              
          # Setup yum (Ts, RPM db, Repo & Sack)
          self.doUtilYumSetup(opts)
@@ -3362,7 +3468,16 @@ index e6107d4..990ab85 100755
          
      def downloadPackages(self,opts):
          
-@@ -211,57 +187,35 @@ class YumDownloader(YumUtilBase):
+@@ -177,7 +158,7 @@ class YumDownloader(YumUtilBase):
+                     installable = self.returnPackagesByDep(pkg)
+                     installable = yum.misc.unique(installable)
+                 except yum.Errors.YumBaseError, msg:
+-                    self.logger.error(str(msg))
++                    self.logger.error(exception2msg(msg))
+                     continue
+ 
+             if not installable: # doing one at a time, apart from groups
+@@ -211,57 +192,35 @@ class YumDownloader(YumUtilBase):
              self.resolveDeps()
              # Add newly added packages to the toDownload list
              for pkg in self.tsInfo.getMembers():
@@ -3444,7 +3559,7 @@ index e6107d4..990ab85 100755
          return exit_code
                      
      def _groupPackages(self,pkglist):
-@@ -279,6 +233,9 @@ class YumDownloader(YumUtilBase):
+@@ -279,6 +238,9 @@ class YumDownloader(YumUtilBase):
          """do a default setup for all the normal/necessary yum components,
             really just a shorthand for testing"""
          try:
@@ -3454,8 +3569,12 @@ index e6107d4..990ab85 100755
              self._getRepos(doSetup = True)
              # if '--source' is used the add src to the archlist
              if opts.source:
-@@ -294,15 +251,8 @@ class YumDownloader(YumUtilBase):
-             self.logger.critical(str(msg))
+@@ -291,18 +253,11 @@ class YumDownloader(YumUtilBase):
+                 archlist = rpmUtils.arch.getArchList()
+             self._getSacks(archlist=archlist)
+         except yum.Errors.YumBaseError, msg:
+-            self.logger.critical(str(msg))
++            self.logger.critical(exception2msg(msg))
              sys.exit(1)
  
 -    def _removeEnabledSourceRepos(self):
diff --git a/yum-utils.spec b/yum-utils.spec
index 2151f5b..b2dec54 100644
--- a/yum-utils.spec
+++ b/yum-utils.spec
@@ -10,7 +10,7 @@
 Summary: Utilities based around the yum package manager
 Name: yum-utils
 Version: 1.1.31
-Release: 12%{?dist}
+Release: 13%{?dist}
 License: GPLv2+
 Group: Development/Tools
 Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz
@@ -677,6 +677,14 @@ fi
 %{pluginhome}/puppetverify.*
 
 %changelog
+* Wed Apr 17 2013 Zdenek Pavlas <zpavlas at redhat.com> - 1.1.31-13
+- Update to latest HEAD
+- versionlock add: Skip packages already locked.
+- versionlock delete: Match all names, not just envra.
+- Allow --old=/foo urls for repodiff.
+- Don't check timestamps for repofrompath repos. BZ 880944
+- Output couldn't find a pkg. for 'foo'. BZ 838158
+
 * Tue Mar 12 2013 James Antill <james at fedoraproject.org> - 1.1.31-12
 - Update to latest HEAD.
 - FS snapshot tweaks for snapper support.


More information about the scm-commits mailing list