summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2008-09-07 10:55:38 +0000
committerRichard Purdie <richard@openedhand.com>2008-09-07 10:55:38 +0000
commit2c832c53e7af7f085324e71c4ab6bc238c45c03b (patch)
tree999014b0a2c0fb94119f4e7199788616cc15e97d /meta
parente1af8defd6fce62a339e75c6cea11491ffc43b6c (diff)
downloadpoky-2c832c53e7af7f085324e71c4ab6bc238c45c03b.tar.gz
rpm: Add missing patches
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5154 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta')
-rw-r--r--meta/packages/rpm/files/extcond.patch78
-rw-r--r--meta/packages/rpm/files/missingok.patch44
2 files changed, 122 insertions, 0 deletions
diff --git a/meta/packages/rpm/files/extcond.patch b/meta/packages/rpm/files/extcond.patch
new file mode 100644
index 0000000000..6963b8606c
--- /dev/null
+++ b/meta/packages/rpm/files/extcond.patch
@@ -0,0 +1,78 @@
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 }
diff --git a/meta/packages/rpm/files/missingok.patch b/meta/packages/rpm/files/missingok.patch
new file mode 100644
index 0000000000..b008c9a02b
--- /dev/null
+++ b/meta/packages/rpm/files/missingok.patch
@@ -0,0 +1,44 @@
1Obey MISSINGOK flag for dependencies. Backport from rpm-4.4.7.
2
3Index: lib/depends.c
4===================================================================
5--- lib/depends.c.orig 2008-04-01 08:28:22.000000000 +0100
6+++ lib/depends.c 2008-09-04 14:09:58.000000000 +0100
7@@ -593,8 +593,13 @@
8 /*@=boundsread@*/
9
10 unsatisfied:
11- rc = 1; /* dependency is unsatisfied */
12- rpmdsNotify(dep, NULL, rc);
13+ if (rpmdsFlags(dep) & RPMSENSE_MISSINGOK) {
14+ rc = 0; /* dependency is unsatisfied, but just a hint. */
15+ rpmdsNotify(dep, _("(hint skipped)"), rc);
16+ } else {
17+ rc = 1; /* dependency is unsatisfied */
18+ rpmdsNotify(dep, NULL, rc);
19+ }
20
21 exit:
22 /*
23@@ -963,6 +968,8 @@
24 return "Requires(postun):";
25 if (f & RPMSENSE_SCRIPT_VERIFY)
26 return "Requires(verify):";
27+ if (f & RPMSENSE_MISSINGOK)
28+ return "Requires(hint):";
29 if (f & RPMSENSE_FIND_REQUIRES)
30 return "Requires(auto):";
31 return "Requires:";
32Index: lib/rpmlib.h
33===================================================================
34--- lib/rpmlib.h.orig 2008-09-03 22:22:43.000000000 +0100
35+++ lib/rpmlib.h 2008-09-04 15:17:17.000000000 +0100
36@@ -562,6 +562,8 @@
37 RPMSENSE_SCRIPT_POSTUN | \
38 RPMSENSE_SCRIPT_VERIFY | \
39 RPMSENSE_FIND_REQUIRES | \
40+ RPMSENSE_MISSINGOK | \
41+ RPMSENSE_STRONG | \
42 RPMSENSE_SCRIPT_PREP | \
43 RPMSENSE_SCRIPT_BUILD | \
44 RPMSENSE_SCRIPT_INSTALL | \