]> git.pld-linux.org Git - packages/yum.git/commitdiff
Merge patches from rpm5-yum project https://launchpad.net/yum auto/th/yum-3.4.3-5
authorElan Ruusamäe <glen@delfi.ee>
Sat, 27 Apr 2013 15:51:09 +0000 (18:51 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Sat, 27 Apr 2013 15:51:48 +0000 (18:51 +0300)
rpm5-yum.patch [new file with mode: 0644]
yum.spec

diff --git a/rpm5-yum.patch b/rpm5-yum.patch
new file mode 100644 (file)
index 0000000..430f8ec
--- /dev/null
@@ -0,0 +1,159 @@
+Picked patches from https://launchpad.net/yum
+
+git format-patch a4e20ff..1e37441
+
+From 15668d841c7a25bafa16be40c62e02c902ff2d9d Mon Sep 17 00:00:00 2001
+From: Nigel Kukard <nkukard@lbsd.net>
+Date: Mon, 31 Jan 2011 21:41:23 +0000
+Subject: [PATCH 1/5] Check for empty list in self._prco_lookup
+
+If we have an empty list, initialize aswell.
+---
+ yum/packages.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/yum/packages.py b/yum/packages.py
+index 60d4dfb..ee7e8bb 100644
+--- a/yum/packages.py
++++ b/yum/packages.py
+@@ -342,7 +342,7 @@ class RpmBase(object):
+             if prcotuple in self.prco[prcotype]:
+                 return 1
+         else:
+-            if not hasattr(self, '_prco_lookup'):
++            if not hasattr(self, '_prco_lookup') or not self._prco_lookup:
+                 self._prco_lookup = {'obsoletes' : None, 'conflicts' : None,
+                                      'requires'  : None, 'provides'  : None}
+-- 
+1.8.2.1
+
+From bfba6ec95abfb4de93010a00d03ea92b9c41140e Mon Sep 17 00:00:00 2001
+From: Nigel Kukard <nkukard@lbsd.net>
+Date: Mon, 31 Jan 2011 21:44:55 +0000
+Subject: [PATCH 2/5] If there is no RPMSENSE_PREREQ , just continue on
+
+---
+ yum/packages.py | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- yum-3.4.3/yum/packages.py  2013-04-27 18:25:45.901697548 +0300
++++ yum-rpm5/yum/packages.py   2013-04-15 08:46:43.772604716 +0300
+@@ -1523,6 +1523,9 @@
+         # - that's what it is
+         newflag = flag
+         if flag is not None:
++            # If there is no RPMSENSE_PREREQ just return
++            if not hasattr(rpm, 'RPMSENSE_PREREQ'):
++                return 0
+             newflag = flag & rpm.RPMSENSE_PREREQ
+             if newflag == rpm.RPMSENSE_PREREQ:
+                 return 1
+-- 
+1.8.2.1
+
+From 01acc94570b866a06de0f143ee8392ca3cfd08aa Mon Sep 17 00:00:00 2001
+From: Nigel Kukard <nkukard@lbsd.net>
+Date: Tue, 1 Feb 2011 07:28:17 +0000
+Subject: [PATCH 3/5] Workaround for the issue of idx.count() vs. for hdr in
+ idx
+
+---
+ yum/config.py | 16 +++++++++++-----
+ 1 file changed, 11 insertions(+), 5 deletions(-)
+
+--- yum-3.4.3/yum/config.py    2013-04-27 18:30:20.430303907 +0300
++++ yum-rpm5/yum/config.py     2013-04-15 08:46:43.769271228 +0300
+@@ -1166,18 +1015,22 @@
+     except rpm.error, e:
+         # This is the "new" code for "cannot open rpmdb", 4.8.0 ish
+         raise Errors.YumBaseError("Error: " + str(e))
++
++    # NK: The previous use if idx.count() did not work, as per rpmmi-py.c
++    # comments, use 'for hdr in idx' method of gettind hdr instead
++
++    # set '$releasever' by default
++    releasever = '$releasever'
++
+     # we're going to take the first one - if there is more than one of these
+     # then the user needs a beating
+-    if idx.count() == 0:
+-        releasever = None
+-    else:
+-        try:
+-            hdr = idx.next()
+-        except StopIteration:
+-            raise Errors.YumBaseError("Error: rpmdb failed release provides. Try: rpm --rebuilddb")
++    for hdr in idx:
+         releasever = hdr['version']
+-        del hdr
++        break
++
++    # /NK
++
+     del idx
+     del ts
+     return releasever
+-- 
+1.8.2.1
+
+From 80e24f1607e19edada799bee1ed609a3b173c288 Mon Sep 17 00:00:00 2001
+From: Nigel Kukard <nkukard@lbsd.net>
+Date: Tue, 1 Feb 2011 17:55:29 +0000
+Subject: [PATCH 4/5] Make sure we take empty lists into account
+
+Patch from Anders F Bj?rklund
+---
+ yum/packages.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/yum/packages.py b/yum/packages.py
+index fcfab36..51b0c09 100644
+--- a/yum/packages.py
++++ b/yum/packages.py
+@@ -561,7 +561,7 @@ class YumAvailablePackage(PackageObject, RpmBase):
+     def _committer(self):
+         "Returns the name of the last person to do a commit to the changelog."
+-        if hasattr(self, '_committer_ret'):
++        if hasattr(self, '_committer_ret') and self._committer_ret != []:
+             return self._committer_ret
+         def _nf2ascii(x):
+@@ -589,7 +589,7 @@ class YumAvailablePackage(PackageObject, RpmBase):
+     def _committime(self):
+         "Returns the time of the last commit to the changelog."
+-        if hasattr(self, '_committime_ret'):
++        if hasattr(self, '_committime_ret') and self._committime_ret != []:
+             return self._committime_ret
+         if not len(self.changelog): # Empty changelog is _possible_ I guess
+-- 
+1.8.2.1
+
+From 1e374417c51827680e5d33791b3fba91cf3c259f Mon Sep 17 00:00:00 2001
+From: Nigel Kukard <nkukard@lbsd.net>
+Date: Tue, 1 Feb 2011 17:57:06 +0000
+Subject: [PATCH 5/5] Handle microseconds in time correctly
+
+We may get microseconds back aswell, treat them properly
+---
+ cli.py | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+--- yum-3.4.3/cli.py   2013-04-27 18:33:42.852536274 +0300
++++ yum-rpm5/cli.py    2013-04-27 18:35:07.106267113 +0300
+@@ -310,7 +310,10 @@
+             yum_progs = self.run_with_package_names
+             done = False
+             def sm_ui_time(x):
+-                return time.strftime("%Y-%m-%d %H:%M", time.gmtime(x))
++                if isinstance(x, list):
++                    return time.strftime("%Y-%m-%d %H:%M", time.gmtime(x[0]))
++                else:
++                    return time.strftime("%Y-%m-%d %H:%M", time.gmtime(x))
+             def sm_ui_date(x): # For changelogs, there is no time
+                 return time.strftime("%Y-%m-%d", time.gmtime(x))
+             for pkg in sorted(self.rpmdb.returnPackages(patterns=yum_progs)):
index 474042aaf385923ce4268d64b757831be38eec62..62ae97b62557268e7dbbf6642c95d2ae2c9229b2 100644 (file)
--- a/yum.spec
+++ b/yum.spec
@@ -8,7 +8,7 @@ Summary:        RPM installer/updater
 Summary(pl.UTF-8):     Narzędzie do instalowania/uaktualniania pakietów RPM
 Name:          yum
 Version:       3.4.3
-Release:       4
+Release:       5
 License:       GPL v2+
 Group:         Applications/System
 Source0:       http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz
@@ -17,6 +17,7 @@ Source1:      %{name}-pld-source.repo
 Source2:       %{name}-pld-ti-source.repo
 # from util-vserver-*/contrib/
 #Patch:                %{name}-chroot.patch # disabled for now. broken or not needed
+Patch0:                rpm5-yum.patch
 Patch1:                %{name}-obsoletes.patch
 Patch2:                cli-pyc.patch
 Patch3:                %{name}-pld.patch
@@ -103,6 +104,7 @@ bash-completion for Yum.
 %patch7 -p1
 %patch8 -p1
 %patch9 -p1
+%patch0 -p1
 
 %build
 %{__make}
This page took 0.0914 seconds and 4 git commands to generate.