SHA256
6
0
forked from pool/rpm

Accepting request 18841 from Base:System

Copy from Base:System/rpm based on submit request 18841 from user mlschroe

OBS-URL: https://build.opensuse.org/request/show/18841
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/rpm?expand=0&rev=84
This commit is contained in:
OBS User autobuild
2009-08-28 13:54:03 +00:00
committed by Git OBS Bridge
parent 77a1925059
commit a76d6c30a2
64 changed files with 3179 additions and 3463 deletions

View File

@@ -18,7 +18,7 @@ Index: build/parsePreamble.c
===================================================================
--- build/parsePreamble.c.orig
+++ build/parsePreamble.c
@@ -129,6 +129,8 @@ static struct tokenBits_s installScriptB
@@ -122,6 +122,8 @@ static struct tokenBits_s const installS
{ "post", RPMSENSE_SCRIPT_POST },
{ "rpmlib", RPMSENSE_RPMLIB },
{ "verify", RPMSENSE_SCRIPT_VERIFY },
@@ -27,7 +27,7 @@ Index: build/parsePreamble.c
{ NULL, 0 }
};
@@ -140,6 +142,8 @@ static struct tokenBits_s buildScriptBit
@@ -132,6 +134,8 @@ static const struct tokenBits_s const bu
{ "build", RPMSENSE_SCRIPT_BUILD },
{ "install", RPMSENSE_SCRIPT_INSTALL },
{ "clean", RPMSENSE_SCRIPT_CLEAN },
@@ -36,7 +36,7 @@ Index: build/parsePreamble.c
{ NULL, 0 }
};
@@ -692,6 +696,18 @@ static int handlePreambleTag(Spec spec,
@@ -637,6 +641,18 @@ static int handlePreambleTag(rpmSpec spe
if ((rc = parseRCPOT(spec, pkg, field, tag, 0, tagflags)))
return rc;
break;
@@ -55,10 +55,10 @@ Index: build/parsePreamble.c
case RPMTAG_EXCLUDEARCH:
case RPMTAG_EXCLUSIVEARCH:
case RPMTAG_EXCLUDEOS:
@@ -783,6 +799,14 @@ static struct PreambleRec_s preambleList
@@ -734,6 +750,14 @@ static struct PreambleRec_s preambleList
{RPMTAG_AUTOPROV, 0, 0, 0, "autoprov"},
{RPMTAG_DOCDIR, 0, 0, 0, "docdir"},
{RPMTAG_DISTTAG, 0, 0, 0, "disttag"},
{RPMTAG_CVSID, 0, 0, 0, "cvsid"},
{RPMTAG_SVNID, 0, 0, 0, "svnid"},
+ {RPMTAG_SUGGESTSFLAGS, 0, 0, 0, "recommends"},
+ {RPMTAG_SUGGESTSFLAGS, 0, 0, 0, "suggests"},
+ {RPMTAG_ENHANCESFLAGS, 0, 0, 0, "supplements"},
@@ -67,14 +67,14 @@ Index: build/parsePreamble.c
+ {RPMTAG_BUILDSUGGESTS, 0, 0, 0, "buildsuggests"},
+ {RPMTAG_BUILDENHANCES, 0, 0, 0, "buildsupplements"},
+ {RPMTAG_BUILDENHANCES, 0, 0, 0, "buildenhances"},
/*@-nullassign@*/ /* LCL: can't add null annotation */
/* LCL: can't add null annotation */
{0, 0, 0, 0, 0}
/*@=nullassign@*/
};
Index: build/parseReqs.c
===================================================================
--- build/parseReqs.c.orig
+++ build/parseReqs.c
@@ -85,6 +85,14 @@ int parseRCPOT(Spec spec, Package pkg, c
@@ -84,6 +84,14 @@ rpmRC parseRCPOT(rpmSpec spec, Package p
tagflags |= RPMSENSE_ANY;
h = spec->buildRestrictions;
break;
@@ -93,7 +93,7 @@ Index: build/reqprov.c
===================================================================
--- build/reqprov.c.orig
+++ build/reqprov.c
@@ -48,6 +48,16 @@ int addReqProv(/*@unused@*/ Spec spec, H
@@ -43,6 +43,16 @@ int addReqProv(rpmSpec spec, Header h, r
flagtag = RPMTAG_TRIGGERFLAGS;
indextag = RPMTAG_TRIGGERINDEX;
extra = Flags & RPMSENSE_TRIGGER;
@@ -114,7 +114,7 @@ Index: build/rpmfc.c
===================================================================
--- build/rpmfc.c.orig
+++ build/rpmfc.c
@@ -1385,6 +1385,12 @@ static struct DepMsg_s depMsgs[] = {
@@ -1377,6 +1377,12 @@ static struct DepMsg_s depMsgs[] = {
{ "Obsoletes", { "%{?__find_obsoletes}", NULL, NULL, NULL },
RPMTAG_OBSOLETENAME, RPMTAG_OBSOLETEVERSION, RPMTAG_OBSOLETEFLAGS,
0, -1 },
@@ -127,10 +127,10 @@ Index: build/rpmfc.c
{ NULL, { NULL, NULL, NULL, NULL }, 0, 0, 0, 0, 0 }
};
@@ -1480,6 +1486,14 @@ static int rpmfcGenerateDependsHelper(co
@@ -1467,6 +1473,14 @@ static int rpmfcGenerateDependsHelper(co
failnonzero = 0;
tagflags = RPMSENSE_FIND_REQUIRES;
/*@switchbreak@*/ break;
break;
+ case RPMTAG_ENHANCESFLAGS:
+ if (!pkg->autoProv)
+ continue;
@@ -138,36 +138,15 @@ Index: build/rpmfc.c
+ tagflags = RPMSENSE_FIND_REQUIRES | RPMSENSE_MISSINGOK;
+ if (strcmp(dm->msg, "Supplements") == 0)
+ tagflags |= RPMSENSE_STRONG;
+ /*@switchbreak@*/ break;
+ break;
default:
continue;
/*@notreached@*/ /*@switchbreak@*/ break;
Index: lib/rpmlib.h
===================================================================
--- lib/rpmlib.h.orig
+++ lib/rpmlib.h
@@ -541,7 +541,7 @@ typedef enum rpmsenseFlags_e {
RPMSENSE_TRIGGERPREIN = (1 << 25), /*!< @todo Implement %triggerprein. */
/*@=enummemuse@*/
RPMSENSE_KEYRING = (1 << 26),
- RPMSENSE_PATCHES = (1 << 27),
+ RPMSENSE_STRONG = (1 << 27),
RPMSENSE_CONFIG = (1 << 28),
RPMSENSE_PROBE = (1 << 29),
RPMSENSE_PACKAGE = (1 << 30)
@@ -562,6 +562,7 @@ typedef enum rpmsenseFlags_e {
RPMSENSE_SCRIPT_VERIFY | \
RPMSENSE_FIND_REQUIRES | \
RPMSENSE_MISSINGOK | \
+ RPMSENSE_STRONG | \
RPMSENSE_SCRIPT_PREP | \
RPMSENSE_SCRIPT_BUILD | \
RPMSENSE_SCRIPT_INSTALL | \
break;
Index: python/rpmmodule.c
===================================================================
--- python/rpmmodule.c.orig
+++ python/rpmmodule.c
@@ -433,7 +433,7 @@ void init_rpm(void)
@@ -387,7 +387,7 @@ void init_rpm(void)
REGISTER_ENUM(RPMSENSE_RPMLIB);
REGISTER_ENUM(RPMSENSE_TRIGGERPREIN);
REGISTER_ENUM(RPMSENSE_KEYRING);
@@ -180,23 +159,22 @@ Index: lib/rpmds.c
===================================================================
--- lib/rpmds.c.orig
+++ lib/rpmds.c
@@ -320,6 +320,11 @@ rpmds rpmdsNew(Header h, rpmTag tagN, in
tagEVR = RPMTAG_TRIGGERVERSION;
tagF = RPMTAG_TRIGGERFLAGS;
} else
+ if (tagN == RPMTAG_ENHANCESNAME) {
+ Type = "Enhances";
+ tagEVR = RPMTAG_ENHANCESVERSION;
+ tagF = RPMTAG_ENHANCESFLAGS;
+ } else
goto exit;
/*@-branchstate@*/
@@ -73,6 +73,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;
}
Index: rpmpopt.in
===================================================================
--- rpmpopt.in.orig
+++ rpmpopt.in
@@ -68,6 +68,22 @@ rpm alias --requires --qf \
@@ -65,6 +65,22 @@ rpm alias --requires --qf \
--POPTdesc=$"list capabilities required by package(s)"
rpm alias -R --requires
@@ -219,100 +197,100 @@ Index: rpmpopt.in
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\
@@ -351,6 +367,22 @@ rpmq alias --requires --qf \
--POPTdesc=$"list capabilities required by package(s)"
rpmq alias -R --requires
+rpmq alias --suggests --qf \
+ "[%|SUGGESTSFLAGS:depflag_strong?{}:{%{SUGGESTSNAME} %{SUGGESTSFLAGS:depflags} %{SUGGESTSVERSION}\n}|]" \
+ --POPTdesc=$"list capabilities this package suggests"
+
+rpmq alias --recommends --qf \
+ "[%|SUGGESTSFLAGS:depflag_strong?{%{SUGGESTSNAME} %{SUGGESTSFLAGS:depflags} %{SUGGESTSVERSION}\n}|]" \
+ --POPTdesc=$"list capabilities this package recommends"
+
+rpmq alias --enhances --qf \
+ "[%|ENHANCESFLAGS:depflag_strong?{}:{%{ENHANCESNAME} %{ENHANCESFLAGS:depflags} %{ENHANCESVERSION}\n}|]" \
+ --POPTdesc=$"list capabilities this package enhances"
+
+rpmq alias --supplements --qf \
+ "[%|ENHANCESFLAGS:depflag_strong?{%{ENHANCESNAME} %{ENHANCESFLAGS:depflags} %{ENHANCESVERSION}\n}|]" \
+ --POPTdesc=$"list capabilities this package supplements"
+
rpmq 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\
@@ -452,6 +484,22 @@ rpmquery alias --requires --qf \
--POPTdesc=$"list capabilities required by package(s)"
rpmquery alias -R --requires
+rpmquery alias --suggests --qf \
+ "[%|SUGGESTSFLAGS:depflag_strong?{}:{%{SUGGESTSNAME} %{SUGGESTSFLAGS:depflags} %{SUGGESTSVERSION}\n}|]" \
+ --POPTdesc=$"list capabilities this package suggests"
+
+rpmquery alias --recommends --qf \
+ "[%|SUGGESTSFLAGS:depflag_strong?{%{SUGGESTSNAME} %{SUGGESTSFLAGS:depflags} %{SUGGESTSVERSION}\n}|]" \
+ --POPTdesc=$"list capabilities this package recommends"
+
+rpmquery alias --enhances --qf \
+ "[%|ENHANCESFLAGS:depflag_strong?{}:{%{ENHANCESNAME} %{ENHANCESFLAGS:depflags} %{ENHANCESVERSION}\n}|]" \
+ --POPTdesc=$"list capabilities this package enhances"
+
+rpmquery alias --supplements --qf \
+ "[%|ENHANCESFLAGS:depflag_strong?{%{ENHANCESNAME} %{ENHANCESFLAGS:depflags} %{ENHANCESVERSION}\n}|]" \
+ --POPTdesc=$"list capabilities this package supplements"
+
rpmquery 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\
Index: lib/formats.c
===================================================================
--- lib/formats.c.orig
+++ lib/formats.c
@@ -652,6 +652,38 @@ static /*@only@*/ char * depflagsFormat(
@@ -601,6 +601,25 @@ static char * depflagsFormat(rpmtd td, c
return val;
}
+static /*@only@*/ char * depflag_strongFormat(int_32 type, const void * data,
+ char * formatPrefix, int padding, /*@unused@*/ int element)
+ /*@modifies formatPrefix @*/
+ /*@requires maxRead(data) >= 0 @*/
+static char * depflag_strongFormat(rpmtd td, char * formatPrefix)
+{
+ char * val;
+ char buf[10];
+ int anint;
+ char * val = NULL;
+
+ if (type != RPM_INT32_TYPE) {
+ if (rpmtdType(td) != RPM_NUMERIC_CLASS) {
+ val = xstrdup(_("(not a number)"));
+ } else {
+ anint = *((int_32 *) data);
+ uint64_t anint = rpmtdGetNumber(td);
+ char buf[10];
+ buf[0] = '\0';
+
+/*@-boundswrite@*/
+ if (anint & RPMSENSE_STRONG)
+ strcat(buf, "strong");
+/*@=boundswrite@*/
+
+ val = xmalloc(7 + padding);
+/*@-boundswrite@*/
+ strcat(formatPrefix, "s");
+/*@=boundswrite@*/
+ /*@-formatconst@*/
+ sprintf(val, formatPrefix, buf);
+ /*@=formatconst@*/
+ rasprintf(&val, formatPrefix, buf);
+ }
+
+ return val;
+}
+
/**
* Retrieve mounted file system paths.
* @param h header
@@ -1347,6 +1379,7 @@ const struct headerSprintfExtension_s rp
{ HEADER_EXT_FORMAT, "base64", { base64Format } },
{ HEADER_EXT_FORMAT, "pgpsig", { pgpsigFormat } },
{ HEADER_EXT_FORMAT, "depflags", { depflagsFormat } },
+ { HEADER_EXT_FORMAT, "depflag_strong", { depflag_strongFormat } },
{ HEADER_EXT_FORMAT, "fflags", { fflagsFormat } },
{ HEADER_EXT_FORMAT, "perms", { permsFormat } },
{ HEADER_EXT_FORMAT, "permissions", { permsFormat } },
* Return tag container array size.
* @param td tag data container
@@ -661,5 +680,6 @@ static const struct headerFormatFunc_s r
{ RPMTD_FORMAT_DAY, "day", dayFormat },
{ RPMTD_FORMAT_SHESCAPE, "shescape", shescapeFormat },
{ RPMTD_FORMAT_ARRAYSIZE, "arraysize", arraysizeFormat },
+ { RPMTD_FORMAT_DEPFLAG_STRONG, "depflag_strong", { depflag_strongFormat } },
{ -1, NULL, NULL }
};
Index: lib/rpmds.h
===================================================================
--- lib/rpmds.h.orig
+++ lib/rpmds.h
@@ -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 | \
Index: lib/rpmtd.h
===================================================================
--- lib/rpmtd.h.orig
+++ lib/rpmtd.h
@@ -214,6 +214,7 @@ typedef enum rpmtdFormats_e {
RPMTD_FORMAT_SHESCAPE = 13, /* shell escaped (any type) */
RPMTD_FORMAT_ARRAYSIZE = 14, /* size of contained array (any type) */
RPMTD_FORMAT_DEPTYPE = 15, /* dependency types (int32 types) */
+ RPMTD_FORMAT_DEPFLAG_STRONG = 16, /* strong dependency */
} rpmtdFormats;
/** \ingroup rpmtd
Index: lib/rpmtag.h
===================================================================
--- lib/rpmtag.h.orig
+++ lib/rpmtag.h
@@ -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) */