[packages/yum: 1/3] Picked patches from rpm5-yum project https://launchpad.net/yum
glen
glen at pld-linux.org
Sat Apr 27 17:52:06 CEST 2013
commit 1ab9b70d675ea3da41279bac7013c105afdf1a80
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Sat Apr 27 18:26:29 2013 +0300
Picked patches from rpm5-yum project https://launchpad.net/yum
rpm5-yum.patch | 162 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
yum.spec | 4 +-
2 files changed, 165 insertions(+), 1 deletion(-)
---
diff --git a/yum.spec b/yum.spec
index 474042a..8da7f17 100644
--- 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: 4.1
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
@@ -94,6 +95,7 @@ bash-completion for Yum.
%patch14 -p1
%patch15 -p1
# pld
+%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
diff --git a/rpm5-yum.patch b/rpm5-yum.patch
new file mode 100644
index 0000000..b2d20d6
--- /dev/null
+++ b/rpm5-yum.patch
@@ -0,0 +1,162 @@
+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 at 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 at 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(+)
+
+diff --git a/yum/packages.py b/yum/packages.py
+index ee7e8bb..fcfab36 100644
+--- a/yum/packages.py
++++ b/yum/packages.py
+@@ -1142,6 +1142,8 @@ class YumHeaderPackage(YumAvailablePackage):
+ # - that's what it is
+ newflag = flag
+ if flag is not None:
++ 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 at 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(-)
+
+diff --git a/yum/config.py b/yum/config.py
+index ebe4b51..b4d98f7 100644
+--- a/yum/config.py
++++ b/yum/config.py
+@@ -846,14 +846,20 @@ def _getsysver(installroot, distroverpkg):
+ ts = rpmUtils.transaction.initReadOnlyTransaction(root=installroot)
+ ts.pushVSFlags(~(rpm._RPMVSF_NOSIGNATURES|rpm._RPMVSF_NODIGESTS))
+ idx = ts.dbMatch('provides', distroverpkg)
++
++ # 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 = '$releasever'
+- else:
+- hdr = idx.next()
++ 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 at 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 at 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(-)
+
+diff --git a/cli.py b/cli.py
+index 0374667..8bf29ee 100644
+--- a/cli.py
++++ b/cli.py
+@@ -207,7 +207,10 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+ 'yum-rhn-plugin']
+ 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))
+ for pkg in sorted(self.rpmdb.returnPackages(patterns=yum_progs)):
+ # We should only have 1 version of each...
+ if done: print ""
+--
+1.8.2.1
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/yum.git/commitdiff/8b8b9181a1f07021263fe5903f7fd17f24e7fc16
More information about the pld-cvs-commit
mailing list