|
Panu Matilainen |
637e6c |
commit d7e2a04d68dea4d1c7dbaf457b5b4210dfa452f2
|
|
Panu Matilainen |
637e6c |
Author: Panu Matilainen <pmatilai@redhat.com>
|
|
Panu Matilainen |
637e6c |
Date: Tue Jan 25 15:27:28 2011 +0200
|
|
Panu Matilainen |
637e6c |
|
|
Panu Matilainen |
637e6c |
Teach rpm about post-transaction dependencies
|
|
Panu Matilainen |
637e6c |
- %posttrans dependencies have their own peculiar semantics, they're
|
|
Panu Matilainen |
637e6c |
install-only dependencies which have no implications on ordering.
|
|
Panu Matilainen |
637e6c |
|
|
Panu Matilainen |
637e6c |
diff --git a/build/parsePreamble.c b/build/parsePreamble.c
|
|
Panu Matilainen |
637e6c |
index 3d8b859..e4f4e0a 100644
|
|
Panu Matilainen |
637e6c |
--- a/build/parsePreamble.c
|
|
Panu Matilainen |
637e6c |
+++ b/build/parsePreamble.c
|
|
Panu Matilainen |
637e6c |
@@ -309,6 +309,7 @@ static struct tokenBits_s const installScriptBits[] = {
|
|
Panu Matilainen |
637e6c |
{ "rpmlib", RPMSENSE_RPMLIB },
|
|
Panu Matilainen |
637e6c |
{ "verify", RPMSENSE_SCRIPT_VERIFY },
|
|
Panu Matilainen |
637e6c |
{ "pretrans", RPMSENSE_PRETRANS },
|
|
Panu Matilainen |
637e6c |
+ { "posttrans", RPMSENSE_POSTTRANS },
|
|
Panu Matilainen |
637e6c |
{ NULL, 0 }
|
|
Panu Matilainen |
637e6c |
};
|
|
Panu Matilainen |
637e6c |
|
|
Panu Matilainen |
637e6c |
diff --git a/build/parseScript.c b/build/parseScript.c
|
|
Panu Matilainen |
637e6c |
index d4b2293..87b3d58 100644
|
|
Panu Matilainen |
637e6c |
--- a/build/parseScript.c
|
|
Panu Matilainen |
637e6c |
+++ b/build/parseScript.c
|
|
Panu Matilainen |
637e6c |
@@ -139,7 +139,7 @@ int parseScript(rpmSpec spec, int parsePart)
|
|
Panu Matilainen |
637e6c |
break;
|
|
Panu Matilainen |
637e6c |
case PART_POSTTRANS:
|
|
Panu Matilainen |
637e6c |
tag = RPMTAG_POSTTRANS;
|
|
Panu Matilainen |
637e6c |
- tagflags = 0;
|
|
Panu Matilainen |
637e6c |
+ tagflags = RPMSENSE_POSTTRANS;
|
|
Panu Matilainen |
637e6c |
progtag = RPMTAG_POSTTRANSPROG;
|
|
Panu Matilainen |
637e6c |
flagtag = RPMTAG_POSTTRANSFLAGS;
|
|
Panu Matilainen |
637e6c |
partname = "%posttrans";
|
|
Panu Matilainen |
637e6c |
diff --git a/lib/formats.c b/lib/formats.c
|
|
Panu Matilainen |
637e6c |
index 386bdd3..7ce4608 100644
|
|
Panu Matilainen |
637e6c |
--- a/lib/formats.c
|
|
Panu Matilainen |
637e6c |
+++ b/lib/formats.c
|
|
Panu Matilainen |
637e6c |
@@ -251,6 +251,8 @@ static char * deptypeFormat(rpmtd td, char * formatPrefix)
|
|
Panu Matilainen |
637e6c |
argvAdd(&sdeps, "prereq");
|
|
Panu Matilainen |
637e6c |
if (item & RPMSENSE_PRETRANS)
|
|
Panu Matilainen |
637e6c |
argvAdd(&sdeps, "pretrans");
|
|
Panu Matilainen |
637e6c |
+ if (item & RPMSENSE_POSTTRANS)
|
|
Panu Matilainen |
637e6c |
+ argvAdd(&sdeps, "posttrans");
|
|
Panu Matilainen |
637e6c |
|
|
Panu Matilainen |
637e6c |
if (sdeps) {
|
|
Panu Matilainen |
637e6c |
val = argvJoin(sdeps, ",");
|
|
Panu Matilainen |
637e6c |
diff --git a/lib/order.c b/lib/order.c
|
|
Panu Matilainen |
637e6c |
index 9cda649..3b0849d 100644
|
|
Panu Matilainen |
637e6c |
--- a/lib/order.c
|
|
Panu Matilainen |
637e6c |
+++ b/lib/order.c
|
|
Panu Matilainen |
637e6c |
@@ -149,7 +149,7 @@ static inline int addRelation(rpmts ts,
|
|
Panu Matilainen |
637e6c |
dsflags = rpmdsFlags(requires);
|
|
Panu Matilainen |
637e6c |
|
|
Panu Matilainen |
637e6c |
/* Avoid dependendencies which are not relevant for ordering */
|
|
Panu Matilainen |
637e6c |
- if (dsflags & (RPMSENSE_RPMLIB|RPMSENSE_CONFIG|RPMSENSE_PRETRANS))
|
|
Panu Matilainen |
637e6c |
+ if (dsflags & (RPMSENSE_RPMLIB|RPMSENSE_CONFIG|RPMSENSE_PRETRANS|RPMSENSE_POSTTRANS))
|
|
Panu Matilainen |
637e6c |
return 0;
|
|
Panu Matilainen |
637e6c |
|
|
Panu Matilainen |
637e6c |
q = rpmalSatisfiesDepend(al, requires);
|
|
Panu Matilainen |
637e6c |
diff --git a/lib/rpmds.h b/lib/rpmds.h
|
|
Panu Matilainen |
637e6c |
index 75c1541..bf3ee2c 100644
|
|
Panu Matilainen |
637e6c |
--- a/lib/rpmds.h
|
|
Panu Matilainen |
637e6c |
+++ b/lib/rpmds.h
|
|
Panu Matilainen |
637e6c |
@@ -27,7 +27,8 @@ enum rpmsenseFlags_e {
|
|
Panu Matilainen |
637e6c |
RPMSENSE_LESS = (1 << 1),
|
|
Panu Matilainen |
637e6c |
RPMSENSE_GREATER = (1 << 2),
|
|
Panu Matilainen |
637e6c |
RPMSENSE_EQUAL = (1 << 3),
|
|
Panu Matilainen |
637e6c |
- /* bits 4-5 unused */
|
|
Panu Matilainen |
637e6c |
+ /* bit 4 unused */
|
|
Panu Matilainen |
637e6c |
+ RPMSENSE_POSTTRANS = (1 << 5), /*!< %posttrans dependency */
|
|
Panu Matilainen |
637e6c |
RPMSENSE_PREREQ = (1 << 6), /* legacy prereq dependency */
|
|
Panu Matilainen |
637e6c |
RPMSENSE_PRETRANS = (1 << 7), /*!< Pre-transaction dependency. */
|
|
Panu Matilainen |
637e6c |
RPMSENSE_INTERP = (1 << 8), /*!< Interpreter used by scriptlet. */
|
|
Panu Matilainen |
637e6c |
@@ -70,11 +71,12 @@ typedef rpmFlags rpmsenseFlags;
|
|
Panu Matilainen |
637e6c |
RPMSENSE_RPMLIB | \
|
|
Panu Matilainen |
637e6c |
RPMSENSE_KEYRING | \
|
|
Panu Matilainen |
637e6c |
RPMSENSE_PRETRANS | \
|
|
Panu Matilainen |
637e6c |
+ RPMSENSE_POSTTRANS | \
|
|
Panu Matilainen |
637e6c |
RPMSENSE_PREREQ)
|
|
Panu Matilainen |
637e6c |
|
|
Panu Matilainen |
637e6c |
#define _notpre(_x) ((_x) & ~RPMSENSE_PREREQ)
|
|
Panu Matilainen |
637e6c |
#define _INSTALL_ONLY_MASK \
|
|
Panu Matilainen |
637e6c |
- _notpre(RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_POST|RPMSENSE_RPMLIB|RPMSENSE_KEYRING|RPMSENSE_PRETRANS)
|
|
Panu Matilainen |
637e6c |
+ _notpre(RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_POST|RPMSENSE_RPMLIB|RPMSENSE_KEYRING|RPMSENSE_PRETRANS|RPMSENSE_POSTTRANS)
|
|
Panu Matilainen |
637e6c |
#define _ERASE_ONLY_MASK \
|
|
Panu Matilainen |
637e6c |
_notpre(RPMSENSE_SCRIPT_PREUN|RPMSENSE_SCRIPT_POSTUN)
|
|
Panu Matilainen |
637e6c |
|