[yum-utils] Update to latest HEAD

Zdeněk Pavlas zpavlas at fedoraproject.org
Fri Jan 10 10:39:26 UTC 2014


commit dc7481d0bd002b3dbec9c4f2a9a374d06577167b
Author: Zdenek Pavlas <zpavlas at redhat.com>
Date:   Fri Jan 10 11:39:33 2014 +0100

    Update to latest HEAD
    
    - post-transaction-actions: no rpmdb lookup of removed pkgs. BZ 1045494
    - yum-config-manager: Fail grecefully with garbage in *.repo files. BZ 1046161
    - repodiff: Use "C" locale for timestamps. BZ 1050885

 yum-utils-HEAD.patch |   65 ++++++++++++++++++++++++++++++++++++++++++-------
 yum-utils.spec       |    8 +++++-
 2 files changed, 62 insertions(+), 11 deletions(-)
---
diff --git a/yum-utils-HEAD.patch b/yum-utils-HEAD.patch
index 879f5a4..d4c6984 100644
--- a/yum-utils-HEAD.patch
+++ b/yum-utils-HEAD.patch
@@ -2454,6 +2454,23 @@ index c45a1ce..cab69c5 100644
          return
  
      conf_fname = '/etc/yum.repos.d/_local.repo'
+diff --git a/plugins/post-transaction-actions/post-transaction-actions.py b/plugins/post-transaction-actions/post-transaction-actions.py
+index b4da1ce..a9759ff 100644
+--- a/plugins/post-transaction-actions/post-transaction-actions.py
++++ b/plugins/post-transaction-actions/post-transaction-actions.py
+@@ -129,9 +129,10 @@ def posttrans_hook(conduit):
+ 
+             for txmbr in pkgset:
+                 matched = False
+-                #print '%s - %s' % txmbr.name, txmbr.ts_state
+-                if txmbr.po.state in TS_INSTALL_STATES:
++                if txmbr.output_state in TS_INSTALL_STATES:
+                     thispo = _get_installed_po(rpmdb, txmbr.pkgtup)
++                else:
++                    continue
+         
+                 if not yum.misc.re_glob(a_k):
+                     if a_k in thispo.filelist + thispo.dirlist + thispo.ghostlist:
 diff --git a/plugins/priorities/priorities.py b/plugins/priorities/priorities.py
 index 202c203..ce98583 100644
 --- a/plugins/priorities/priorities.py
@@ -3617,7 +3634,7 @@ index e710d8c..f895f84 100755
 -        
 +        sys.exit(2)
 diff --git a/repodiff.py b/repodiff.py
-index 67c162e..21be5af 100755
+index 67c162e..5ae1d8f 100755
 --- a/repodiff.py
 +++ b/repodiff.py
 @@ -10,8 +10,8 @@
@@ -3749,7 +3766,9 @@ index 67c162e..21be5af 100755
 -            if opts.simple:
 -                if opts.compare_arch:
 -                    msg = "%s: %s ->  %s" % (pkg.name, oldpkg, pkg)
