rpm/weakdepscompat.diff

128 lines
4.3 KiB
Diff

--- ./build/parsePreamble.c.orig 2014-02-25 14:14:15.892041649 +0000
+++ ./build/parsePreamble.c 2014-02-25 14:14:26.237041631 +0000
@@ -343,6 +343,7 @@ static struct tokenBits_s const installS
{ "verify", RPMSENSE_SCRIPT_VERIFY },
{ "pretrans", RPMSENSE_PRETRANS },
{ "posttrans", RPMSENSE_POSTTRANS },
+ { "hint", RPMSENSE_MISSINGOK },
{ NULL, 0 }
};
--- ./build/rpmfc.c.orig 2014-02-25 14:14:15.904041649 +0000
+++ ./build/rpmfc.c 2014-02-25 14:14:26.238041631 +0000
@@ -1156,6 +1156,12 @@ static struct DepMsg_s depMsgs[] = {
{ "Obsoletes", { "%{?__find_obsoletes}", NULL, NULL, NULL },
RPMTAG_OBSOLETENAME, RPMTAG_OBSOLETEVERSION, RPMTAG_OBSOLETEFLAGS,
0, -1 },
+ { "Enhances", { "%{?__find_enhances}", NULL, NULL, NULL },
+ RPMTAG_ENHANCENAME, RPMTAG_ENHANCEVERSION, RPMTAG_ENHANCEFLAGS,
+ 0, -1 },
+ { "Supplements", { "%{?__find_supplements}", NULL, NULL, NULL },
+ RPMTAG_SUPPLEMENTNAME, RPMTAG_SUPPLEMENTVERSION, RPMTAG_SUPPLEMENTFLAGS,
+ 0, -1 },
{ NULL, { NULL, NULL, NULL, NULL }, 0, 0, 0, 0, 0 }
};
@@ -1231,6 +1237,16 @@ static rpmRC rpmfcGenerateDependsHelper(
if (!pkg->autoReq)
continue;
tagflags = RPMSENSE_FIND_REQUIRES;
+ break;
+ case RPMTAG_ENHANCENAME:
+ if (!pkg->autoReq)
+ continue;
+ tagflags = RPMSENSE_FIND_REQUIRES;
+ break;
+ case RPMTAG_SUPPLEMENTNAME:
+ if (!pkg->autoReq)
+ continue;
+ tagflags = RPMSENSE_FIND_REQUIRES;
break;
default:
continue;
--- ./lib/rpmds.c.orig 2014-02-25 14:14:15.834041649 +0000
+++ ./lib/rpmds.c 2014-02-25 14:14:47.963041593 +0000
@@ -86,6 +86,14 @@ static int dsType(rpmTagVal tag,
t = "Trigger";
evr = RPMTAG_TRIGGERVERSION;
f = RPMTAG_TRIGGERFLAGS;
+ } else if (tag == RPMTAG_OLDSUGGESTSNAME) {
+ t = "Oldsuggests";
+ evr = RPMTAG_OLDSUGGESTSVERSION;
+ f = RPMTAG_OLDSUGGESTSFLAGS;
+ } else if (tag == RPMTAG_OLDENHANCESNAME) {
+ t = "Oldenhances";
+ evr = RPMTAG_OLDENHANCESVERSION;
+ f = RPMTAG_OLDENHANCESFLAGS;
} else {
rc = 1;
}
--- ./lib/tagexts.c.orig 2014-02-25 14:14:15.839041649 +0000
+++ ./lib/tagexts.c 2014-02-25 14:18:53.707041158 +0000
@@ -906,6 +906,34 @@ static int depnevrsTag(Header h, rpmtd t
return (ndeps > 0);
}
+#define RPMSENSE_STRONG (1 << 27)
+
+static int depnevrsTagFiltered(Header h, rpmtd td, headerGetFlags hgflags,
+ rpmTagVal tag, int strong)
+{
+ rpmds ds = rpmdsNew(h, tag, 0);
+ int ndeps = rpmdsCount(ds);
+
+ if (ndeps > 0) {
+ char **deps = xmalloc(sizeof(*deps) * ndeps);
+ ndeps = 0;
+ while (rpmdsNext(ds) >= 0) {
+ if ((rpmdsFlags(ds) & RPMSENSE_STRONG) == (strong ? RPMSENSE_STRONG : 0))
+ deps[ndeps++] = rpmdsNewDNEVR(NULL, ds);
+ }
+ if (ndeps) {
+ td->data = deps;
+ td->type = RPM_STRING_ARRAY_TYPE;
+ td->count = ndeps;
+ td->flags |= (RPMTD_ALLOCED | RPMTD_PTR_ALLOCED);
+ } else {
+ _free(deps);
+ }
+ }
+ rpmdsFree(ds);
+ return (ndeps > 0);
+}
+
static int requirenevrsTag(Header h, rpmtd td, headerGetFlags hgflags)
{
return depnevrsTag(h, td, hgflags, RPMTAG_REQUIRENAME);
@@ -913,22 +941,26 @@ static int requirenevrsTag(Header h, rpm
static int recommendnevrsTag(Header h, rpmtd td, headerGetFlags hgflags)
{
- return depnevrsTag(h, td, hgflags, RPMTAG_RECOMMENDNAME);
+ return depnevrsTag(h, td, hgflags, RPMTAG_RECOMMENDNAME) ||
+ depnevrsTagFiltered(h, td, hgflags, RPMTAG_OLDSUGGESTSNAME, 1);
}
static int suggestnevrsTag(Header h, rpmtd td, headerGetFlags hgflags)
{
- return depnevrsTag(h, td, hgflags, RPMTAG_SUGGESTNAME);
+ return depnevrsTag(h, td, hgflags, RPMTAG_SUGGESTNAME) ||
+ depnevrsTagFiltered(h, td, hgflags, RPMTAG_OLDSUGGESTSNAME, 0);
}
static int supplementnevrsTag(Header h, rpmtd td, headerGetFlags hgflags)
{
- return depnevrsTag(h, td, hgflags, RPMTAG_SUPPLEMENTNAME);
+ return depnevrsTag(h, td, hgflags, RPMTAG_SUPPLEMENTNAME) ||
+ depnevrsTagFiltered(h, td, hgflags, RPMTAG_OLDENHANCESNAME, 1);
}
static int enhancenevrsTag(Header h, rpmtd td, headerGetFlags hgflags)
{
- return depnevrsTag(h, td, hgflags, RPMTAG_ENHANCENAME);
+ return depnevrsTag(h, td, hgflags, RPMTAG_ENHANCENAME) ||
+ depnevrsTagFiltered(h, td, hgflags, RPMTAG_OLDENHANCESNAME, 0);
}
static int providenevrsTag(Header h, rpmtd td, headerGetFlags hgflags)