rpm
5.4.10
|
#include "system.h"
#include <rpmio.h>
#include <rpmiotypes.h>
#include <rpmlog.h>
#include <rpmmacro.h>
#include <rpmsx.h>
#include <rpmtypes.h>
#include <rpmtag.h>
#include <pkgio.h>
#include "fprint.h"
#include <rpmdb.h>
#include "legacy.h"
#include <rpmfi.h>
#include "fsm.h"
#include "rpmte.h"
#include "rpmts.h"
#include "psm.h"
#include "rpmds.h"
#include "rpmlock.h"
#include "misc.h"
#include <rpmcli.h>
#include <rpmrollback.h>
#include "debug.h"
Go to the source code of this file.
Macros | |
#define | _FPRINT_INTERNAL |
#define | _RPMDB_INTERNAL /* XXX for dbiIndexFoo() */ |
#define | _RPMFI_INTERNAL |
#define | _RPMTE_INTERNAL |
#define | _RPMTS_INTERNAL |
#define | _RPMSQ_INTERNAL |
#define | _RPMPSM_INTERNAL |
#define | FF_ISSET(_fflags, _FLAG) ((_fflags) & (RPMFILE_##_FLAG)) |
#define | QVA_ISSET(_qvaflags, _FLAG) ((_qvaflags) & (VERIFY_##_FLAG)) |
#define | VSF_ISSET(_vsflags, _FLAG) ((_vsflags) & (RPMVSF_##_FLAG)) |
#define | VSF_SET(_vsflags, _FLAG) (_vsflags) |= (RPMVSF_##_FLAG) |
#define | VSF_CLR(_vsflags, _FLAG) (_vsflags) &= ~(RPMVSF_##_FLAG) |
#define | TSF_ISSET(_tsflags, _FLAG) ((_tsflags) & (RPMTRANS_FLAG_##_FLAG)) |
#define | TSF_SET(_tsflags, _FLAG) (_tsflags) |= (RPMTRANS_FLAG_##_FLAG) |
#define | TSF_CLR(_tsflags, _FLAG) (_tsflags) &= ~(RPMTRANS_FLAG_##_FLAG) |
#define | IIF_ISSET(_iflags, _FLAG) ((_iflags) & (INSTALL_##_FLAG)) |
#define | IIF_SET(_iflags, _FLAG) (_iflags) |= (INSTALL_##_FLAG) |
#define | IIF_CLR(_iflags, _FLAG) (_iflags) &= ~(INSTALL_##_FLAG) |
#define | ISROOT(_d) (((_d)[0] == '/' && (_d)[1] == '\0') ? "" : (_d)) |
#define | FPSDEBUG(_debug, _list) if ((_debug) || _fps_debug) fprintf _list |
Functions | |
static int | handleInstInstalledFile (const rpmts ts, rpmte p, rpmfi fi, Header otherHeader, rpmfi otherFi, int beingRemoved) |
static void | handleOverlappedFiles (const rpmts ts, const rpmte p, rpmfi fi) |
Update disk space needs on each partition for this package's files. | |
static int | ensureOlder (rpmts ts, const rpmte p, const Header h) |
Ensure that current package is newer than installed package. | |
static void | rpmtsSkipFiles (const rpmts ts, rpmfi fi) |
Skip any files that do not match install policies. | |
static rpmfi | rpmtsiFi (const rpmtsi tsi) |
Return transaction element's file info. | |
static int | cmpArgvStr (const char **AV, const char *B) |
Search for string B in argv array AV. | |
static int | rpmtsMarkLinkedFailed (rpmts ts, rpmte p) |
Mark all erasure elements linked to installed element p as failed. | |
static rpmmi | rpmtsFindBaseNamesInDB (rpmts ts, uint32_t fileCount) |
static int | rpmtsCheckInstalledFiles (rpmts ts, uint32_t fileCount, hashTable ht, fingerPrintCache fpc) |
static rpmps | rpmtsSanityCheck (rpmts ts, uint32_t *tfcp) |
static int | rpmtsRunScript (rpmts ts, rpmTag stag) |
static void | rpmtsAddFingerprints (rpmts ts, uint32_t fileCount, hashTable ht, fingerPrintCache fpc) |
static int | rpmtsSetup (rpmts ts, rpmprobFilterFlags ignoreSet, rpmsx *sxp) |
static int | rpmtsFinish (rpmts ts, rpmsx sx) |
static int | rpmtsPrepare (rpmts ts, rpmsx sx, uint32_t fileCount, uint32_t *nrmvdp) |
static int | rpmtsProcess (rpmts ts, rpmprobFilterFlags ignoreSet, int rollbackFailures) |
static int | rpmtsRepackage (rpmts ts, uint32_t numRemoved) |
static rpmRC | _processFailedPackage (rpmts ts, rpmte p) |
Force add a failed package into the rpmdb. | |
rpmRC | rpmtsRollback (rpmts rbts, rpmprobFilterFlags ignoreSet, int running, rpmte rbte) |
Rollback a failed transaction. | |
int | _rpmtsRun (rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet) |
Variables | |
int | _fps_debug = 0 |
int(* | rpmtsRun )(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet) = _rpmtsRun |
Process all package elements in a transaction set. |
Definition in file transaction.c.
#define _FPRINT_INTERNAL |
Definition at line 17 of file transaction.c.
#define _RPMDB_INTERNAL /* XXX for dbiIndexFoo() */ |
Definition at line 20 of file transaction.c.
#define _RPMFI_INTERNAL |
Definition at line 24 of file transaction.c.
#define _RPMPSM_INTERNAL |
Definition at line 34 of file transaction.c.
#define _RPMSQ_INTERNAL |
Definition at line 33 of file transaction.c.
#define _RPMTE_INTERNAL |
Definition at line 28 of file transaction.c.
#define _RPMTS_INTERNAL |
Definition at line 30 of file transaction.c.
#define FF_ISSET | ( | _fflags, | |
_FLAG | |||
) | ((_fflags) & (RPMFILE_##_FLAG)) |
Definition at line 118 of file transaction.c.
Referenced by handleInstInstalledFile(), handleOverlappedFiles(), and rpmtsSkipFiles().
#define FPSDEBUG | ( | _debug, | |
_list | |||
) | if ((_debug) || _fps_debug) fprintf _list |
Definition at line 262 of file transaction.c.
Referenced by _processFailedPackage(), _rpmtsRun(), ensureOlder(), handleOverlappedFiles(), rpmtsAddFingerprints(), rpmtsCheckInstalledFiles(), rpmtsFindBaseNamesInDB(), rpmtsFinish(), rpmtsPrepare(), rpmtsProcess(), rpmtsRepackage(), rpmtsRollback(), rpmtsRunScript(), rpmtsSanityCheck(), rpmtsSetup(), and rpmtsSkipFiles().
#define IIF_CLR | ( | _iflags, | |
_FLAG | |||
) | (_iflags) &= ~(INSTALL_##_FLAG) |
Definition at line 132 of file transaction.c.
#define IIF_ISSET | ( | _iflags, | |
_FLAG | |||
) | ((_iflags) & (INSTALL_##_FLAG)) |
Definition at line 130 of file transaction.c.
#define IIF_SET | ( | _iflags, | |
_FLAG | |||
) | (_iflags) |= (INSTALL_##_FLAG) |
Definition at line 131 of file transaction.c.
Referenced by rpmtsRollback().
#define ISROOT | ( | _d | ) | (((_d)[0] == '/' && (_d)[1] == '\0') ? "" : (_d)) |
Definition at line 258 of file transaction.c.
#define QVA_ISSET | ( | _qvaflags, | |
_FLAG | |||
) | ((_qvaflags) & (VERIFY_##_FLAG)) |
Definition at line 120 of file transaction.c.
#define TSF_CLR | ( | _tsflags, | |
_FLAG | |||
) | (_tsflags) &= ~(RPMTRANS_FLAG_##_FLAG) |
Definition at line 128 of file transaction.c.
Referenced by rpmtsRollback().
#define TSF_ISSET | ( | _tsflags, | |
_FLAG | |||
) | ((_tsflags) & (RPMTRANS_FLAG_##_FLAG)) |
Definition at line 126 of file transaction.c.
Referenced by _rpmtsRun(), handleInstInstalledFile(), rpmtsFinish(), rpmtsProcess(), rpmtsRepackage(), rpmtsSetup(), and rpmtsSkipFiles().
#define TSF_SET | ( | _tsflags, | |
_FLAG | |||
) | (_tsflags) |= (RPMTRANS_FLAG_##_FLAG) |
Definition at line 127 of file transaction.c.
Referenced by rpmtsRollback(), and rpmtsSetup().
#define VSF_CLR | ( | _vsflags, | |
_FLAG | |||
) | (_vsflags) &= ~(RPMVSF_##_FLAG) |
Definition at line 124 of file transaction.c.
#define VSF_ISSET | ( | _vsflags, | |
_FLAG | |||
) | ((_vsflags) & (RPMVSF_##_FLAG)) |
Definition at line 122 of file transaction.c.
#define VSF_SET | ( | _vsflags, | |
_FLAG | |||
) | (_vsflags) |= (RPMVSF_##_FLAG) |
Definition at line 123 of file transaction.c.
Referenced by rpmtsRollback().
Force add a failed package into the rpmdb.
ts | current transaction set |
p | failed rpmte. |
Definition at line 2034 of file transaction.c.
References FPSDEBUG, PSM_RPMDB_ADD, rpmpsmFree(), rpmpsmNew(), rpmpsmStage(), RPMRC_OK, rpmteType(), and TR_ADDED.
Referenced by rpmtsRollback().
int _rpmtsRun | ( | rpmts | ts, |
rpmps | okProbs, | ||
rpmprobFilterFlags | ignoreSet | ||
) |
Definition at line 2200 of file transaction.c.
References _, _rpmts_debug, D_, FPSDEBUG, rpmExpandNumeric(), rpmlog(), RPMLOG_DEBUG, RPMLOG_ERR, rpmpsFree(), rpmpsNumProblems(), rpmpsTrim(), rpmsxFree(), RPMTAG_POSTTRANS, RPMTAG_PRETRANS, RPMTRANS_TYPE_AUTOROLLBACK, RPMTRANS_TYPE_ROLLBACK, rpmtsFinish(), rpmtsFlags(), rpmtsGetRdb(), rpmtsNElements(), rpmtsPrepare(), rpmtsProcess(), rpmtsRepackage(), rpmtsRootDir(), rpmtsRunScript(), rpmtsSanityCheck(), rpmtsSetup(), rpmtsType(), and TSF_ISSET.
|
static |
Search for string B in argv array AV.
AV | argv array |
B | string |
Definition at line 885 of file transaction.c.
Referenced by rpmtsMarkLinkedFailed().
Ensure that current package is newer than installed package.
ts | transaction set |
p | current transaction element |
h | installed header |
Definition at line 560 of file transaction.c.
References _free(), _rpmds_nopromote, alloca(), FPSDEBUG, headerGet(), _HE_s::p, rpmDataType_u::ptr, rpmdsFree(), rpmdsNVRMatchesDep(), rpmdsSingle(), RPMPROB_OLDPACKAGE, rpmpsAppend(), rpmpsFree(), RPMSENSE_EQUAL, RPMSENSE_LESS, RPMTAG_NVRA, RPMTAG_REQUIRENAME, rpmteD(), rpmteE(), rpmteKey(), rpmteN(), rpmteNEVR(), rpmteR(), rpmteV(), rpmtsProblems(), stpcpy(), rpmDataType_u::str, and _HE_s::tag.
Referenced by rpmtsSanityCheck().
|
static |
Definition at line 136 of file transaction.c.
References _free(), alloca(), FA_CREATE, FA_SKIPCOLOR, FF_ISSET, headerGet(), headerGetInstance(), iosmFileActionSkipped(), _HE_s::p, rpmDataType_u::ptr, rpmExpandNumeric(), rpmfiBN(), rpmfiCompare(), rpmfiDecideFate(), rpmfiDN(), rpmfiFColor(), rpmfiFFlags(), rpmfiFSize(), rpmfiFX(), RPMPROB_FILE_CONFLICT, RPMPROB_FILTER_REPLACEOLDFILES, rpmpsAppend(), rpmpsFree(), RPMTAG_NVRA, rpmteKey(), rpmteNEVRA(), rpmtsColor(), rpmtsFilterFlags(), rpmtsFlags(), rpmtsPrefColor(), rpmtsProblems(), rpmDataType_u::str, _HE_s::tag, TSF_ISSET, and xrealloc.
Referenced by rpmtsCheckInstalledFiles().
Update disk space needs on each partition for this package's files.
Definition at line 268 of file transaction.c.
References _free(), dodigest(), fingerPrint_s::entry, FA_ALTNAME, FA_BACKUP, FA_CREATE, FA_ERASE, FA_SKIP, FA_SKIPCOLOR, FA_UNKNOWN, FF_ISSET, FPSDEBUG, htGetEntry(), iosmFileActionSkipped(), recs, rpmExpandNumeric(), rpmfiCompare(), rpmfiDigest(), rpmfiFColor(), rpmfiFFlags(), rpmfiFMode(), rpmfiFN(), rpmfiFpsIndex(), rpmfiFSize(), rpmfiFState(), rpmfiInit(), RPMFILE_STATE_NORMAL, rpmfiNext(), rpmfiSetFX(), RPMPROB_FILTER_REPLACENEWFILES, RPMPROB_NEW_FILE_CONFLICT, rpmpsAppend(), rpmpsFree(), RPMTAG_BASENAMES, rpmteFI(), rpmteKey(), rpmteNEVR(), rpmteType(), rpmtsColor(), rpmtsFilterFlags(), rpmtsPrefColor(), rpmtsProblems(), rpmtsUpdateDSI(), TR_ADDED, TR_REMOVED, and xcalloc().
Referenced by rpmtsPrepare().
|
static |
Definition at line 1353 of file transaction.c.
References alloca(), fpEqual(), fpHashFunction(), fpLookupSubdir(), FPSDEBUG, htAddEntry(), htCreate(), htFree(), iosmFileActionSkipped(), rpmdbCheckSignals(), rpmfiFC(), rpmfiFLink(), rpmfiFpLookup(), rpmfiFpsIndex(), rpmfiInit(), rpmfiNext(), rpmswEnter(), rpmswExit(), RPMTAG_BASENAMES, rpmteFI(), RPMTS_OP_FINGERPRINT, rpmtsiFi(), rpmtsiFree(), rpmtsiInit(), rpmtsiNext(), and rpmtsOp().
Referenced by rpmtsPrepare().
|
static |
Definition at line 1015 of file transaction.c.
References _free(), alloca(), rpmDataType_u::argv, fingerPrint_s::baseName, _HE_s::c, D_, dirName, FA_SKIP, fpLookup(), FPSDEBUG, handleInstInstalledFile(), hashFunctionString(), headerGet(), htGetEntry(), _HE_s::p, rpmDataType_u::ptr, recs, rpmfiFree(), RPMFILE_STATE_NORMAL, rpmfiNew(), rpmfiSetFX(), rpmlog(), RPMLOG_DEBUG, rpmmiBNTag(), rpmmiFree(), rpmmiInstance(), rpmmiNext(), RPMTAG_BASENAMES, RPMTAG_DIRINDEXES, RPMTAG_DIRNAMES, RPMTAG_FILESTATES, rpmteFI(), rpmteType(), rpmtsFindBaseNamesInDB(), _HE_s::tag, TR_ADDED, TR_REMOVED, rpmDataType_u::ui32p, and rpmDataType_u::ui8p.
Referenced by rpmtsPrepare().
Definition at line 949 of file transaction.c.
References FPSDEBUG, RPMCALLBACK_TRANS_PROGRESS, rpmdbCheckSignals(), rpmfiBN(), rpmfiInit(), rpmfiNext(), rpmmiGrowBasename(), rpmmiInit(), rpmmiSort(), RPMTAG_BASENAMES, rpmteFI(), rpmtsGetRdb(), rpmtsiFree(), rpmtsiInit(), rpmtsiNext(), rpmtsiOc(), and rpmtsNotify().
Referenced by rpmtsCheckInstalledFiles().
Definition at line 1552 of file transaction.c.
References FPSDEBUG, rpmsxFree(), rpmtsFlags(), and TSF_ISSET.
Referenced by _rpmtsRun().
Return transaction element's file info.
tsi | transaction element iterator |
Definition at line 860 of file transaction.c.
References rpmtsElement().
Referenced by rpmtsAddFingerprints(), rpmtsPrepare(), rpmtsProcess(), rpmtsRepackage(), rpmtsRunScript(), and rpmtsSanityCheck().
Mark all erasure elements linked to installed element p as failed.
ts | transaction set |
p | failed install transaction element |
Definition at line 904 of file transaction.c.
References cmpArgvStr(), rpmtsiFree(), rpmtsiInit(), rpmtsiNext(), and TR_REMOVED.
Referenced by rpmtsProcess().
Definition at line 1566 of file transaction.c.
References _, _free(), Chdir(), Chroot(), D_, FA_CREATE, fpCacheCreate(), fpCacheFree(), fpEqual(), fpHashFunction(), FPSDEBUG, handleOverlappedFiles(), htCreate(), htFree(), RPMCALLBACK_TRANS_START, RPMCALLBACK_TRANS_STOP, rpmdbOpenAll(), rpmExpandNumeric(), rpmfiFC(), rpmfiInit(), rpmfiNext(), rpmlog(), RPMLOG_DEBUG, RPMLOG_ERR, rpmswEnter(), rpmswExit(), RPMTAG_BASENAMES, rpmteDBOffset(), rpmteFI(), rpmteSetFI(), rpmteType(), RPMTS_OP_FINGERPRINT, rpmtsAddFingerprints(), rpmtsCheckDSIProblems(), rpmtsCheckInstalledFiles(), rpmtsChrootDone(), rpmtsCurrDir(), rpmtsGetRdb(), rpmtsiFi(), rpmtsiFree(), rpmtsiInit(), rpmtsiNext(), rpmtsNotify(), rpmtsOp(), rpmtsRootDir(), rpmtsSetChrootDone(), rpmtsSkipFiles(), TR_ADDED, TR_REMOVED, and xmalloc.
Referenced by _rpmtsRun().
|
static |
Definition at line 1788 of file transaction.c.
References _free(), D_, FPSDEBUG, headerFree(), IOSM_SBIT_CHECK, PSM_PKGERASE, PSM_PKGINSTALL, PSM_UNKNOWN, rpmdbCheckSignals(), rpmfiFree(), rpmfiLink(), rpmfiNew(), rpmlog(), RPMLOG_DEBUG, rpmpsmFree(), rpmpsmNew(), rpmpsmSetAsync(), rpmpsmStage(), RPMRC_OK, rpmswEnter(), rpmswExit(), RPMTAG_BASENAMES, rpmteA(), rpmteClose(), rpmteColor(), rpmteFailed(), rpmteFd(), rpmteFDHeader(), rpmteIsSource(), rpmteNEVR(), rpmteNEVRA(), rpmteO(), rpmteOpen(), rpmteType(), RPMTS_OP_ERASE, RPMTS_OP_INSTALL, rpmtsFlags(), rpmtsGetRdb(), rpmtsiFi(), rpmtsiFree(), rpmtsiInit(), rpmtsiNext(), rpmtsiOc(), rpmtsMarkLinkedFailed(), rpmtsOp(), rpmtsRollback(), rpmtsRootDir(), rpmtsSetRelocateElement(), rpmtsUnorderedSuccessors(), TR_ADDED, TR_REMOVED, and TSF_ISSET.
Referenced by _rpmtsRun().
|
static |
Definition at line 1964 of file transaction.c.
References FPSDEBUG, IOSM_ALL_HARDLINKS, IOSM_MAP_ABSOLUTE, IOSM_MAP_ADDDOT, PSM_PKGSAVE, RPMCALLBACK_REPACKAGE_PROGRESS, RPMCALLBACK_REPACKAGE_START, RPMCALLBACK_REPACKAGE_STOP, rpmdbCheckSignals(), rpmpsmFree(), rpmpsmNew(), rpmpsmStage(), rpmswEnter(), rpmswExit(), rpmteType(), RPMTS_OP_REPACKAGE, rpmtsFlags(), rpmtsiFi(), rpmtsiFree(), rpmtsiInit(), rpmtsiNext(), rpmtsNotify(), rpmtsOp(), TR_ADDED, TR_REMOVED, and TSF_ISSET.
Referenced by _rpmtsRun().
Definition at line 1304 of file transaction.c.
References FPSDEBUG, rpmpsmFree(), rpmpsmNew(), rpmpsmScriptStage(), RPMTAG_POSTTRANS, RPMTAG_POSTTRANSPROG, RPMTAG_PRETRANS, RPMTAG_PRETRANSPROG, rpmteClose(), rpmteHaveTransScript(), rpmteOpen(), rpmtsiFi(), rpmtsiFree(), rpmtsiInit(), rpmtsiNext(), tagName(), and TR_ADDED.
Referenced by _rpmtsRun().
Definition at line 1167 of file transaction.c.
References _free(), alloca(), argvCount(), argvFree(), D_, ensureOlder(), FPSDEBUG, headerGet(), _HE_s::p, rpmDataType_u::ptr, rpmdbMireApply(), rpmfiFC(), rpmlog(), RPMLOG_DEBUG, rpmmiFree(), rpmmiNext(), RPMMIRE_STRCMP, RPMPROB_BADARCH, RPMPROB_BADOS, RPMPROB_FILTER_FORCERELOCATE, RPMPROB_FILTER_IGNOREARCH, RPMPROB_FILTER_IGNOREOS, RPMPROB_FILTER_OLDPACKAGE, RPMPROB_FILTER_REPLACEPKG, RPMPROB_PKG_INSTALLED, rpmpsAppend(), rpmpsFreeIterator(), rpmpsGetProblem(), rpmpsInitIterator(), rpmpsNextIterator(), RPMTAG_DISTEPOCH, RPMTAG_EPOCH, RPMTAG_NAME, RPMTAG_NVRA, rpmteA(), rpmteD(), rpmteE(), rpmteKey(), rpmteN(), rpmteNEVR(), rpmteNEVRA(), rpmteO(), rpmtsFilterFlags(), rpmtsGetRdb(), rpmtsiFi(), rpmtsiFree(), rpmtsiInit(), rpmtsiNext(), rpmtsInitIterator(), rpmtsNElements(), rpmtsProblems(), rpmDataType_u::str, _HE_s::tag, TR_ADDED, TR_REMOVED, and rpmDataType_u::ui32p.
Referenced by _rpmtsRun().
|
static |
Definition at line 1441 of file transaction.c.
References _free(), currentDirectory(), FPSDEBUG, rpmpsFree(), rpmsxNew(), rpmtsFlags(), rpmtsiFree(), rpmtsiInit(), rpmtsiNext(), rpmtsInitDSI(), rpmtsOpenDB(), rpmtsSELinuxEnabled(), rpmtsSetChrootDone(), rpmtsSetCurrDir(), rpmtsSetFlags(), rpmtsSetTid(), TSF_ISSET, and TSF_SET.
Referenced by _rpmtsRun().
Skip any files that do not match install policies.
ts | transaction set |
fi | file info set |
Definition at line 624 of file transaction.c.
References _free(), alloca(), argvFree(), argvSplit(), D_, dc, FA_SKIPCOLOR, FA_SKIPNETSHARED, FA_SKIPNSTATE, FF_ISSET, FPSDEBUG, iosmFileActionSkipped(), lang, rpmExpand(), rpmExpandNumeric(), rpmfiBN(), rpmfiDC(), rpmfiDN(), rpmfiDX(), rpmfiFColor(), rpmfiFFlags(), rpmfiFMode(), rpmfiInit(), rpmfiInitD(), rpmfiNext(), rpmfiNextD(), rpmlog(), RPMLOG_DEBUG, rpmtsColor(), rpmtsFlags(), and TSF_ISSET.
Referenced by rpmtsPrepare().
int _fps_debug = 0 |
Definition at line 261 of file transaction.c.