--                else:
++                if opts.downgrade:
++                    up_sizechange += sizechange
+                 else:
 -                    msg = "%s: %s-%s-%s ->  %s-%s-%s" % (pkg.name, oldpkg.name, 
 -                                                         oldpkg.ver, oldpkg.rel,
 -                                                         pkg.name, pkg.ver,
@@ -3757,9 +3776,7 @@ index 67c162e..21be5af 100755
 -            else:
 -                if opts.compare_arch:
 -                    msg = "%s" % pkg
-+                if opts.downgrade:
-+                    up_sizechange += sizechange
-                 else:
+-                else:
 -                    msg = "%s-%s-%s" % (pkg.name, pkg.ver, pkg.rel)
 -                dashes = "-" * len(msg) 
 -                msg += "\n%s\n" % dashes
@@ -3806,7 +3823,7 @@ index 67c162e..21be5af 100755
  
      if (not ygh.add and not ygh.remove and not ygh.modified and
          not my.pkgSack.searchNevra(arch='src')):
-@@ -294,11 +339,34 @@ def main(args):
+@@ -294,28 +339,36 @@ def main(args):
      print '\nSummary:'
      print 'Added Packages: %s' % len(ygh.add)
      print 'Removed Packages: %s' % len(ygh.remove)
@@ -3845,6 +3862,24 @@ index 67c162e..21be5af 100755
      
        
  if __name__ == "__main__":
+-    # This test needs to be before locale.getpreferredencoding() as that
+-    # does setlocale(LC_CTYPE, "")
+-    try:
+-        locale.setlocale(locale.LC_ALL, '')
+-    except locale.Error, e:
+-        # default to C locale if we get a failure.
+-        print >> sys.stderr, 'Failed to set locale, defaulting to C'
+-        os.environ['LC_ALL'] = 'C'
+-        locale.setlocale(locale.LC_ALL, 'C')
+-        
+-    if True: # not sys.stdout.isatty():
+-        import codecs
+-        sys.stdout = codecs.getwriter(locale.getpreferredencoding())(sys.stdout)
+-        sys.stdout.errors = 'replace'
+-
++    yum.misc.setup_locale(override_time=True)
+     main(sys.argv[1:])
+-    
 diff --git a/repomanage.py b/repomanage.py
 index ff77e0d..bef3b03 100755
 --- a/repomanage.py
@@ -4954,7 +4989,7 @@ index c5074ab..6b01e4e 100755
  
  
 diff --git a/yum-config-manager.py b/yum-config-manager.py
-index 50f5123..08c17db 100755
+index 50f5123..bc96b55 100755
 --- a/yum-config-manager.py
 +++ b/yum-config-manager.py
 @@ -9,6 +9,8 @@ from utils import YumUtilBase
@@ -4966,7 +5001,17 @@ index 50f5123..08c17db 100755
  
  from yum.parser import varReplace
  
-@@ -153,7 +155,7 @@ if (not args and not opts.addrepo) or 'main' in args:
+@@ -122,7 +124,8 @@ group.add_option("--add-repo", default=[], dest='addrepo', action='append',
+           help='add (and enable) the repo from the specified file or url')
+ try:
+     opts = yb.doUtilConfigSetup()
+-except yum.Errors.RepoError, e:
++    yb.repos
++except yum.Errors.YumBaseError, e:
+     logger.error(str(e))
+     sys.exit(50)
+ 
+@@ -153,7 +156,7 @@ if (not args and not opts.addrepo) or 'main' in args:
          ybc = yb.conf
          writeRawConfigFile(fn, 'main', ybc.yumvar,
                             ybc.cfg.options, ybc.iteritems, ybc.optionobj,
@@ -4975,7 +5020,7 @@ index 50f5123..08c17db 100755
  
  if opts.enable or opts.disable:
      opts.save = True
-@@ -161,7 +163,8 @@ if opts.enable or opts.disable:
+@@ -161,7 +164,8 @@ if opts.enable or opts.disable:
          only = ['enabled']
  
  if args:
@@ -4985,7 +5030,7 @@ index 50f5123..08c17db 100755
  else:
      repos = yb.repos.listEnabled()
  
-@@ -196,13 +199,16 @@ if opts.addrepo:
+@@ -196,13 +200,16 @@ if opts.addrepo:
          if url.endswith('.repo'): # this is a .repo file - fetch it, put it in our reposdir and enable it
              destname = os.path.basename(url)
              destname = myrepodir + '/' + destname
diff --git a/yum-utils.spec b/yum-utils.spec
index 0bfb765..b8214e2 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: 19%{?dist}
+Release: 20%{?dist}
 License: GPLv2+
 Group: Development/Tools
 Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz
@@ -663,6 +663,12 @@ fi
 %{pluginhome}/puppetverify.*
 
 %changelog
+* Fri Jan 10 2014 Zdenek Pavlas <zpavlas at redhat.com> - 1.1.31-20
+- Update to latest HEAD
+- post-transaction-actions: no rpmdb lookup of removed pkgs. BZ 1045494
+- yum-config-manager: Fail grecefully with garbage in *.repo files. BZ 1046161
+- repodiff: Use "C" locale for timestamps. BZ 1050885
+
 * Fri Dec 13 2013 Zdenek Pavlas <zpavlas at redhat.com> - 1.1.31-19
 - Update to latest HEAD
 - Don't remove pkgs which are already removals (Eg. via. updates). BZ 1013475.


More information about the scm-commits mailing list