From c25894e3b9a4cf9a1268f4e6ea947ed5ec6c1419 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Fri, 3 Feb 2012 12:23:31 +0200 Subject: [PATCH] Honor RPMTRANS_FLAG_TEST in rpmtsImportPubkey() --- lib/rpmts.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/rpmts.c b/lib/rpmts.c index dca718c..02713d3 100644 --- a/lib/rpmts.c +++ b/lib/rpmts.c @@ -478,10 +478,12 @@ rpmRC rpmtsImportPubkey(const rpmts ts, const unsigned char * pkt, size_t pktlen headerPutUint32(h, RPMTAG_INSTALLTID, &tid, 1); /* Add header to database. */ - if (rpmtsOpenDB(ts, (O_RDWR|O_CREAT))) - goto exit; - if (rpmdbAdd(rpmtsGetRdb(ts), h) != 0) - goto exit; + if (!(rpmtsFlags(ts) & RPMTRANS_FLAG_TEST)) { + if (rpmtsOpenDB(ts, (O_RDWR|O_CREAT))) + goto exit; + if (rpmdbAdd(rpmtsGetRdb(ts), h) != 0) + goto exit; + } } rc = RPMRC_OK; -- 2.7.4