From 637e6c8e3610decb744684ac1294e73e4179b07d Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Jan 25 2011 13:33:09 +0000 Subject: - add support for Requires(posttrans) dependencies --- diff --git a/rpm-4.9.0-beta1-posttrans-deps.patch b/rpm-4.9.0-beta1-posttrans-deps.patch new file mode 100644 index 0000000..f20cd75 --- /dev/null +++ b/rpm-4.9.0-beta1-posttrans-deps.patch @@ -0,0 +1,87 @@ +commit d7e2a04d68dea4d1c7dbaf457b5b4210dfa452f2 +Author: Panu Matilainen +Date: Tue Jan 25 15:27:28 2011 +0200 + + Teach rpm about post-transaction dependencies + - %posttrans dependencies have their own peculiar semantics, they're + install-only dependencies which have no implications on ordering. + +diff --git a/build/parsePreamble.c b/build/parsePreamble.c +index 3d8b859..e4f4e0a 100644 +--- a/build/parsePreamble.c ++++ b/build/parsePreamble.c +@@ -309,6 +309,7 @@ static struct tokenBits_s const installScriptBits[] = { + { "rpmlib", RPMSENSE_RPMLIB }, + { "verify", RPMSENSE_SCRIPT_VERIFY }, + { "pretrans", RPMSENSE_PRETRANS }, ++ { "posttrans", RPMSENSE_POSTTRANS }, + { NULL, 0 } + }; + +diff --git a/build/parseScript.c b/build/parseScript.c +index d4b2293..87b3d58 100644 +--- a/build/parseScript.c ++++ b/build/parseScript.c +@@ -139,7 +139,7 @@ int parseScript(rpmSpec spec, int parsePart) + break; + case PART_POSTTRANS: + tag = RPMTAG_POSTTRANS; +- tagflags = 0; ++ tagflags = RPMSENSE_POSTTRANS; + progtag = RPMTAG_POSTTRANSPROG; + flagtag = RPMTAG_POSTTRANSFLAGS; + partname = "%posttrans"; +diff --git a/lib/formats.c b/lib/formats.c +index 386bdd3..7ce4608 100644 +--- a/lib/formats.c ++++ b/lib/formats.c +@@ -251,6 +251,8 @@ static char * deptypeFormat(rpmtd td, char * formatPrefix) + argvAdd(&sdeps, "prereq"); + if (item & RPMSENSE_PRETRANS) + argvAdd(&sdeps, "pretrans"); ++ if (item & RPMSENSE_POSTTRANS) ++ argvAdd(&sdeps, "posttrans"); + + if (sdeps) { + val = argvJoin(sdeps, ","); +diff --git a/lib/order.c b/lib/order.c +index 9cda649..3b0849d 100644 +--- a/lib/order.c ++++ b/lib/order.c +@@ -149,7 +149,7 @@ static inline int addRelation(rpmts ts, + dsflags = rpmdsFlags(requires); + + /* Avoid dependendencies which are not relevant for ordering */ +- if (dsflags & (RPMSENSE_RPMLIB|RPMSENSE_CONFIG|RPMSENSE_PRETRANS)) ++ if (dsflags & (RPMSENSE_RPMLIB|RPMSENSE_CONFIG|RPMSENSE_PRETRANS|RPMSENSE_POSTTRANS)) + return 0; + + q = rpmalSatisfiesDepend(al, requires); +diff --git a/lib/rpmds.h b/lib/rpmds.h +index 75c1541..bf3ee2c 100644 +--- a/lib/rpmds.h ++++ b/lib/rpmds.h +@@ -27,7 +27,8 @@ enum rpmsenseFlags_e { + RPMSENSE_LESS = (1 << 1), + RPMSENSE_GREATER = (1 << 2), + RPMSENSE_EQUAL = (1 << 3), +- /* bits 4-5 unused */ ++ /* bit 4 unused */ ++ RPMSENSE_POSTTRANS = (1 << 5), /*!< %posttrans dependency */ + RPMSENSE_PREREQ = (1 << 6), /* legacy prereq dependency */ + RPMSENSE_PRETRANS = (1 << 7), /*!< Pre-transaction dependency. */ + RPMSENSE_INTERP = (1 << 8), /*!< Interpreter used by scriptlet. */ +@@ -70,11 +71,12 @@ typedef rpmFlags rpmsenseFlags; + RPMSENSE_RPMLIB | \ + RPMSENSE_KEYRING | \ + RPMSENSE_PRETRANS | \ ++ RPMSENSE_POSTTRANS | \ + RPMSENSE_PREREQ) + + #define _notpre(_x) ((_x) & ~RPMSENSE_PREREQ) + #define _INSTALL_ONLY_MASK \ +- _notpre(RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_POST|RPMSENSE_RPMLIB|RPMSENSE_KEYRING|RPMSENSE_PRETRANS) ++ _notpre(RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_POST|RPMSENSE_RPMLIB|RPMSENSE_KEYRING|RPMSENSE_PRETRANS|RPMSENSE_POSTTRANS) + #define _ERASE_ONLY_MASK \ + _notpre(RPMSENSE_SCRIPT_PREUN|RPMSENSE_SCRIPT_POSTUN) + diff --git a/rpm.spec b/rpm.spec index 10744bd..1e41822 100644 --- a/rpm.spec +++ b/rpm.spec @@ -22,7 +22,7 @@ Summary: The RPM package management system Name: rpm Version: %{rpmver} -Release: %{?snapver:0.%{snapver}.}3%{?dist} +Release: %{?snapver:0.%{snapver}.}4%{?dist} Group: System Environment/Base Url: http://www.rpm.org/ Source0: http://rpm.org/releases/rpm-4.8.x/%{name}-%{srcver}.tar.bz2 @@ -45,6 +45,7 @@ Patch100: rpm-4.9.0-beta1-rofs-rpmdb.patch Patch101: rpm-4.9.0-beta1-index-rebuild.patch Patch102: rpm-4.9.0-beta1-index-iteration.patch Patch103: rpm-4.9.0-beta1-rpmdb-dsi.patch +Patch104: rpm-4.9.0-beta1-posttrans-deps.patch # These are not yet upstream Patch301: rpm-4.6.0-niagara.patch @@ -213,6 +214,7 @@ packages on a system. %patch101 -p1 -b .index-rebuild %patch102 -p1 -b .index-iteration %patch103 -p1 -b .rpmdb-dsi +%patch104 -p1 -b .posttrans-deps %patch301 -p1 -b .niagara %patch302 -p1 -b .geode @@ -423,6 +425,9 @@ exit 0 %doc COPYING doc/librpm/html/* %changelog +* Tue Jan 25 2011 Panu Matilainen - 4.9.0-0.beta1.4 +- add support for Requires(posttrans) dependencies + * Fri Jan 21 2011 Panu Matilainen - 4.9.0-0.beta1.3 - avoid division by zero in rpmdb size calculation (#671056) - fix secondary index iteration returing duplicate at end (#671149)