SHA256
3
0
forked from pool/rpm

- remove no longer needed and now harmful extcond patch

OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=449
This commit is contained in:
Michael Schröder 2018-03-01 15:44:37 +00:00 committed by Git OBS Bridge
parent 9b5e4c009a
commit 55db42d25b
3 changed files with 8 additions and 67 deletions

View File

@ -1,65 +0,0 @@
This patch supports an extension in the condition evaluation.
If the condition is a format and returns an nonempty string, it is
assumed to be true.
This mechanism is used by the weakdeps patch to filter the
"RPMSENSE_STRONG" flag.
--- ./lib/headerfmt.c.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./lib/headerfmt.c 2011-05-10 17:06:49.000000000 +0000
@@ -568,8 +568,12 @@ static int parseExpression(headerSprintf
*endPtr = chptr;
+ token->u.cond.tag.type = NULL;
+ token->u.cond.tag.format = "";
token->type = PTOK_COND;
+ if ((token->u.cond.tag.type = strchr(str, ':')) != 0)
+ *token->u.cond.tag.type++ = 0;
(void) findTag(hsa, token, str);
return 0;
@@ -657,6 +661,7 @@ static char * singleSprintf(headerSprint
int i, j, found;
rpm_count_t count, numElements;
sprintfToken spft;
+ sprintfTag stag;
int condNumFormats;
size_t need;
@@ -687,6 +692,18 @@ static char * singleSprintf(headerSprint
headerIsEntry(hsa->h, token->u.cond.tag.tag)) {
spft = token->u.cond.ifFormat;
condNumFormats = token->u.cond.numIfTokens;
+ if (token->u.cond.tag.fmt) {
+ /* check if format creates output */
+ size_t vallen = hsa->vallen;
+ formatValue(hsa, &token->u.cond.tag, element);
+ if (hsa->vallen == vallen) {
+ spft = token->u.cond.elseFormat;
+ condNumFormats = token->u.cond.numElseTokens;
+ } else {
+ hsa->vallen = vallen;
+ hsa->val[hsa->vallen] = 0;
+ }
+ }
} else {
spft = token->u.cond.elseFormat;
condNumFormats = token->u.cond.numElseTokens;
@@ -710,10 +727,13 @@ static char * singleSprintf(headerSprint
for (i = 0; i < token->u.array.numTokens; i++, spft++)
{
rpmtd td = NULL;
- if (spft->type != PTOK_TAG ||
- spft->u.tag.justOne) continue;
+ if (spft->type != PTOK_TAG && spft->type != PTOK_COND)
+ continue;
+ stag = (spft->type == PTOK_COND ? &spft->u.cond.tag : &spft->u.tag);
+ if (stag->justOne)
+ continue;
- if (!(td = getData(hsa, spft->u.tag.tag))) {
+ if (!(td = getData(hsa, stag->tag))) {
continue;
}

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu Mar 1 16:42:07 CET 2018 - mls@suse.de
- remove no longer needed and now harmful extcond patch
[bnc#1083539]
dropped patch: extcond.diff
-------------------------------------------------------------------
Thu Feb 22 15:14:49 UTC 2018 - fvogt@suse.com

View File

@ -75,7 +75,6 @@ Patch12: localetag.diff
Patch14: nameversioncompare.diff
Patch15: dbfsync.diff
Patch16: dbrointerruptable.diff
Patch17: extcond.diff
Patch18: refreshtestarch.diff
Patch20: waitlock.diff
Patch21: suspendlock.diff
@ -218,7 +217,7 @@ rm -f rpmdb/db.h
%patch3 -p1
%patch -P 4
%patch5 -p1
%patch -P 11 -P 12 -P 13 -P 14 -P 15 -P 16 -P 17 -P 18
%patch -P 11 -P 12 -P 13 -P 14 -P 15 -P 16 -P 18
%patch -P 20 -P 21 -P 24 -P 25 -P 26 -P 27 -P 28 -P 29
%patch -P 30 -P 31 -P 32 -P 33 -P 34 -P 35 -P 36 -P 38
%patch -P 43 -P 45 -P 46 -P 47 -P 49