rpm 5.3.7
|
#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.
Defines | |
#define | _FPRINT_INTERNAL |
#define | _RPMDB_INTERNAL |
#define | _RPMFI_INTERNAL |
#define | _RPMTE_INTERNAL |
#define | _RPMTS_INTERNAL |
#define | _RPMSQ_INTERNAL |
#define | _RPMPSM_INTERNAL |
#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 |
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 FPSDEBUG | ( | _debug, | |
_list | |||
) | if ((_debug) || _fps_debug) fprintf _list |
Definition at line 185 of file transaction.c.
Referenced by _processFailedPackage(), _rpmtsRun(), ensureOlder(), handleOverlappedFiles(), rpmtsAddFingerprints(), rpmtsCheckInstalledFiles(), rpmtsFindBaseNamesInDB(), rpmtsFinish(), rpmtsPrepare(), rpmtsProcess(), rpmtsRepackage(), rpmtsRollback(), rpmtsRunScript(), rpmtsSanityCheck(), rpmtsSetup(), and rpmtsSkipFiles().
#define ISROOT | ( | _d | ) | (((_d)[0] == '/' && (_d)[1] == '\0') ? "" : (_d)) |
Definition at line 181 of file transaction.c.
Force add a failed package into the rpmdb.
ts | current transaction set |
p | failed rpmte. |
Definition at line 1869 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 2022 of file transaction.c.
References _, _noTransTriggers, _rpmts_debug, D_, FPSDEBUG, rpmExpandNumeric(), rpmlog(), RPMLOG_DEBUG, RPMLOG_ERR, rpmpsFree(), rpmpsNumProblems(), rpmpsTrim(), RPMTRANS_FLAG_BUILD_PROBS, RPMTRANS_FLAG_DIRSTASH, RPMTRANS_FLAG_NOPOSTTRANS, RPMTRANS_FLAG_NOPRETRANS, RPMTRANS_FLAG_REPACKAGE, RPMTRANS_FLAG_TEST, RPMTRANS_TYPE_AUTOROLLBACK, RPMTRANS_TYPE_ROLLBACK, rpmtsFinish(), rpmtsFlags(), rpmtsGetRdb(), rpmtsNElements(), rpmtsPrepare(), rpmtsProcess(), rpmtsRepackage(), rpmtsRootDir(), rpmtsRunScript(), rpmtsSanityCheck(), rpmtsSetup(), and rpmtsType().
static int cmpArgvStr | ( | const char ** | AV, |
const char * | B | ||
) | [static] |
Search for string B in argv array AV.
AV | argv array |
B | string |
Definition at line 796 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 472 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, rpmteD(), rpmteE(), rpmteKey(), rpmteN(), rpmteNEVR(), rpmteR(), rpmteV(), rpmtsProblems(), stpcpy(), rpmDataType_u::str, and _HE_s::tag.
Referenced by rpmtsSanityCheck().
static int handleInstInstalledFile | ( | const rpmts | ts, |
rpmte | p, | ||
rpmfi | fi, | ||
Header | otherHeader, | ||
rpmfi | otherFi, | ||
int | beingRemoved | ||
) | [static] |
Definition at line 71 of file transaction.c.
References _free(), alloca(), FA_CREATE, FA_SKIPCOLOR, headerGet(), headerGetInstance(), iosmFileActionSkipped(), _HE_s::p, rpmDataType_u::ptr, rpmfiBN(), rpmfiCompare(), rpmfiDecideFate(), rpmfiDN(), rpmfiFColor(), rpmfiFFlags(), rpmfiFSize(), rpmfiFX(), RPMFILE_CONFIG, RPMPROB_FILE_CONFLICT, RPMPROB_FILTER_REPLACEOLDFILES, rpmpsAppend(), rpmpsFree(), rpmteKey(), rpmteNEVRA(), RPMTRANS_FLAG_ALLFILES, rpmtsColor(), rpmtsFilterFlags(), rpmtsFlags(), rpmtsPrefColor(), rpmtsProblems(), rpmDataType_u::str, _HE_s::tag, and xrealloc().
Referenced by rpmtsCheckInstalledFiles().
Update disk space needs on each partition for this package's files.
Definition at line 191 of file transaction.c.
References _free(), fprintCacheEntry_s::dev, dodigest(), fingerPrint_s::entry, FA_ALTNAME, FA_BACKUP, FA_CREATE, FA_ERASE, FA_SKIP, FA_SKIPCOLOR, FA_UNKNOWN, FPSDEBUG, htGetEntry(), iosmFileActionSkipped(), recs, rpmfiCompare(), rpmfiDigest(), rpmfiFColor(), rpmfiFFlags(), rpmfiFMode(), rpmfiFN(), rpmfiFpsIndex(), rpmfiFSize(), rpmfiFState(), rpmfiInit(), RPMFILE_CONFIG, RPMFILE_EXISTS, RPMFILE_NOREPLACE, RPMFILE_SPARSE, RPMFILE_STATE_NORMAL, rpmfiNext(), rpmfiSetFX(), RPMPROB_FILTER_REPLACENEWFILES, RPMPROB_NEW_FILE_CONFLICT, rpmpsAppend(), rpmpsFree(), rpmteFI(), rpmteKey(), rpmteNEVR(), rpmteType(), rpmtsColor(), rpmtsFilterFlags(), rpmtsPrefColor(), rpmtsProblems(), rpmtsUpdateDSI(), TR_ADDED, TR_REMOVED, and xcalloc().
Referenced by rpmtsPrepare().
static void rpmtsAddFingerprints | ( | rpmts | ts, |
uint32_t | fileCount, | ||
hashTable | ht, | ||
fingerPrintCache | fpc | ||
) | [static] |
Definition at line 1230 of file transaction.c.
References alloca(), fpEqual(), fpHashFunction(), fpLookupSubdir(), FPSDEBUG, htAddEntry(), htCreate(), htFree(), iosmFileActionSkipped(), rpmdbCheckSignals(), rpmfiFC(), rpmfiFLink(), rpmfiFpLookup(), rpmfiFpsIndex(), rpmfiInit(), rpmfiNext(), rpmswEnter(), rpmswExit(), rpmteFI(), RPMTS_OP_FINGERPRINT, rpmtsiFi(), rpmtsiFree(), rpmtsiInit(), rpmtsiNext(), and rpmtsOp().
Referenced by rpmtsPrepare().
static int rpmtsCheckInstalledFiles | ( | rpmts | ts, |
uint32_t | fileCount, | ||
hashTable | ht, | ||
fingerPrintCache | fpc | ||
) | [static] |
Definition at line 924 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(), rpmteFI(), rpmteType(), rpmtsFindBaseNamesInDB(), _HE_s::tag, TR_ADDED, TR_REMOVED, rpmDataType_u::ui32p, and rpmDataType_u::ui8p.
Referenced by rpmtsPrepare().
Definition at line 859 of file transaction.c.
References FPSDEBUG, RPMCALLBACK_TRANS_PROGRESS, rpmdbCheckSignals(), rpmfiBN(), rpmfiInit(), rpmfiNext(), rpmmiGrowBasename(), rpmmiInit(), rpmmiSort(), rpmteFI(), rpmtsGetRdb(), rpmtsiFree(), rpmtsiInit(), rpmtsiNext(), rpmtsiOc(), and rpmtsNotify().
Referenced by rpmtsCheckInstalledFiles().
static int rpmtsFinish | ( | rpmts | ts, |
rpmsx | sx | ||
) | [static] |
Definition at line 1391 of file transaction.c.
References FPSDEBUG, RPMTRANS_FLAG_NOCONTEXTS, and rpmtsFlags().
Referenced by _rpmtsRun().
Return transaction element's file info.
tsi | transaction element iterator |
Definition at line 771 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 815 of file transaction.c.
References cmpArgvStr(), rpmtsiFree(), rpmtsiInit(), rpmtsiNext(), and TR_REMOVED.
Referenced by rpmtsProcess().
static int rpmtsPrepare | ( | rpmts | ts, |
rpmsx | sx, | ||
uint32_t | fileCount, | ||
uint32_t * | nrmvdp | ||
) | [static] |
Definition at line 1405 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(), 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 int rpmtsProcess | ( | rpmts | ts, |
rpmprobFilterFlags | ignoreSet, | ||
int | rollbackFailures | ||
) | [static] |
Definition at line 1626 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(), rpmteA(), rpmteClose(), rpmteColor(), rpmteFailed(), rpmteFd(), rpmteFDHeader(), rpmteIsSource(), rpmteNEVR(), rpmteNEVRA(), rpmteO(), rpmteOpen(), rpmteType(), RPMTS_OP_ERASE, RPMTS_OP_INSTALL, rpmtsGetRdb(), rpmtsiFi(), rpmtsiFree(), rpmtsiInit(), rpmtsiNext(), rpmtsiOc(), rpmtsMarkLinkedFailed(), rpmtsOp(), rpmtsRollback(), rpmtsRootDir(), rpmtsSetRelocateElement(), rpmtsUnorderedSuccessors(), TR_ADDED, and TR_REMOVED.
Referenced by _rpmtsRun().
static int rpmtsRepackage | ( | rpmts | ts, |
uint32_t | numRemoved | ||
) | [static] |
Definition at line 1800 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(), RPMTRANS_FLAG_REPACKAGE, RPMTS_OP_REPACKAGE, rpmtsFlags(), rpmtsiFi(), rpmtsiFree(), rpmtsiInit(), rpmtsiNext(), rpmtsNotify(), rpmtsOp(), TR_ADDED, and TR_REMOVED.
Referenced by _rpmtsRun().
Definition at line 1181 of file transaction.c.
References FPSDEBUG, rpmpsmFree(), rpmpsmNew(), rpmpsmScriptStage(), rpmteClose(), rpmteHaveTransScript(), rpmteOpen(), rpmtsiFi(), rpmtsiFree(), rpmtsiInit(), rpmtsiNext(), tagName(), and TR_ADDED.
Referenced by _rpmtsRun().
Definition at line 1076 of file transaction.c.
References argvCount(), argvFree(), D_, ensureOlder(), FPSDEBUG, 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(), rpmteA(), rpmteKey(), rpmteN(), rpmteNEVR(), rpmteNEVRA(), rpmteO(), rpmtsFilterFlags(), rpmtsGetRdb(), rpmtsiFi(), rpmtsiFree(), rpmtsiInit(), rpmtsiNext(), rpmtsInitIterator(), rpmtsNElements(), rpmtsProblems(), TR_ADDED, and TR_REMOVED.
Referenced by _rpmtsRun().
static int rpmtsSetup | ( | rpmts | ts, |
rpmprobFilterFlags | ignoreSet, | ||
rpmsx * | sxp | ||
) | [static] |
Definition at line 1318 of file transaction.c.
References _free(), _noTransScripts, _noTransTriggers, currentDirectory(), FPSDEBUG, rpmpsFree(), RPMTRANS_FLAG_JUSTDB, RPMTRANS_FLAG_NOCONTEXTS, RPMTRANS_FLAG_NOPOLICY, RPMTRANS_FLAG_NOSCRIPTS, RPMTRANS_FLAG_NOTRIGGERS, RPMTRANS_FLAG_TEST, rpmtsFlags(), rpmtsiFree(), rpmtsiInit(), rpmtsiNext(), rpmtsInitDSI(), rpmtsOpenDB(), rpmtsSELinuxEnabled(), rpmtsSetChrootDone(), rpmtsSetCurrDir(), rpmtsSetFlags(), and rpmtsSetTid().
Referenced by _rpmtsRun().
Skip any files that do not match install policies.
ts | transaction set |
fi | file info set |
Definition at line 536 of file transaction.c.
References _free(), alloca(), argvFree(), argvSplit(), D_, dc, FA_SKIPCOLOR, FA_SKIPNETSHARED, FA_SKIPNSTATE, FPSDEBUG, iosmFileActionSkipped(), lang, rpmExpand(), rpmExpandNumeric(), rpmfiBN(), rpmfiDC(), rpmfiDN(), rpmfiDX(), rpmfiFColor(), rpmfiFFlags(), rpmfiFMode(), rpmfiInit(), rpmfiInitD(), RPMFILE_CONFIG, RPMFILE_DOC, rpmfiNext(), rpmfiNextD(), rpmlog(), RPMLOG_DEBUG, RPMTRANS_FLAG_NOCONFIGS, RPMTRANS_FLAG_NODOCS, rpmtsColor(), and rpmtsFlags().
Referenced by rpmtsPrepare().
int _fps_debug = 0 |
Definition at line 184 of file transaction.c.