[packages/rpm] - add patch from mandriva to fix possibility of uprading the same package if it has epoch tag (all

baggins baggins at pld-linux.org
Mon Sep 10 08:12:11 CEST 2012


commit 9f9190ed9142a6a0911079cd7fcaf91dcaf15221
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Mon Sep 10 08:02:44 2012 +0200

    - add patch from mandriva to fix possibility of uprading the same
      package if it has epoch tag (all of our packages do)
    - fix running scripts that has only interpreter set and no body
      (post -p /sbin/ldconfig is prime example)

 ...me-package-with-epoch-possible-to-upgrade.patch | 22 ++++++++++++++++++++++
 rpm-fix--p-interpreter-and-empty-script.patch      | 15 +++++++++++++++
 rpm.spec                                           |  5 +++++
 3 files changed, 42 insertions(+)
---
diff --git a/rpm.spec b/rpm.spec
index c09a321..31be1b1 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -133,6 +133,7 @@ Patch39:	%{name}-postun-nofail.patch
 Patch40:	%{name}-silence-RPM_CHAR_TYPE.patch
 Patch41:	%{name}-fix-missing-types-in-headers.patch
 Patch42:	%{name}-disable-ldconfig-optimization.patch
+Patch43:	%{name}-fix--p-interpreter-and-empty-script.patch
 
 # Patches imported from Mandriva
 
@@ -234,6 +235,8 @@ Patch1037:	rpm-5.4.10-fix-neon-saving-error-pages-as-target-file.patch
 # --ignorearch & --ignoreos to set these.
 # status: needs to be discussed upstream before thinking about merging
 Patch1038:	rpm-5.4.10-support-ignore-arch-and-os-again.patch
+# status: ready for merge
+Patch1039:	rpm-5.4.4-fix-same-package-with-epoch-possible-to-upgrade.patch
 
 URL:		http://rpm5.org/
 BuildRequires:	autoconf >= 2.60
@@ -799,6 +802,7 @@ Dokumentacja API RPM-a oraz przewodniki w formacie HTML generowane ze
 %patch40 -p1
 %patch41 -p1
 %patch42 -p1
+%patch43 -p1
 
 %patch1000 -p1
 %patch1001 -p1
@@ -839,6 +843,7 @@ Dokumentacja API RPM-a oraz przewodniki w formacie HTML generowane ze
 %patch1036 -p1
 %patch1037 -p1
 %patch1038 -p1
+%patch1039 -p1
 
 install %{SOURCE2} macros/pld.in
 install %{SOURCE8} scripts/php.prov.in
diff --git a/rpm-5.4.4-fix-same-package-with-epoch-possible-to-upgrade.patch b/rpm-5.4.4-fix-same-package-with-epoch-possible-to-upgrade.patch
new file mode 100644
index 0000000..6d81cf4
--- /dev/null
+++ b/rpm-5.4.4-fix-same-package-with-epoch-possible-to-upgrade.patch
@@ -0,0 +1,22 @@
+--- rpm-5.4.4/lib/transaction.c.epoch_cmp~	2011-11-30 22:25:26.646155379 +0100
++++ rpm-5.4.4/lib/transaction.c	2011-11-30 23:15:28.252768345 +0100
+@@ -1187,12 +1187,15 @@ rpmlog(RPMLOG_DEBUG, D_("sanity checking
+ 			    const char *val = NULL;
+ 			    he->tag = tags[t];
+ 			    xx = headerGet(h, he, 0);
+-			    if (he->tag == RPMTAG_EPOCH)
++			    if (he->tag == RPMTAG_EPOCH) {
+ 				val = rpmteE(p);
+-			    else if (he->tag == RPMTAG_DISTEPOCH)
++				if (val ? atoi(val) : 0 != he->p.ui32p ? *(he->p.ui32p) : 0)
++				  nkeys--;
++			    } else if (he->tag == RPMTAG_DISTEPOCH) {
+ 				val = rpmteD(p);
+-			    if (strcmp(he->p.str ? he->p.str : "", val ? val : ""))
+-				nkeys--;
++				if (strcmp(he->p.str ? he->p.str : "", val ? val : ""))
++				  nkeys--;
++			    }
+ 			    he->p.ptr = _free(he->p.ptr);
+ 			}
+ 			mi = rpmmiFree(mi);
diff --git a/rpm-fix--p-interpreter-and-empty-script.patch b/rpm-fix--p-interpreter-and-empty-script.patch
new file mode 100644
index 0000000..8c2f2fc
--- /dev/null
+++ b/rpm-fix--p-interpreter-and-empty-script.patch
@@ -0,0 +1,15 @@
+--- rpm-5.4.10/lib/psm.c~	2012-09-10 07:58:10.220193941 +0200
++++ rpm-5.4.10/lib/psm.c	2012-09-10 08:00:38.723522037 +0200
+@@ -1172,11 +1172,8 @@
+ 
+ assert(fi->h != NULL);
+     She->tag = psm->scriptTag;
+-    if (!headerGet(fi->h, She, 0))
+-	goto exit;
+-
+     Phe->tag = psm->progTag;
+-    if (!headerGet(fi->h, Phe, 0))
++    if (!headerGet(fi->h, She, 0) && !headerGet(fi->h, Phe, 0))
+ 	goto exit;
+ 
+     /* Coerce strings into header argv return. */
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/rpm.git/commitdiff/50008644283b35f6d09b11d696b4293a60977d8d



More information about the pld-cvs-commit mailing list