summaryrefslogtreecommitdiff
path: root/lib/rpmal.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2012-10-05 10:13:09 +0300
committerPanu Matilainen <pmatilai@redhat.com>2012-10-05 10:13:09 +0300
commitf4bb2487d4942c60063e6985616ca5de2558195a (patch)
tree6032cec52e036511b1ac71e019ac99de1cd28d6a /lib/rpmal.c
parentdb80e6ed5aea6c688104125059b3f11cc763f682 (diff)
downloadrpm-f4bb2487d4942c60063e6985616ca5de2558195a.tar.gz
rpm-f4bb2487d4942c60063e6985616ca5de2558195a.tar.bz2
rpm-f4bb2487d4942c60063e6985616ca5de2558195a.zip
Avoid changing the dependency sets when adding to rpmal hash
- Use indexed access to the dependencies so we're not mucking with the rpmds iterator index behind anybodys back, this could affect all sorts of things but miraculously nothing is hitting it atm...
Diffstat (limited to 'lib/rpmal.c')
-rw-r--r--lib/rpmal.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/rpmal.c b/lib/rpmal.c
index 232d8ba8f..63a70e2a1 100644
--- a/lib/rpmal.c
+++ b/lib/rpmal.c
@@ -5,7 +5,6 @@
#include "system.h"
-#include <rpm/rpmds.h>
#include <rpm/rpmte.h>
#include <rpm/rpmfi.h>
#include <rpm/rpmstrpool.h>
@@ -13,6 +12,7 @@
#include "lib/rpmal.h"
#include "lib/misc.h"
#include "lib/rpmte_internal.h"
+#include "lib/rpmds_internal.h"
#include "debug.h"
@@ -213,22 +213,23 @@ static void rpmalAddProvides(rpmal al, rpmalNum pkgNum, rpmds provides)
struct availableIndexEntry_s indexEntry;
rpm_color_t dscolor;
int skipconf = (al->tsflags & RPMTRANS_FLAG_NOCONFIGS);
+ int dc = rpmdsCount(provides);
indexEntry.pkgNum = pkgNum;
- if (rpmdsInit(provides) != NULL)
- while (rpmdsNext(provides) >= 0) {
+ for (int i = 0; i < dc; i++) {
/* Ignore colored provides not in our rainbow. */
- dscolor = rpmdsColor(provides);
+ dscolor = rpmdsColorIndex(provides, i);
if (al->tscolor && dscolor && !(al->tscolor & dscolor))
continue;
/* Ignore config() provides if the files wont be installed */
- if (skipconf & (rpmdsFlags(provides) & RPMSENSE_CONFIG))
+ if (skipconf & (rpmdsFlagsIndex(provides, i) & RPMSENSE_CONFIG))
continue;
- indexEntry.entryIx = rpmdsIx(provides);
- rpmalProvidesHashAddEntry(al->providesHash, rpmdsNId(provides), indexEntry);
+ indexEntry.entryIx = i;;
+ rpmalProvidesHashAddEntry(al->providesHash,
+ rpmdsNIdIndex(provides, i), indexEntry);
}
}