From 6df098e76b0aff25b80ebeb58f649684c2634d44 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Tue, 18 Sep 2012 19:04:40 +0300 Subject: [PATCH] Unbreak fingerprinting when called twice for the same transaction set - Fixes regression (yum updates barf with conflicts) from commit 3b492620fb35a21d05b975e31130dc071f6fd8e2 which doesn't affect rpm itself but breaks some API users like yum that first run a test-transaction and if that succeeds, the same transaction is run for real. In that case we need to redo the whole fingerprint dance from scratch: throw away any former results and redo. - Blaming Fedora 18 alpha preparations for not noticing this earlier: there have been no updates to F16/F17 in almost a week, effectively disabling a part of the regular rpm development QA :P --- lib/rpmfi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/rpmfi.c b/lib/rpmfi.c index ad02117..cf968bd 100644 --- a/lib/rpmfi.c +++ b/lib/rpmfi.c @@ -1293,7 +1293,10 @@ rpm_loff_t rpmfiFReplacedSizeIndex(rpmfi fi, int ix) void rpmfiFpLookup(rpmfi fi, fingerPrintCache fpc) { - if (fi->fc > 0 && fi->fps == NULL) { + /* This can get called twice (eg yum), scratch former results and redo */ + if (fi->fc > 0) { + if (fi->fps) + free(fi->fps); fi->fps = fpLookupList(fpc, fi->pool, fi->dnid, fi->bnid, fi->dil, fi->fc); } -- 2.7.4