2006-12-19 00:17:44 +01:00
|
|
|
Add support for weak dependencies:
|
|
|
|
|
|
|
|
A) use RPMTAG_SUGGESTS and RPMTAG_ENHANCES to store them.
|
|
|
|
|
|
|
|
This is different to upstream, which uses RPMSENSE_MISSINGOK
|
|
|
|
and RPMTAG_REQUIRES/RPMTAG_PROVIDES instead. I chose different
|
|
|
|
tags because I wanted to be compatible. The point is that
|
|
|
|
applications that don't know about the new MISSINGOK semantics
|
|
|
|
will mis-interpret the provides/requires otherwise, which
|
|
|
|
I deemed to risky.
|
|
|
|
|
|
|
|
B) use RPMSENSE_STRONG to support a "strong" version, "Recommends"
|
|
|
|
instead of "Suggests" and "Supplements" instead of "Enhances".
|
|
|
|
|
|
|
|
Needs extcond.diff for query operations.
|
|
|
|
|
2010-04-01 18:15:26 +02:00
|
|
|
--- ./build/parsePreamble.c.orig 2009-12-17 09:05:55.000000000 +0000
|
|
|
|
+++ ./build/parsePreamble.c 2010-03-25 14:56:24.000000000 +0000
|
|
|
|
@@ -124,6 +124,8 @@ static struct tokenBits_s const installS
|
2006-12-19 00:17:44 +01:00
|
|
|
{ "post", RPMSENSE_SCRIPT_POST },
|
|
|
|
{ "rpmlib", RPMSENSE_RPMLIB },
|
2006-12-19 00:17:44 +01:00
|
|
|
{ "verify", RPMSENSE_SCRIPT_VERIFY },
|
2006-12-19 00:17:44 +01:00
|
|
|
+ { "hint", RPMSENSE_MISSINGOK },
|
|
|
|
+ { "strong", RPMSENSE_STRONG },
|
2006-12-19 00:17:44 +01:00
|
|
|
{ NULL, 0 }
|
|
|
|
};
|
|
|
|
|
2010-04-01 18:15:26 +02:00
|
|
|
@@ -134,6 +136,8 @@ static const struct tokenBits_s const bu
|
2006-12-19 00:17:44 +01:00
|
|
|
{ "build", RPMSENSE_SCRIPT_BUILD },
|
|
|
|
{ "install", RPMSENSE_SCRIPT_INSTALL },
|
|
|
|
{ "clean", RPMSENSE_SCRIPT_CLEAN },
|
|
|
|
+ { "hint", RPMSENSE_MISSINGOK },
|
|
|
|
+ { "strong", RPMSENSE_STRONG },
|
|
|
|
{ NULL, 0 }
|
|
|
|
};
|
|
|
|
|
2010-04-01 18:15:26 +02:00
|
|
|
@@ -649,6 +653,18 @@ static int handlePreambleTag(rpmSpec spe
|
2006-12-19 00:17:44 +01:00
|
|
|
if ((rc = parseRCPOT(spec, pkg, field, tag, 0, tagflags)))
|
|
|
|
return rc;
|
|
|
|
break;
|
|
|
|
+ case RPMTAG_SUGGESTSFLAGS:
|
|
|
|
+ case RPMTAG_ENHANCESFLAGS:
|
|
|
|
+ case RPMTAG_BUILDSUGGESTS:
|
|
|
|
+ case RPMTAG_BUILDENHANCES:
|
|
|
|
+ tagflags = RPMSENSE_MISSINGOK;
|
|
|
|
+ if (macro && (!strcmp(macro, "recommends") || !strcmp(macro, "buildrecommends")))
|
|
|
|
+ tagflags |= RPMSENSE_STRONG;
|
|
|
|
+ if (macro && (!strcmp(macro, "supplements") || !strcmp(macro, "buildsupplements")))
|
|
|
|
+ tagflags |= RPMSENSE_STRONG;
|
|
|
|
+ if ((rc = parseRCPOT(spec, pkg, field, tag, 0, tagflags)))
|
|
|
|
+ return rc;
|
|
|
|
+ break;
|
|
|
|
case RPMTAG_EXCLUDEARCH:
|
|
|
|
case RPMTAG_EXCLUSIVEARCH:
|
|
|
|
case RPMTAG_EXCLUDEOS:
|
2010-04-01 18:15:26 +02:00
|
|
|
@@ -748,6 +764,14 @@ static struct PreambleRec_s const preamb
|
|
|
|
{RPMTAG_DOCDIR, 0, 0, LEN_AND_STR("docdir")},
|
|
|
|
{RPMTAG_DISTTAG, 0, 0, LEN_AND_STR("disttag")},
|
|
|
|
{RPMTAG_BUGURL, 0, 0, LEN_AND_STR("bugurl")},
|
|
|
|
+ {RPMTAG_SUGGESTSFLAGS, 0, 0, LEN_AND_STR("recommends")},
|
|
|
|
+ {RPMTAG_SUGGESTSFLAGS, 0, 0, LEN_AND_STR("suggests")},
|
|
|
|
+ {RPMTAG_ENHANCESFLAGS, 0, 0, LEN_AND_STR("supplements")},
|
|
|
|
+ {RPMTAG_ENHANCESFLAGS, 0, 0, LEN_AND_STR("enhances")},
|
|
|
|
+ {RPMTAG_BUILDSUGGESTS, 0, 0, LEN_AND_STR("buildrecommends")},
|
|
|
|
+ {RPMTAG_BUILDSUGGESTS, 0, 0, LEN_AND_STR("buildsuggests")},
|
|
|
|
+ {RPMTAG_BUILDENHANCES, 0, 0, LEN_AND_STR("buildsupplements")},
|
|
|
|
+ {RPMTAG_BUILDENHANCES, 0, 0, LEN_AND_STR("buildenhances")},
|
|
|
|
{0, 0, 0, 0}
|
2009-08-28 15:54:03 +02:00
|
|
|
};
|
2010-04-01 18:15:26 +02:00
|
|
|
|
|
|
|
--- ./build/parseReqs.c.orig 2009-12-17 09:05:55.000000000 +0000
|
|
|
|
+++ ./build/parseReqs.c 2010-03-25 14:53:47.000000000 +0000
|
|
|
|
@@ -85,6 +85,14 @@ rpmRC parseRCPOT(rpmSpec spec, Package p
|
2006-12-19 00:17:44 +01:00
|
|
|
tagflags |= RPMSENSE_ANY;
|
2006-12-19 00:17:44 +01:00
|
|
|
h = spec->buildRestrictions;
|
|
|
|
break;
|
|
|
|
+ case RPMTAG_SUGGESTSFLAGS:
|
|
|
|
+ case RPMTAG_ENHANCESFLAGS:
|
2006-12-19 00:17:44 +01:00
|
|
|
+ h = pkg->header;
|
2006-12-19 00:17:44 +01:00
|
|
|
+ break;
|
|
|
|
+ case RPMTAG_BUILDSUGGESTS:
|
|
|
|
+ case RPMTAG_BUILDENHANCES:
|
2006-12-19 00:17:44 +01:00
|
|
|
+ h = spec->buildRestrictions;
|
|
|
|
+ break;
|
|
|
|
default:
|
|
|
|
case RPMTAG_REQUIREFLAGS:
|
|
|
|
tagflags |= RPMSENSE_ANY;
|
2010-04-01 18:15:26 +02:00
|
|
|
--- ./build/reqprov.c.orig 2009-12-07 14:36:49.000000000 +0000
|
|
|
|
+++ ./build/reqprov.c 2010-03-25 14:53:47.000000000 +0000
|
|
|
|
@@ -75,6 +75,16 @@ int addReqProv(rpmSpec spec, Header h, r
|
2006-12-19 00:17:44 +01:00
|
|
|
flagtag = RPMTAG_TRIGGERFLAGS;
|
2006-12-19 00:17:44 +01:00
|
|
|
indextag = RPMTAG_TRIGGERINDEX;
|
|
|
|
extra = Flags & RPMSENSE_TRIGGER;
|
2006-12-19 00:17:44 +01:00
|
|
|
+ } else if (tagN == RPMTAG_SUGGESTSFLAGS || tagN == RPMTAG_BUILDSUGGESTS) {
|
|
|
|
+ nametag = RPMTAG_SUGGESTSNAME;
|
2006-12-19 00:17:44 +01:00
|
|
|
+ versiontag = RPMTAG_SUGGESTSVERSION;
|
|
|
|
+ flagtag = RPMTAG_SUGGESTSFLAGS;
|
|
|
|
+ extra = Flags & _ALL_REQUIRES_MASK;
|
2006-12-19 00:17:44 +01:00
|
|
|
+ } else if (tagN == RPMTAG_ENHANCESFLAGS || tagN == RPMTAG_BUILDENHANCES) {
|
|
|
|
+ nametag = RPMTAG_ENHANCESNAME;
|
2006-12-19 00:17:44 +01:00
|
|
|
+ versiontag = RPMTAG_ENHANCESVERSION;
|
|
|
|
+ flagtag = RPMTAG_ENHANCESFLAGS;
|
|
|
|
+ extra = Flags & _ALL_REQUIRES_MASK;
|
2006-12-19 00:17:44 +01:00
|
|
|
} else {
|
|
|
|
nametag = RPMTAG_REQUIRENAME;
|
|
|
|
versiontag = RPMTAG_REQUIREVERSION;
|
2010-04-01 18:15:26 +02:00
|
|
|
--- ./build/rpmfc.c.orig 2009-12-09 13:37:25.000000000 +0000
|
|
|
|
+++ ./build/rpmfc.c 2010-03-25 14:53:47.000000000 +0000
|
|
|
|
@@ -1405,6 +1405,12 @@ static struct DepMsg_s depMsgs[] = {
|
2006-12-19 00:17:44 +01:00
|
|
|
{ "Obsoletes", { "%{?__find_obsoletes}", NULL, NULL, NULL },
|
|
|
|
RPMTAG_OBSOLETENAME, RPMTAG_OBSOLETEVERSION, RPMTAG_OBSOLETEFLAGS,
|
|
|
|
0, -1 },
|
|
|
|
+ { "Enhances", { "%{?__find_enhances}", NULL, NULL, NULL },
|
|
|
|
+ RPMTAG_ENHANCESNAME, RPMTAG_ENHANCESVERSION, RPMTAG_ENHANCESFLAGS,
|
|
|
|
+ RPMSENSE_STRONG, RPMSENSE_STRONG },
|
|
|
|
+ { "Supplements", { "%{?__find_supplements}", NULL, NULL, NULL },
|
|
|
|
+ RPMTAG_ENHANCESNAME, RPMTAG_ENHANCESVERSION, RPMTAG_ENHANCESFLAGS,
|
|
|
|
+ RPMSENSE_STRONG, 0 },
|
|
|
|
{ NULL, { NULL, NULL, NULL, NULL }, 0, 0, 0, 0, 0 }
|
|
|
|
};
|
|
|
|
|
2010-04-01 18:15:26 +02:00
|
|
|
@@ -1490,6 +1496,14 @@ static int rpmfcGenerateDependsHelper(co
|
2006-12-19 00:17:44 +01:00
|
|
|
failnonzero = 0;
|
|
|
|
tagflags = RPMSENSE_FIND_REQUIRES;
|
2009-08-28 15:54:03 +02:00
|
|
|
break;
|
2006-12-19 00:17:44 +01:00
|
|
|
+ case RPMTAG_ENHANCESFLAGS:
|
|
|
|
+ if (!pkg->autoProv)
|
|
|
|
+ continue;
|
|
|
|
+ failnonzero = 0;
|
|
|
|
+ tagflags = RPMSENSE_FIND_REQUIRES | RPMSENSE_MISSINGOK;
|
|
|
|
+ if (strcmp(dm->msg, "Supplements") == 0)
|
|
|
|
+ tagflags |= RPMSENSE_STRONG;
|
2009-08-28 15:54:03 +02:00
|
|
|
+ break;
|
2006-12-19 00:17:44 +01:00
|
|
|
default:
|
|
|
|
continue;
|
2009-08-28 15:54:03 +02:00
|
|
|
break;
|
2010-04-01 18:15:26 +02:00
|
|
|
--- ./lib/formats.c.orig 2009-12-07 14:36:49.000000000 +0000
|
|
|
|
+++ ./lib/formats.c 2010-03-25 15:00:15.000000000 +0000
|
|
|
|
@@ -601,6 +601,24 @@ static char * depflagsFormat(rpmtd td, c
|
2006-12-19 00:17:44 +01:00
|
|
|
return val;
|
|
|
|
}
|
|
|
|
|
2009-08-28 15:54:03 +02:00
|
|
|
+static char * depflag_strongFormat(rpmtd td, char * formatPrefix)
|
2006-12-19 00:17:44 +01:00
|
|
|
+{
|
2009-08-28 15:54:03 +02:00
|
|
|
+ char * val = NULL;
|
2006-12-19 00:17:44 +01:00
|
|
|
+
|
2010-12-20 14:37:51 +01:00
|
|
|
+ if (rpmtdClass(td) != RPM_NUMERIC_CLASS) {
|
2006-12-19 00:17:44 +01:00
|
|
|
+ val = xstrdup(_("(not a number)"));
|
|
|
|
+ } else {
|
2009-08-28 15:54:03 +02:00
|
|
|
+ uint64_t anint = rpmtdGetNumber(td);
|
|
|
|
+ char buf[10];
|
2006-12-19 00:17:44 +01:00
|
|
|
+ buf[0] = '\0';
|
|
|
|
+ if (anint & RPMSENSE_STRONG)
|
|
|
|
+ strcat(buf, "strong");
|
|
|
|
+ strcat(formatPrefix, "s");
|
2009-08-28 15:54:03 +02:00
|
|
|
+ rasprintf(&val, formatPrefix, buf);
|
2006-12-19 00:17:44 +01:00
|
|
|
+ }
|
|
|
|
+ return val;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
/**
|
2009-08-28 15:54:03 +02:00
|
|
|
* Return tag container array size.
|
|
|
|
* @param td tag data container
|
2010-04-01 18:15:26 +02:00
|
|
|
@@ -738,5 +756,6 @@ static const struct headerFormatFunc_s r
|
2009-08-28 15:54:03 +02:00
|
|
|
{ RPMTD_FORMAT_ARRAYSIZE, "arraysize", arraysizeFormat },
|
2010-04-01 18:15:26 +02:00
|
|
|
{ RPMTD_FORMAT_FSTATE, "fstate", fstateFormat },
|
|
|
|
{ RPMTD_FORMAT_VFLAGS, "vflags", vflagsFormat },
|
|
|
|
+ { RPMTD_FORMAT_DEPFLAG_STRONG, "depflag_strong", depflag_strongFormat },
|
2009-08-28 15:54:03 +02:00
|
|
|
{ -1, NULL, NULL }
|
|
|
|
};
|
2010-04-01 18:15:26 +02:00
|
|
|
--- ./lib/rpmds.c.orig 2009-12-07 14:36:49.000000000 +0000
|
|
|
|
+++ ./lib/rpmds.c 2010-03-25 14:53:47.000000000 +0000
|
|
|
|
@@ -66,6 +66,10 @@ static int dsType(rpmTag tag,
|
|
|
|
t = "Trigger";
|
|
|
|
evr = RPMTAG_TRIGGERVERSION;
|
|
|
|
f = RPMTAG_TRIGGERFLAGS;
|
|
|
|
+ } else if (tag == RPMTAG_ENHANCESNAME) {
|
|
|
|
+ t = "Enhances";
|
|
|
|
+ evr = RPMTAG_ENHANCESVERSION;
|
|
|
|
+ f = RPMTAG_ENHANCESFLAGS;
|
|
|
|
} else {
|
|
|
|
rc = 1;
|
|
|
|
}
|
|
|
|
--- ./lib/rpmds.h.orig 2010-03-24 16:47:28.000000000 +0000
|
|
|
|
+++ ./lib/rpmds.h 2010-03-25 14:53:47.000000000 +0000
|
2009-08-28 15:54:03 +02:00
|
|
|
@@ -55,7 +55,7 @@ typedef enum rpmsenseFlags_e {
|
|
|
|
RPMSENSE_RPMLIB = (1 << 24), /*!< rpmlib(feature) dependency. */
|
|
|
|
RPMSENSE_TRIGGERPREIN = (1 << 25), /*!< %triggerprein dependency. */
|
|
|
|
RPMSENSE_KEYRING = (1 << 26),
|
|
|
|
- RPMSENSE_PATCHES = (1 << 27),
|
|
|
|
+ RPMSENSE_STRONG = (1 << 27),
|
|
|
|
RPMSENSE_CONFIG = (1 << 28)
|
|
|
|
} rpmsenseFlags;
|
|
|
|
|
|
|
|
@@ -74,6 +74,7 @@ typedef enum rpmsenseFlags_e {
|
|
|
|
RPMSENSE_SCRIPT_VERIFY | \
|
|
|
|
RPMSENSE_FIND_REQUIRES | \
|
|
|
|
RPMSENSE_MISSINGOK | \
|
|
|
|
+ RPMSENSE_STRONG | \
|
|
|
|
RPMSENSE_SCRIPT_PREP | \
|
|
|
|
RPMSENSE_SCRIPT_BUILD | \
|
|
|
|
RPMSENSE_SCRIPT_INSTALL | \
|
2010-04-01 18:15:26 +02:00
|
|
|
--- ./lib/rpmtag.h.orig 2009-12-07 14:36:49.000000000 +0000
|
|
|
|
+++ ./lib/rpmtag.h 2010-03-25 14:53:47.000000000 +0000
|
2009-08-28 15:54:03 +02:00
|
|
|
@@ -228,14 +228,14 @@ typedef enum rpmTag_e {
|
|
|
|
RPMTAG_PRETRANSPROG = 1153, /* s */
|
|
|
|
RPMTAG_POSTTRANSPROG = 1154, /* s */
|
|
|
|
RPMTAG_DISTTAG = 1155, /* s */
|
|
|
|
- RPMTAG_SUGGESTSNAME = 1156, /* s[] extension (unimplemented) */
|
|
|
|
-#define RPMTAG_SUGGESTS RPMTAG_SUGGESTSNAME /* s[] (unimplemented) */
|
|
|
|
- RPMTAG_SUGGESTSVERSION = 1157, /* s[] extension (unimplemented) */
|
|
|
|
- RPMTAG_SUGGESTSFLAGS = 1158, /* i[] extension (unimplemented) */
|
|
|
|
- RPMTAG_ENHANCESNAME = 1159, /* s[] extension placeholder (unimplemented) */
|
|
|
|
-#define RPMTAG_ENHANCES RPMTAG_ENHANCESNAME /* s[] (unimplemented) */
|
|
|
|
- RPMTAG_ENHANCESVERSION = 1160, /* s[] extension placeholder (unimplemented) */
|
|
|
|
- RPMTAG_ENHANCESFLAGS = 1161, /* i[] extension placeholder (unimplemented) */
|
|
|
|
+ RPMTAG_SUGGESTSNAME = 1156, /* s[] extension */
|
|
|
|
+#define RPMTAG_SUGGESTS RPMTAG_SUGGESTSNAME /* s[] */
|
|
|
|
+ RPMTAG_SUGGESTSVERSION = 1157, /* s[] extension */
|
|
|
|
+ RPMTAG_SUGGESTSFLAGS = 1158, /* i[] extension */
|
|
|
|
+ RPMTAG_ENHANCESNAME = 1159, /* s[] extension */
|
|
|
|
+#define RPMTAG_ENHANCES RPMTAG_ENHANCESNAME /* s[] */
|
|
|
|
+ RPMTAG_ENHANCESVERSION = 1160, /* s[] extension */
|
|
|
|
+ RPMTAG_ENHANCESFLAGS = 1161, /* i[] extension */
|
|
|
|
RPMTAG_PRIORITY = 1162, /* i[] extension placeholder (unimplemented) */
|
|
|
|
RPMTAG_CVSID = 1163, /* s (unimplemented) */
|
|
|
|
#define RPMTAG_SVNID RPMTAG_CVSID /* s (unimplemented) */
|
2010-04-01 18:15:26 +02:00
|
|
|
--- ./lib/rpmtd.h.orig 2009-12-07 14:36:49.000000000 +0000
|
|
|
|
+++ ./lib/rpmtd.h 2010-03-25 14:58:31.000000000 +0000
|
|
|
|
@@ -216,6 +216,7 @@ typedef enum rpmtdFormats_e {
|
|
|
|
RPMTD_FORMAT_DEPTYPE = 15, /* dependency types (int types) */
|
|
|
|
RPMTD_FORMAT_FSTATE = 16, /* file states (int types) */
|
|
|
|
RPMTD_FORMAT_VFLAGS = 17, /* file verify flags (int types) */
|
|
|
|
+ RPMTD_FORMAT_DEPFLAG_STRONG = 18, /* strong dependency */
|
|
|
|
} rpmtdFormats;
|
|
|
|
|
|
|
|
/** \ingroup rpmtd
|
|
|
|
--- ./python/rpmmodule.c.orig 2009-12-07 14:36:49.000000000 +0000
|
|
|
|
+++ ./python/rpmmodule.c 2010-03-25 14:53:47.000000000 +0000
|
|
|
|
@@ -373,7 +373,7 @@ static int initModule(PyObject *m)
|
|
|
|
REGISTER_ENUM(RPMSENSE_RPMLIB);
|
|
|
|
REGISTER_ENUM(RPMSENSE_TRIGGERPREIN);
|
|
|
|
REGISTER_ENUM(RPMSENSE_KEYRING);
|
|
|
|
- REGISTER_ENUM(RPMSENSE_PATCHES);
|
|
|
|
+ REGISTER_ENUM(RPMSENSE_STRONG);
|
|
|
|
REGISTER_ENUM(RPMSENSE_CONFIG);
|
|
|
|
|
|
|
|
REGISTER_ENUM(RPMTRANS_FLAG_TEST);
|
|
|
|
--- ./rpmpopt.in.orig 2009-12-07 14:36:49.000000000 +0000
|
|
|
|
+++ ./rpmpopt.in 2010-03-25 14:53:47.000000000 +0000
|
|
|
|
@@ -65,6 +65,22 @@ rpm alias --requires --qf \
|
|
|
|
--POPTdesc=$"list capabilities required by package(s)"
|
|
|
|
rpm alias -R --requires
|
|
|
|
|
|
|
|
+rpm alias --suggests --qf \
|
|
|
|
+ "[%|SUGGESTSFLAGS:depflag_strong?{}:{%{SUGGESTSNAME} %{SUGGESTSFLAGS:depflags} %{SUGGESTSVERSION}\n}|]" \
|
|
|
|
+ --POPTdesc=$"list capabilities this package suggests"
|
|
|
|
+
|
|
|
|
+rpm alias --recommends --qf \
|
|
|
|
+ "[%|SUGGESTSFLAGS:depflag_strong?{%{SUGGESTSNAME} %{SUGGESTSFLAGS:depflags} %{SUGGESTSVERSION}\n}|]" \
|
|
|
|
+ --POPTdesc=$"list capabilities this package recommends"
|
|
|
|
+
|
|
|
|
+rpm alias --enhances --qf \
|
|
|
|
+ "[%|ENHANCESFLAGS:depflag_strong?{}:{%{ENHANCESNAME} %{ENHANCESFLAGS:depflags} %{ENHANCESVERSION}\n}|]" \
|
|
|
|
+ --POPTdesc=$"list capabilities this package enhances"
|
|
|
|
+
|
|
|
|
+rpm alias --supplements --qf \
|
|
|
|
+ "[%|ENHANCESFLAGS:depflag_strong?{%{ENHANCESNAME} %{ENHANCESFLAGS:depflags} %{ENHANCESVERSION}\n}|]" \
|
|
|
|
+ --POPTdesc=$"list capabilities this package supplements"
|
|
|
|
+
|
|
|
|
rpm alias --info --qf 'Name : %-27{NAME} Relocations: %|PREFIXES?{[%{PREFIXES} ]}:{(not relocatable)}|\n\
|
|
|
|
Version : %-27{VERSION} Vendor: %{VENDOR}\n\
|
|
|
|
Release : %-27{RELEASE} Build Date: %{BUILDTIME:date}\n\
|