summaryrefslogtreecommitdiffstats
path: root/meta/packages/rpm/files/extcond.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/packages/rpm/files/extcond.patch')
-rw-r--r--meta/packages/rpm/files/extcond.patch78
1 files changed, 0 insertions, 78 deletions
diff --git a/meta/packages/rpm/files/extcond.patch b/meta/packages/rpm/files/extcond.patch
deleted file mode 100644
index 6963b8606c..0000000000
--- a/meta/packages/rpm/files/extcond.patch
+++ /dev/null
@@ -1,78 +0,0 @@
1This patch supports an extension in the condition evaluation.
2If the condition is a format and returns an nonempty string, it is
3assumed to be true.
4This mechanism is used by the weakdeps patch to filter the
5"RPMSENSE_STRONG" flag.
6
7--- ./rpmdb/header.c.orig 2005-06-06 23:33:54.000000000 +0000
8+++ ./rpmdb/header.c 2006-03-17 18:08:02.000000000 +0000
9@@ -2980,8 +2980,12 @@ static int parseExpression(headerSprintf
10
11 *endPtr = chptr;
12
13+ token->u.cond.tag.type = NULL;
14+ token->u.cond.tag.format = "";
15 token->type = PTOK_COND;
16
17+ if ((token->u.cond.tag.type = strchr(str, ':')) != 0)
18+ *token->u.cond.tag.type++ = 0;
19 (void) findTag(hsa, token, str);
20
21 return 0;
22@@ -3239,6 +3243,7 @@ static char * singleSprintf(headerSprint
23 int_32 type;
24 int_32 count;
25 sprintfToken spft;
26+ sprintfTag stag;
27 int condNumFormats;
28 size_t need;
29
30@@ -3270,6 +3275,18 @@ static char * singleSprintf(headerSprint
31 if (token->u.cond.tag.ext || headerIsEntry(hsa->h, token->u.cond.tag.tag)) {
32 spft = token->u.cond.ifFormat;
33 condNumFormats = token->u.cond.numIfTokens;
34+ if (token->u.cond.tag.fmt) {
35+ /* check if format creates output */
36+ size_t vallen = hsa->vallen;
37+ formatValue(hsa, &token->u.cond.tag, element);
38+ if (hsa->vallen == vallen) {
39+ spft = token->u.cond.elseFormat;
40+ condNumFormats = token->u.cond.numElseTokens;
41+ } else {
42+ hsa->vallen = vallen;
43+ hsa->val[hsa->vallen] = 0;
44+ }
45+ }
46 } else {
47 spft = token->u.cond.elseFormat;
48 condNumFormats = token->u.cond.numElseTokens;
49@@ -3291,19 +3308,22 @@ static char * singleSprintf(headerSprint
50 spft = token->u.array.format;
51 for (i = 0; i < token->u.array.numTokens; i++, spft++)
52 {
53- if (spft->type != PTOK_TAG ||
54- spft->u.tag.arrayCount ||
55- spft->u.tag.justOne) continue;
56+ if (spft->type != PTOK_TAG && spft->type != PTOK_COND)
57+ continue;
58+
59+ stag = (spft->type == PTOK_COND ? &spft->u.cond.tag : &spft->u.tag);
60+ if (stag->arrayCount || stag->justOne)
61+ continue;
62
63- if (spft->u.tag.ext) {
64+ if (stag->ext) {
65 /*@-boundswrite@*/
66- if (getExtension(hsa, spft->u.tag.ext, &type, NULL, &count,
67- hsa->ec + spft->u.tag.extNum))
68+ if (getExtension(hsa, stag->ext, &type, NULL, &count,
69+ hsa->ec + stag->extNum))
70 continue;
71 /*@=boundswrite@*/
72 } else {
73 /*@-boundswrite@*/
74- if (!headerGetEntry(hsa->h, spft->u.tag.tag, &type, NULL, &count))
75+ if (!headerGetEntry(hsa->h, stag->tag, &type, NULL, &count))
76 continue;
77 /*@=boundswrite@*/
78 }