summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2012-09-12 20:11:00 +0300
committerPanu Matilainen <pmatilai@redhat.com>2012-09-12 20:11:00 +0300
commitb6c794362aa9b3b2552f32bd13775a127febc17d (patch)
tree6f3186f7a36ebc0cb411466fe35e7d1a18c92567 /lib
parent2ea2a0961f380d844e4e1541df4f2c05f3b78449 (diff)
downloadlibrpm-tizen-b6c794362aa9b3b2552f32bd13775a127febc17d.tar.gz
librpm-tizen-b6c794362aa9b3b2552f32bd13775a127febc17d.tar.bz2
librpm-tizen-b6c794362aa9b3b2552f32bd13775a127febc17d.zip
Whoopsie, unbreak checking of installed dependencies
- The dependency sets created from installed headers during rpmtsCheck() were using a private pool and thus ids not matching with the ones in the global pool. Oops. Somehow none of our test-suite cases caught this, looks like we'll need more tests... Also the safe-guard assert()'s are in all the wrong places for catching this particular problem. Doh :) - There's a chicken-and-egg situation involved: in order to do this, the global pool needs to be in unfrozen state during rpmtsCheck(), which was not possible before switching rpmal provides (and files) to pool ids. Now that it *is* using pool id's, move the freeze-point to rpmtsPrepare() as the fingerprinting has similar issues with moving strings.
Diffstat (limited to 'lib')
-rw-r--r--lib/depends.c6
-rw-r--r--lib/transaction.c3
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/depends.c b/lib/depends.c
index b9d87d94e..e50c1b2c7 100644
--- a/lib/depends.c
+++ b/lib/depends.c
@@ -329,9 +329,6 @@ rpmal rpmtsCreateAl(rpmts ts, rpmElementTypes types)
rpmtsi pi;
rpmstrPool tspool = rpmtsPool(ts);
- /* Required for now to lock string pointers in memory */
- rpmstrPoolFreeze(tspool, 1);
-
al = rpmalCreate(tspool, (rpmtsNElements(ts) / 4) + 1, rpmtsFlags(ts),
rpmtsColor(ts), rpmtsPrefColor(ts));
pi = rpmtsiInit(ts);
@@ -629,10 +626,11 @@ static void checkInstDeps(rpmts ts, depCache dcache, rpmte te,
{
Header h;
rpmdbMatchIterator mi = rpmtsPrunedIterator(ts, depTag, dep, 1);
+ rpmstrPool pool = rpmtsPool(ts);
while ((h = rpmdbNextIterator(mi)) != NULL) {
char * pkgNEVRA = headerGetAsString(h, RPMTAG_NEVRA);
- rpmds ds = rpmdsNew(h, depTag, 0);
+ rpmds ds = rpmdsNewPool(pool, h, depTag, 0);
checkDS(ts, dcache, te, pkgNEVRA, ds, dep, 0);
diff --git a/lib/transaction.c b/lib/transaction.c
index 624077786..affc890d3 100644
--- a/lib/transaction.c
+++ b/lib/transaction.c
@@ -1357,6 +1357,9 @@ static int rpmtsPrepare(rpmts ts)
const char *dbhome = NULL;
struct stat dbstat;
+ /* Required for now to lock string pointers in memory */
+ rpmstrPoolFreeze(tsmem->pool, 1);
+
fingerPrintCache fpc = fpCacheCreate(fileCount/2 + 10001);
rpmFpHash ht = rpmFpHashCreate(fileCount/2+1, fpHashFunction, fpEqual,
NULL, NULL);