summaryrefslogtreecommitdiff
path: root/lib/rpmds.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2009-10-21 12:47:35 +0300
committerPanu Matilainen <pmatilai@redhat.com>2009-10-21 12:47:35 +0300
commit33c569ce6fd827ba039e36ffe0a77b0643d0ac70 (patch)
tree9922577469ffc37418fdbc5189d3b255617a2c48 /lib/rpmds.c
parent9fbaedd1ac655d978883d68a1f7d34df0d703363 (diff)
downloadlibrpm-tizen-33c569ce6fd827ba039e36ffe0a77b0643d0ac70.tar.gz
librpm-tizen-33c569ce6fd827ba039e36ffe0a77b0643d0ac70.tar.bz2
librpm-tizen-33c569ce6fd827ba039e36ffe0a77b0643d0ac70.zip
Ensure RPMSENSE_RPMLIB bit is always set on rpmlib() requires in rpmds flags
- some packages in the wild have rpmlib() requires without the flag set due to older rpm not always setting it (for one, rpmdeps as external dependency generator could cause such deps), causing bogus dependency failures on install - only fix up dependencies coming from a header, rpmdsSingle() correctness is up to the caller
Diffstat (limited to 'lib/rpmds.c')
-rw-r--r--lib/rpmds.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/rpmds.c b/lib/rpmds.c
index cab6f968e..aec5f6a77 100644
--- a/lib/rpmds.c
+++ b/lib/rpmds.c
@@ -154,6 +154,14 @@ rpmds rpmdsNew(Header h, rpmTag tagN, int flags)
ds->EVR = evr.data;
headerGet(h, tagF, &flags, hgflags);
ds->Flags = flags.data;
+ /* ensure rpmlib() requires always have RPMSENSE_RPMLIB flag set */
+ if (tagN == RPMTAG_REQUIRENAME) {
+ for (int i = 0; i < ds->Count; i++) {
+ if (!(ds->Flags[i] & RPMSENSE_RPMLIB) &&
+ rstreqn(ds->N[i], "rpmlib(", sizeof("rpmlib(")-1))
+ ds->Flags[i] |= RPMSENSE_RPMLIB;
+ }
+ }
ds->BT = headerGetNumber(h, RPMTAG_BUILDTIME);
ds->Color = xcalloc(ds->Count, sizeof(*ds->Color));