summaryrefslogtreecommitdiff
path: root/lib/psm.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2010-05-07 15:25:38 +0300
committerPanu Matilainen <pmatilai@redhat.com>2010-05-07 15:25:38 +0300
commit775cbf8bf28775f913ac40a79d95de714fff6d2d (patch)
treebc8f6536143251410e215f1d490b8e3091551583 /lib/psm.c
parentf0518013733f4b2ac32ac15f1407c014ebc83e03 (diff)
downloadlibrpm-tizen-775cbf8bf28775f913ac40a79d95de714fff6d2d.tar.gz
librpm-tizen-775cbf8bf28775f913ac40a79d95de714fff6d2d.tar.bz2
librpm-tizen-775cbf8bf28775f913ac40a79d95de714fff6d2d.zip
Revert back to rpmdbRemove() taking instance number instead of actual header
- On package reinstall (ie --replacepkgs) we only know the old header by the instance number, and grabbing the header from the db in psm as a special case for that is more trouble than just doing what we always did. - Reverts commit e16695e932e294ec600e673d38c41bde20931204 and unbreaks the --replacepkgs test case
Diffstat (limited to 'lib/psm.c')
-rw-r--r--lib/psm.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/lib/psm.c b/lib/psm.c
index 525b1f4fd..75cafcb9f 100644
--- a/lib/psm.c
+++ b/lib/psm.c
@@ -1088,17 +1088,12 @@ static rpmRC rpmpsmStage(rpmpsm psm, pkgStage stage)
} break;
case PSM_RPMDB_REMOVE:
- if (!(rpmtsFlags(ts) & RPMTRANS_FLAG_TEST)) {
- Header h = rpmteHeader(psm->te);
-
- (void) rpmswEnter(rpmtsOp(ts, RPMTS_OP_DBREMOVE), 0);
- rc = rpmdbRemove(rpmtsGetRdb(ts), h);
- (void) rpmswExit(rpmtsOp(ts, RPMTS_OP_DBREMOVE), 0);
-
- if (rc == RPMRC_OK)
- rpmteSetDBInstance(psm->te, 0);
- headerFree(h);
- }
+ if (rpmtsFlags(ts) & RPMTRANS_FLAG_TEST) break;
+ (void) rpmswEnter(rpmtsOp(ts, RPMTS_OP_DBREMOVE), 0);
+ rc = rpmdbRemove(rpmtsGetRdb(ts), rpmteDBInstance(psm->te));
+ (void) rpmswExit(rpmtsOp(ts, RPMTS_OP_DBREMOVE), 0);
+ if (rc == RPMRC_OK)
+ rpmteSetDBInstance(psm->te, 0);
break;
default: