diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-03-17 12:04:39 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-03-17 12:04:39 +0200 |
commit | ed78cef2c3e14df29d95b476f00d51203fbe098e (patch) | |
tree | 8b998c19087e25a7a1cd624fe25963edad20e12a /lib/psm.c | |
parent | 874f6849d9f5f71b3815e358c6c5a049f6a4fa66 (diff) | |
download | rpm-ed78cef2c3e14df29d95b476f00d51203fbe098e.tar.gz rpm-ed78cef2c3e14df29d95b476f00d51203fbe098e.tar.bz2 rpm-ed78cef2c3e14df29d95b476f00d51203fbe098e.zip |
Remove support for automatic rollback on failure
- doing this reliably from rpm is simply not possible as there's no way
to undo script actions, might as well not pretend we can
- for a feature that's not generally usable it complicates mainline code
way too much
Diffstat (limited to 'lib/psm.c')
-rw-r--r-- | lib/psm.c | 105 |
1 files changed, 0 insertions, 105 deletions
@@ -20,7 +20,6 @@ #include "lib/psm.h" #include "lib/rpmfi_internal.h" /* XXX replaced/states, fi->hge, fi->te... */ #include "lib/rpmte_internal.h" /* XXX te->fd */ -#include "lib/rpmtsscore.h" #include "lib/rpmlead.h" /* writeLead proto */ #include "lib/signature.h" /* signature constants */ #include "lib/misc.h" /* XXX rpmMkdirPath, doputenv */ @@ -31,11 +30,6 @@ int _psm_debug = _PSM_DEBUG; int _psm_threads = 0; -/* Give access to the rpmte global tracking the last instance added - * to the database. - */ -extern unsigned int myinstall_instance; - /** */ struct rpmpsm_s { @@ -1060,7 +1054,6 @@ static rpmRC runTriggers(rpmpsm psm) if (psm->te) /* XXX can't happen */ N = rpmteN(psm->te); -/* XXX: Might need to adjust instance counts four autorollback. */ if (N) /* XXX can't happen */ numPackage = rpmdbCountPackages(rpmtsGetRdb(ts), N) + psm->countCorrection; @@ -1317,48 +1310,6 @@ rpmRC rpmpsmStage(rpmpsm psm, pkgStage stage) break; } - /* If we have a score then autorollback is enabled. If autorollback is - * enabled, and this is an autorollback transaction, then we may need to - * adjust the pkgs installed count. - * - * If all this is true, this adjustment should only be made if the PSM goal - * is an install. No need to make this adjustment on the erase - * component of the upgrade, or even more absurd to do this when doing a - * PKGSAVE. - */ - if (rpmtsGetScore(ts) != NULL && - rpmtsGetType(ts) == RPMTRANS_TYPE_AUTOROLLBACK && - (psm->goal & ~(PSM_PKGSAVE|PSM_PKGERASE))) { - /* Get the score, if its not NULL, get the appropriate - * score entry. - */ - rpmtsScore score = rpmtsGetScore(ts); - if (score != NULL) { - /* OK, we got a real score so lets get the appropriate - * score entry. - */ - rpmtsScoreEntry se; - se = rpmtsScoreGetEntry(score, rpmteN(psm->te)); - - /* IF the header for the install element has been installed, - * but the header for the erase element has not been erased, - * then decrement the instance count. This is because in an - * autorollback, if the header was added in the initial transaction - * then in the case of an upgrade the instance count will be - * 2 instead of one when re-installing the old package, and 3 when - * erasing the new package. - * - * Another wrinkle is we only want to make this adjustement - * if the thing we are rollback was an upgrade of package. A pure - * install or erase does not need the adjustment - */ - if (se && se->installed && - !se->erased && - (se->te_types & (TR_ADDED|TR_REMOVED))) - psm->npkgs_installed--; - } - } - if (psm->goal == PSM_PKGINSTALL) { int fc = rpmfiFC(fi); @@ -1992,35 +1943,6 @@ assert(psm->mi == NULL); rc = rpmdbAdd(rpmtsGetRdb(ts), rpmtsGetTid(ts), fi->h, NULL, NULL); - /* Set the database instance so consumers (i.e. rpmtsRun()) - * can add this to a rollback transaction. - */ - rpmteSetDBInstance(psm->te, myinstall_instance); - - /* - * If the score exists and this is not a rollback or autorollback - * then lets check off installed for this package. - */ - if (rpmtsGetScore(ts) != NULL && - rpmtsGetType(ts) != RPMTRANS_TYPE_ROLLBACK && - rpmtsGetType(ts) != RPMTRANS_TYPE_AUTOROLLBACK) - { - /* Get the score, if its not NULL, get the appropriate - * score entry. - */ - rpmtsScore score = rpmtsGetScore(ts); - if (score != NULL) { - rpmtsScoreEntry se; - /* OK, we got a real score so lets get the appropriate - * score entry. - */ - rpmlog(RPMLOG_DEBUG, - "Attempting to mark %s as installed in score board(%p).\n", - rpmteN(psm->te), score); - se = rpmtsScoreGetEntry(score, rpmteN(psm->te)); - if (se != NULL) se->installed = 1; - } - } (void) rpmswExit(rpmtsOp(ts, RPMTS_OP_DBADD), 0); break; case PSM_RPMDB_REMOVE: @@ -2028,33 +1950,6 @@ assert(psm->mi == NULL); (void) rpmswEnter(rpmtsOp(ts, RPMTS_OP_DBREMOVE), 0); rc = rpmdbRemove(rpmtsGetRdb(ts), rpmtsGetTid(ts), fi->record, NULL, NULL); - - /* - * If the score exists and this is not a rollback or autorollback - * then lets check off erased for this package. - */ - if (rpmtsGetScore(ts) != NULL && - rpmtsGetType(ts) != RPMTRANS_TYPE_ROLLBACK && - rpmtsGetType(ts) != RPMTRANS_TYPE_AUTOROLLBACK) - { - /* Get the score, if its not NULL, get the appropriate - * score entry. - */ - rpmtsScore score = rpmtsGetScore(ts); - - if (score != NULL) { /* XXX: Can't happen */ - rpmtsScoreEntry se; - /* OK, we got a real score so lets get the appropriate - * score entry. - */ - rpmlog(RPMLOG_DEBUG, - "Attempting to mark %s as erased in score board(%p).\n", - rpmteN(psm->te), score); - se = rpmtsScoreGetEntry(score, rpmteN(psm->te)); - if (se != NULL) se->erased = 1; - } - } - (void) rpmswExit(rpmtsOp(ts, RPMTS_OP_DBREMOVE), 0); break; |