SOURCES: rpm-kill-prereq.patch (NEW) - try to avoid package orderi...

qboosh qboosh at pld-linux.org
Fri Oct 7 14:11:14 CEST 2005


Author: qboosh                       Date: Fri Oct  7 12:11:13 2005 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- try to avoid package ordering mess caused by defining RPMSENSE_PREREQ to 0
  (by killing its usage - backported from rpm 4.4.3)

---- Files affected:
SOURCES:
   rpm-kill-prereq.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/rpm-kill-prereq.patch
diff -u /dev/null SOURCES/rpm-kill-prereq.patch:1.1
--- /dev/null	Fri Oct  7 14:11:13 2005
+++ SOURCES/rpm-kill-prereq.patch	Fri Oct  7 14:11:08 2005
@@ -0,0 +1,150 @@
+--- rpm-4.4.2/lib/depends.c.orig	2005-10-07 13:39:39.000000000 +0200
++++ rpm-4.4.2/lib/depends.c	2005-10-07 13:45:07.000000000 +0200
+@@ -966,8 +966,6 @@
+ static inline /*@observer@*/ const char * const identifyDepend(int_32 f)
+ 	/*@*/
+ {
+-    if (isLegacyPreReq(f))
+-	return "PreReq:";
+     f = _notpre(f);
+     if (f & RPMSENSE_SCRIPT_PRE)
+ 	return "Requires(pre):";
+@@ -1035,7 +1033,7 @@
+ 	 * Attempt to unravel a dependency loop by eliminating Requires's.
+ 	 */
+ 	/*@-branchstate@*/
+-	if (zap && !(Flags & RPMSENSE_PREREQ)) {
++	if (zap) {
+ 	    rpmMessage(msglvl,
+ 			_("removing %s \"%s\" from tsort relations.\n"),
+ 			(rpmteNEVRA(p) ?  rpmteNEVRA(p) : "???"), dp);
+@@ -1297,15 +1295,15 @@
+ 
+ 	    switch (rpmteType(p)) {
+ 	    case TR_REMOVED:
+-		/* Skip if not %preun/%postun requires or legacy prereq. */
++		/* Skip if not %preun/%postun requires */
+ 		if (isInstallPreReq(Flags)
+-		 || !( isErasePreReq(Flags) || isLegacyPreReq(Flags) ) )
++		 || !( isErasePreReq(Flags) ) )
+ 		    /*@innercontinue@*/ continue;
+ 		/*@switchbreak@*/ break;
+ 	    case TR_ADDED:
+-		/* Skip if not %pre/%post requires or legacy prereq. */
++		/* Skip if not %pre/%post requires */
+ 		if (isErasePreReq(Flags)
+-		 || !( isInstallPreReq(Flags) || isLegacyPreReq(Flags) ) )
++		 || !( isInstallPreReq(Flags) ) )
+ 		    /*@innercontinue@*/ continue;
+ 		/*@switchbreak@*/ break;
+ 	    }
+@@ -1324,15 +1322,15 @@
+ 
+ 	    switch (rpmteType(p)) {
+ 	    case TR_REMOVED:
+-		/* Skip if %preun/%postun requires or legacy prereq. */
++		/* Skip if %preun/%postun requires */
+ 		if (isInstallPreReq(Flags)
+-		 ||  ( isErasePreReq(Flags) || isLegacyPreReq(Flags) ) )
++		 ||  ( isErasePreReq(Flags) ) )
+ 		    /*@innercontinue@*/ continue;
+ 		/*@switchbreak@*/ break;
+ 	    case TR_ADDED:
+-		/* Skip if %pre/%post requires or legacy prereq. */
++		/* Skip if %pre/%post requires */
+ 		if (isErasePreReq(Flags)
+-		 ||  ( isInstallPreReq(Flags) || isLegacyPreReq(Flags) ) )
++		 ||  ( isInstallPreReq(Flags) ) )
+ 		    /*@innercontinue@*/ continue;
+ 		/*@switchbreak@*/ break;
+ 	    }
+--- rpm-4.4.2/lib/rpmlib.h.orig	2005-07-12 12:38:54.000000000 +0200
++++ rpm-4.4.2/lib/rpmlib.h	2005-10-07 13:47:23.000000000 +0200
+@@ -505,13 +505,13 @@
+     RPMSENSE_PROVIDES	= (1 << 4), /* only used internally by builds */
+     RPMSENSE_CONFLICTS	= (1 << 5), /* only used internally by builds */
+ 	/* bit 6 used to be RPMSENSE_PREREQ */
+-#define	RPMSENSE_PREREQ	RPMSENSE_ANY
++    RPMSENSE_PREREQ	= (1 << 6), /* phased out. */
+     RPMSENSE_OBSOLETES	= (1 << 7), /* only used internally by builds */
+     RPMSENSE_INTERP	= (1 << 8),	/*!< Interpreter used by scriptlet. */
+-    RPMSENSE_SCRIPT_PRE	= ((1 << 9)|RPMSENSE_PREREQ), /*!< %pre dependency. */
+-    RPMSENSE_SCRIPT_POST = ((1 << 10)|RPMSENSE_PREREQ), /*!< %post dependency. */
+-    RPMSENSE_SCRIPT_PREUN = ((1 << 11)|RPMSENSE_PREREQ), /*!< %preun dependency. */
+-    RPMSENSE_SCRIPT_POSTUN = ((1 << 12)|RPMSENSE_PREREQ), /*!< %postun dependency. */
++    RPMSENSE_SCRIPT_PRE	= (1 << 9), /*!< %pre dependency. */
++    RPMSENSE_SCRIPT_POST = (1 << 10), /*!< %post dependency. */
++    RPMSENSE_SCRIPT_PREUN = (1 << 11), /*!< %preun dependency. */
++    RPMSENSE_SCRIPT_POSTUN = (1 << 12), /*!< %postun dependency. */
+     RPMSENSE_SCRIPT_VERIFY = (1 << 13),	/*!< %verify dependency. */
+     RPMSENSE_FIND_REQUIRES = (1 << 14), /*!< find-requires generated dependency. */
+     RPMSENSE_FIND_PROVIDES = (1 << 15), /*!< find-provides generated dependency. */
+@@ -524,7 +524,7 @@
+     RPMSENSE_SCRIPT_BUILD = (1 << 21),	/*!< %build build dependency. */
+     RPMSENSE_SCRIPT_INSTALL = (1 << 22),/*!< %install build dependency. */
+     RPMSENSE_SCRIPT_CLEAN = (1 << 23),	/*!< %clean build dependency. */
+-    RPMSENSE_RPMLIB = ((1 << 24) | RPMSENSE_PREREQ), /*!< rpmlib(feature) dependency. */
++    RPMSENSE_RPMLIB = (1 << 24), /*!< rpmlib(feature) dependency. */
+ /*@-enummemuse@*/
+     RPMSENSE_TRIGGERPREIN = (1 << 25),	/*!< @todo Implement %triggerprein. */
+ /*@=enummemuse@*/
+@@ -560,7 +560,7 @@
+ #define	_ERASE_ONLY_MASK  \
+     _notpre(RPMSENSE_SCRIPT_PREUN|RPMSENSE_SCRIPT_POSTUN)
+ 
+-#define	isLegacyPreReq(_x)  (((_x) & _ALL_REQUIRES_MASK) == RPMSENSE_PREREQ)
++#define	isLegacyPreReq(_x)  (0)
+ #define	isInstallPreReq(_x)	((_x) & _INSTALL_ONLY_MASK)
+ #define	isErasePreReq(_x)	((_x) & _ERASE_ONLY_MASK)
+ 
+--- rpm-4.4.2/build/parseReqs.c.orig	2004-10-17 20:44:15.000000000 +0200
++++ rpm-4.4.2/build/parseReqs.c	2005-10-07 13:40:50.000000000 +0200
+@@ -58,11 +58,11 @@
+ 	h = spec->buildRestrictions;
+ 	break;
+     case RPMTAG_PREREQ:
+-	tagflags |= RPMSENSE_PREREQ;
++	tagflags |= RPMSENSE_ANY;
+ 	h = pkg->header;
+ 	break;
+     case RPMTAG_BUILDPREREQ:
+-	tagflags |= RPMSENSE_PREREQ;
++	tagflags |= RPMSENSE_ANY;
+ 	h = spec->buildRestrictions;
+ 	break;
+     case RPMTAG_TRIGGERIN:
+--- rpm-4.4.2/build/reqprov.c.orig	2004-10-09 20:23:00.000000000 +0200
++++ rpm-4.4.2/build/reqprov.c	2005-10-07 13:42:01.000000000 +0200
+@@ -37,11 +37,6 @@
+ 	nametag = RPMTAG_CONFLICTNAME;
+ 	versiontag = RPMTAG_CONFLICTVERSION;
+ 	flagtag = RPMTAG_CONFLICTFLAGS;
+-    } else if (Flags & RPMSENSE_PREREQ) {
+-	nametag = RPMTAG_REQUIRENAME;
+-	versiontag = RPMTAG_REQUIREVERSION;
+-	flagtag = RPMTAG_REQUIREFLAGS;
+-	extra = Flags & _ALL_REQUIRES_MASK;
+     } else if (Flags & RPMSENSE_TRIGGER) {
+ 	nametag = RPMTAG_TRIGGERNAME;
+ 	versiontag = RPMTAG_TRIGGERVERSION;
+--- rpm-4.4.2/build/rpmfc.c.orig	2005-10-07 13:39:40.000000000 +0200
++++ rpm-4.4.2/build/rpmfc.c	2005-10-07 13:42:14.000000000 +0200
+@@ -1634,18 +1634,9 @@
+   { "Provides",		{ "%{?__find_provides}", NULL, NULL, NULL },
+ 	RPMTAG_PROVIDENAME, RPMTAG_PROVIDEVERSION, RPMTAG_PROVIDEFLAGS,
+ 	0, -1 },
+-#ifdef	DYING
+-  { "PreReq",		{ NULL, NULL, NULL, NULL },
+-	RPMTAG_REQUIRENAME, RPMTAG_REQUIREVERSION, RPMTAG_REQUIREFLAGS,
+-	RPMSENSE_PREREQ, 0 },
+-  { "Requires(interp)",	{ NULL, "interp", NULL, NULL },
+-	-1, -1, RPMTAG_REQUIREFLAGS,
+-	_notpre(RPMSENSE_INTERP), 0 },
+-#else
+   { "Requires(interp)",	{ NULL, "interp", NULL, NULL },
+ 	RPMTAG_REQUIRENAME, RPMTAG_REQUIREVERSION, RPMTAG_REQUIREFLAGS,
+ 	_notpre(RPMSENSE_INTERP), 0 },
+-#endif
+   { "Requires(rpmlib)",	{ NULL, "rpmlib", NULL, NULL },
+ 	-1, -1, RPMTAG_REQUIREFLAGS,
+ 	_notpre(RPMSENSE_RPMLIB), 0 },
================================================================



More information about the pld-cvs-commit mailing list