fix bug in weakdepscompa.diff patch

OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=323
This commit is contained in:
Michael Schröder 2014-02-25 14:18:07 +00:00 committed by Git OBS Bridge
parent 71eb1c9707
commit 2a77ac8e0e
2 changed files with 24 additions and 20 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue Feb 25 15:19:48 CET 2014 - mls@suse.de
- fix bug in weakdepscompa.diff patch
-------------------------------------------------------------------
Fri Feb 21 13:33:48 CET 2014 - mls@suse.de

View File

@ -1,5 +1,5 @@
--- ./build/parsePreamble.c.orig 2014-02-20 15:46:48.217796445 +0000
+++ ./build/parsePreamble.c 2014-02-20 15:46:59.388796425 +0000
--- ./build/parsePreamble.c.orig 2014-02-25 14:14:15.892041649 +0000
+++ ./build/parsePreamble.c 2014-02-25 14:14:26.237041631 +0000
@@ -343,6 +343,7 @@ static struct tokenBits_s const installS
{ "verify", RPMSENSE_SCRIPT_VERIFY },
{ "pretrans", RPMSENSE_PRETRANS },
@ -8,8 +8,8 @@
{ NULL, 0 }
};
--- ./build/rpmfc.c.orig 2014-02-20 15:46:48.230796445 +0000
+++ ./build/rpmfc.c 2014-02-20 15:46:59.389796425 +0000
--- ./build/rpmfc.c.orig 2014-02-25 14:14:15.904041649 +0000
+++ ./build/rpmfc.c 2014-02-25 14:14:26.238041631 +0000
@@ -1156,6 +1156,12 @@ static struct DepMsg_s depMsgs[] = {
{ "Obsoletes", { "%{?__find_obsoletes}", NULL, NULL, NULL },
RPMTAG_OBSOLETENAME, RPMTAG_OBSOLETEVERSION, RPMTAG_OBSOLETEFLAGS,
@ -40,8 +40,8 @@
break;
default:
continue;
--- ./lib/rpmds.c.orig 2014-02-20 15:46:48.157796445 +0000
+++ ./lib/rpmds.c 2014-02-20 15:46:59.389796425 +0000
--- ./lib/rpmds.c.orig 2014-02-25 14:14:15.834041649 +0000
+++ ./lib/rpmds.c 2014-02-25 14:14:47.963041593 +0000
@@ -86,6 +86,14 @@ static int dsType(rpmTagVal tag,
t = "Trigger";
evr = RPMTAG_TRIGGERVERSION;
@ -50,16 +50,16 @@
+ t = "Oldsuggests";
+ evr = RPMTAG_OLDSUGGESTSVERSION;
+ f = RPMTAG_OLDSUGGESTSFLAGS;
+ } else if (tag == RPMTAG_OLDSUGGESTSNAME) {
+ } else if (tag == RPMTAG_OLDENHANCESNAME) {
+ t = "Oldenhances";
+ evr = RPMTAG_OLDENHANCESVERSION;
+ f = RPMTAG_OLDENHANCESFLAGS;
} else {
rc = 1;
}
--- ./lib/tagexts.c.orig 2014-02-20 15:46:48.162796445 +0000
+++ ./lib/tagexts.c 2014-02-20 15:48:04.458796310 +0000
@@ -906,6 +906,35 @@ static int depnevrsTag(Header h, rpmtd t
--- ./lib/tagexts.c.orig 2014-02-25 14:14:15.839041649 +0000
+++ ./lib/tagexts.c 2014-02-25 14:18:53.707041158 +0000
@@ -906,6 +906,34 @@ static int depnevrsTag(Header h, rpmtd t
return (ndeps > 0);
}
@ -73,20 +73,19 @@
+
+ if (ndeps > 0) {
+ char **deps = xmalloc(sizeof(*deps) * ndeps);
+ int i;
+ ndeps = 0;
+ while ((i = rpmdsNext(ds)) >= 0) {
+ if ((rpmdsFlags(ds) & RPMSENSE_STRONG) != strong)
+ continue;
+ ndeps = i + 1;
+ deps[i] = rpmdsNewDNEVR(NULL, ds);
+ while (rpmdsNext(ds) >= 0) {
+ if ((rpmdsFlags(ds) & RPMSENSE_STRONG) == (strong ? RPMSENSE_STRONG : 0))
+ deps[ndeps++] = rpmdsNewDNEVR(NULL, ds);
+ }
+ if (ndeps) {
+ td->data = deps;
+ td->type = RPM_STRING_ARRAY_TYPE;
+ td->count = ndeps;
+ td->flags |= (RPMTD_ALLOCED | RPMTD_PTR_ALLOCED);
+ }
+ } else {
+ _free(deps);
+ }
+ }
+ rpmdsFree(ds);
+ return (ndeps > 0);
@ -95,13 +94,13 @@
static int requirenevrsTag(Header h, rpmtd td, headerGetFlags hgflags)
{
return depnevrsTag(h, td, hgflags, RPMTAG_REQUIRENAME);
@@ -913,22 +942,26 @@ static int requirenevrsTag(Header h, rpm
@@ -913,22 +941,26 @@ static int requirenevrsTag(Header h, rpm
static int recommendnevrsTag(Header h, rpmtd td, headerGetFlags hgflags)
{
- return depnevrsTag(h, td, hgflags, RPMTAG_RECOMMENDNAME);
+ return depnevrsTag(h, td, hgflags, RPMTAG_RECOMMENDNAME) ||
+ depnevrsTagFiltered(h, td, hgflags, RPMTAG_OLDSUGGESTSNAME, RPMSENSE_STRONG);
+ depnevrsTagFiltered(h, td, hgflags, RPMTAG_OLDSUGGESTSNAME, 1);
}
static int suggestnevrsTag(Header h, rpmtd td, headerGetFlags hgflags)
@ -115,7 +114,7 @@
{
- return depnevrsTag(h, td, hgflags, RPMTAG_SUPPLEMENTNAME);
+ return depnevrsTag(h, td, hgflags, RPMTAG_SUPPLEMENTNAME) ||
+ depnevrsTagFiltered(h, td, hgflags, RPMTAG_OLDENHANCESNAME, RPMSENSE_STRONG);
+ depnevrsTagFiltered(h, td, hgflags, RPMTAG_OLDENHANCESNAME, 1);
}
static int enhancenevrsTag(Header h, rpmtd td, headerGetFlags hgflags)