summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2004-04-07 23:50:35 +0000
committerjbj <devnull@localhost>2004-04-07 23:50:35 +0000
commit12d5c367af207a802583264dc70d986c19b02b09 (patch)
treeda3ef08033425e2402047caf33786f3418514efe /lib
parentdc885367f50e2d0669abd6308e1a09bb9aa9ae2d (diff)
downloadlibrpm-tizen-12d5c367af207a802583264dc70d986c19b02b09.tar.gz
librpm-tizen-12d5c367af207a802583264dc70d986c19b02b09.tar.bz2
librpm-tizen-12d5c367af207a802583264dc70d986c19b02b09.zip
- fix: no transaction lock if --test was specified (#119783).
CVS patchset: 7222 CVS date: 2004/04/07 23:50:35
Diffstat (limited to 'lib')
-rw-r--r--lib/transaction.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/transaction.c b/lib/transaction.c
index a07861574..240c0c1b4 100644
--- a/lib/transaction.c
+++ b/lib/transaction.c
@@ -1366,7 +1366,7 @@ int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
int numRemoved;
rpmts rollbackTransaction = NULL;
int rollbackOnFailure = 0;
- void * lock;
+ void * lock = NULL;
int xx;
@@ -1382,13 +1382,15 @@ int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
rollbackOnFailure = 0;
}
/* If we are in test mode, there is no need to rollback on
- * failure (-;
+ * failure, nor acquire the transaction lock.
*/
- if (rpmtsFlags(ts) & RPMTRANS_FLAG_TEST) rollbackOnFailure = 0;
-
- lock = rpmtsAcquireLock(ts);
- if (lock == NULL)
- return -1; /* XXX W2DO? */
+ if (rpmtsFlags(ts) & RPMTRANS_FLAG_TEST) {
+ rollbackOnFailure = 0;
+ } else {
+ lock = rpmtsAcquireLock(ts);
+ if (lock == NULL)
+ return -1; /* XXX W2DO? */
+ }
if (rpmtsFlags(ts) & RPMTRANS_FLAG_NOSCRIPTS)
(void) rpmtsSetFlags(ts, (rpmtsFlags(ts) | _noTransScripts | _noTransTriggers));
@@ -1462,7 +1464,7 @@ rpmMessage(RPMMESS_DEBUG, _("sanity checking %d elements\n"), rpmtsNElements(ts)
rpmteO(p), NULL,
NULL, 0);
- if (!(rpmtsFilterFlags(ts) & RPMPROB_FILTER_OLDPACKAGE)) {
+ if (!(rpmtsFilterFlags(ts) & RPMPROB_FILTER_OLDPACKAGE)) {
Header h;
mi = rpmtsInitIterator(ts, RPMTAG_NAME, rpmteN(p), 0);
while ((h = rpmdbNextIterator(mi)) != NULL)