Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

lib/transaction.c File Reference

More...

#include "system.h"
#include <rpmlib.h>
#include <rpmmacro.h>
#include "fsm.h"
#include "psm.h"
#include "rpmdb.h"
#include "rpmds.h"
#include "rpmfi.h"
#include "rpmte.h"
#include "rpmts.h"
#include "cpio.h"
#include "fprint.h"
#include "legacy.h"
#include "misc.h"
#include "debug.h"

Go to the source code of this file.

Defines

#define _RPMFI_INTERNAL
#define _RPMTE_INTERNAL
#define _RPMTS_INTERNAL
#define ISROOT(_d)   (((_d)[0] == '/' && (_d)[1] == '\0') ? "" : (_d))
#define NOTIFY(_ts, _al)   if ((_ts)->notify) (void) (_ts)->notify _al

Functions

int archOkay (const char *pkgArch)
int osOkay (const char *pkgOs)
int sharedCmp (const void *one, const void *two)
int handleInstInstalledFiles (const rpmts ts, rpmte p, rpmfi fi, sharedFileInfo shared, int sharedCount, int reportConflicts)
int handleRmvdInstalledFiles (const rpmts ts, rpmfi fi, sharedFileInfo shared, int sharedCount)
int fpsCompare (const void *one, const void *two)
int findFps (const struct fingerPrint_s *fiFps, const struct fingerPrint_s *otherFps, int otherFc)
void handleOverlappedFiles (const rpmts ts, const rpmte p, rpmfi fi)
 Update disk space needs on each partition for this package's files.

int ensureOlder (rpmts ts, const rpmte p, const Header h)
 Ensure that current package is newer than installed package.

void skipFiles (const rpmts ts, rpmfi fi)
 Skip any files that do not match install policies.

rpmfi rpmtsiFi (const rpmtsi tsi)
 Return transaction element's file info.

int rpmtsRun (rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)

Variables

int _fps_debug = 0
int _linear_fps_search = 0


Detailed Description

Definition in file transaction.c.


Define Documentation

#define _RPMFI_INTERNAL
 

Definition at line 17 of file transaction.c.

#define _RPMTE_INTERNAL
 

Definition at line 20 of file transaction.c.

#define _RPMTS_INTERNAL
 

Definition at line 23 of file transaction.c.

#define ISROOT _d       (((_d)[0] == '/' && (_d)[1] == '\0') ? "" : (_d))
 

Definition at line 262 of file transaction.c.

Referenced by findFps(), and fpsCompare().

#define NOTIFY _ts,
_al       if ((_ts)->notify) (void) (_ts)->notify _al
 

Definition at line 932 of file transaction.c.

Referenced by rpmtsRun().


Function Documentation

int archOkay const char *    pkgArch [static]
 

Definition at line 50 of file transaction.c.

References RPM_MACHTABLE_INSTARCH, and rpmMachineScore().

int ensureOlder rpmts    ts,
const rpmte    p,
const Header    h
[static]
 

Ensure that current package is newer than installed package.

Parameters:
ts  transaction set
p  current transaction element
h  installed header
Returns:
0 if not newer, 1 if okay

Definition at line 634 of file transaction.c.

References _free(), alloca(), hGetNEVR(), int_32, rpmds, rpmdsFree(), rpmdsNVRMatchesDep(), rpmdsSingle(), RPMPROB_OLDPACKAGE, rpmpsAppend(), rpmpsFree(), RPMSENSE_EQUAL, RPMSENSE_LESS, RPMTAG_REQUIRENAME, rpmte, rpmteE(), rpmteKey(), rpmteN(), rpmteNEVR(), rpmteR(), rpmteV(), rpmts, rpmtsProblems(), and stpcpy().

Referenced by rpmtsRun().

int findFps const struct fingerPrint_s   fiFps,
const struct fingerPrint_s   otherFps,
int    otherFc
[static]
 

Definition at line 322 of file transaction.c.

References fingerPrint_s::baseName, fprintCacheEntry_s::dirName, fingerPrint_s::entry, FP_EQUAL, fpsCompare(), ISROOT, and fingerPrint_s::subDir.

Referenced by handleOverlappedFiles().

int fpsCompare const void *    one,
const void *    two
[static]
 

Definition at line 267 of file transaction.c.

References alloca(), fingerPrint_s::baseName, fprintCacheEntry_s::dirName, fingerPrint_s::entry, ISROOT, stpcpy(), and fingerPrint_s::subDir.

Referenced by findFps().

int handleInstInstalledFiles const rpmts    ts,
rpmte    p,
rpmfi    fi,
sharedFileInfo    shared,
int    sharedCount,
int    reportConflicts
[static]
 

Parameters:
ts  transaction set
p 
fi  file info set
shared 
sharedCount 
reportConflicts 

Definition at line 92 of file transaction.c.

References _free(), FA_CREATE, FA_SKIP, fileAction, hGetNEVR(), rpmdbFreeIterator(), RPMDBI_PACKAGES, rpmdbNextIterator(), rpmfi, rpmfiBN(), rpmfiCompare(), rpmfiDecideFate(), rpmfiDN(), rpmfiFColor(), rpmfiFFlags(), rpmfiFree(), rpmfiFSize(), rpmfiInit(), RPMFILE_CONFIG, RPMFILE_STATE_NORMAL, rpmfiNew(), rpmfiNext(), rpmfiSetFX(), RPMPROB_FILE_CONFLICT, rpmpsAppend(), rpmpsFree(), RPMTAG_BASENAMES, rpmte, rpmteColor(), rpmteKey(), rpmteNEVR(), RPMTRANS_FLAG_ALLFILES, rpmts, rpmtsColor(), rpmtsFlags(), rpmtsInitIterator(), rpmtsProblems(), uint_32, xcalloc(), XFA_SKIPPING, and xrealloc().

Referenced by rpmtsRun().

void handleOverlappedFiles const rpmts    ts,
const rpmte    p,
rpmfi    fi
[static]
 

Update disk space needs on each partition for this package's files.

Definition at line 415 of file transaction.c.

References fprintCacheEntry_s::dev, domd5(), fingerPrint_s::entry, FA_ALTNAME, FA_BACKUP, FA_CREATE, FA_ERASE, FA_SKIP, FA_UNKNOWN, findFps(), htGetEntry(), int_16, int_32, rpmfi, rpmfiCompare(), rpmfiFC(), rpmfiFColor(), rpmfiFFlags(), rpmfiFMode(), rpmfiFN(), rpmfiFSize(), rpmfiFState(), rpmfiInit(), RPMFILE_CONFIG, RPMFILE_NOREPLACE, RPMFILE_STATE_NORMAL, rpmfiMD5(), rpmfiNext(), rpmfiSetFX(), RPMPROB_FILTER_REPLACENEWFILES, RPMPROB_NEW_FILE_CONFLICT, rpmpsAppend(), rpmpsFree(), rpmte, rpmteKey(), rpmteNEVR(), rpmteType(), rpmts, rpmtsColor(), rpmtsFilterFlags(), rpmtsProblems(), rpmtsUpdateDSI(), TR_ADDED, TR_REMOVED, uint_32, and XFA_SKIPPING.

Referenced by rpmtsRun().

int handleRmvdInstalledFiles const rpmts    ts,
rpmfi    fi,
sharedFileInfo    shared,
int    sharedCount
[static]
 

Definition at line 222 of file transaction.c.

References FA_SKIP, HGE_t, rpmdbFreeIterator(), RPMDBI_PACKAGES, rpmdbNextIterator(), rpmfi, RPMFILE_STATE_NORMAL, RPMTAG_FILESTATES, rpmts, and rpmtsInitIterator().

Referenced by rpmtsRun().

int osOkay const char *    pkgOs [static]
 

Definition at line 59 of file transaction.c.

References RPM_MACHTABLE_INSTOS, and rpmMachineScore().

rpmfi rpmtsiFi const rpmtsi    tsi [static]
 

Return transaction element's file info.

Todo:
Take a rpmfi refcount here.
Parameters:
tsi  transaction element iterator
Returns:
transaction element file info

Definition at line 913 of file transaction.c.

References rpmfi, rpmte, rpmtsElement(), and rpmtsi.

Referenced by rpmtsRun().

int rpmtsRun rpmts    ts,
rpmps    okProbs,
rpmprobFilterFlags    ignoreSet
 

Process all package elements in a transaction set.

Parameters:
ts  transaction set
okProbs  previously known problems (or NULL)
ignoreSet  bits to filter problem types
Returns:
0 on success, -1 on error, >0 with newProbs set

Definition at line 934 of file transaction.c.

References _, _free(), _noTransScripts, _noTransTriggers, alKey, archOkay(), CPIO_ALL_HARDLINKS, CPIO_MAP_ABSOLUTE, CPIO_MAP_ADDDOT, currentDirectory(), dbiFreeIndexSet(), dbiIndexRecordFileNumber(), dbiIndexRecordOffset(), dbiIndexSetCount(), ensureOlder(), rpmpsm_s::fi, fileAction, fpCacheCreate(), fpCacheFree(), fpLookupList(), handleInstInstalledFiles(), handleOverlappedFiles(), handleRmvdInstalledFiles(), headerFree(), htAddEntry(), htCreate(), htFree(), int_32, NOTIFY, osOkay(), PSM_PKGERASE, PSM_PKGINSTALL, PSM_PKGSAVE, RPMCALLBACK_INST_CLOSE_FILE, RPMCALLBACK_INST_OPEN_FILE, RPMCALLBACK_REPACKAGE_PROGRESS, RPMCALLBACK_REPACKAGE_START, RPMCALLBACK_REPACKAGE_STOP, RPMCALLBACK_TRANS_PROGRESS, RPMCALLBACK_TRANS_START, RPMCALLBACK_TRANS_STOP, rpmdbCheckSignals(), rpmdbFindFpList(), rpmdbFreeIterator(), rpmdbNextIterator(), rpmdbSetIteratorRE(), rpmdbSync(), rpmfi, rpmfiFC(), rpmfiFree(), rpmfiInit(), rpmfiLink, rpmfiNew(), rpmfiNext(), RPMMESS_DEBUG, rpmMessage, RPMMIRE_DEFAULT, RPMPROB_BADARCH, RPMPROB_BADOS, RPMPROB_FILTER_IGNOREARCH, RPMPROB_FILTER_IGNOREOS, RPMPROB_FILTER_OLDPACKAGE, RPMPROB_FILTER_REPLACEOLDFILES, RPMPROB_FILTER_REPLACEPKG, RPMPROB_PKG_INSTALLED, rpmprobFilterFlags, rpmpsAppend(), rpmpsCreate(), rpmpsFree(), rpmpsmFree(), rpmpsmNew(), rpmpsmStage(), rpmpsTrim(), rpmRC, RPMRC_NOKEY, RPMRC_NOTTRUSTED, RPMRC_OK, rpmReadPackageFile(), RPMTAG_ARCH, RPMTAG_BASENAMES, RPMTAG_EPOCH, RPMTAG_NAME, RPMTAG_OS, RPMTAG_RELEASE, RPMTAG_VERSION, rpmte, rpmteA(), rpmteAddedKey(), rpmteColor(), rpmteDBOffset(), rpmteDependsOnKey(), rpmteE(), rpmteFd(), rpmteKey(), rpmteN(), rpmteNEVR(), rpmteO(), rpmteR(), rpmteType(), rpmteV(), RPMTRANS_FLAG_BUILD_PROBS, RPMTRANS_FLAG_DIRSTASH, RPMTRANS_FLAG_JUSTDB, RPMTRANS_FLAG_NOSCRIPTS, RPMTRANS_FLAG_NOTRIGGERS, RPMTRANS_FLAG_REPACKAGE, RPMTRANS_FLAG_TEST, rpmts, RPMTS_OP_ERASE, RPMTS_OP_FINGERPRINT, RPMTS_OP_INSTALL, RPMTS_OP_REPACKAGE, rpmtsCheckDSIProblems(), rpmtsChrootDone(), rpmtsColor(), rpmtsCurrDir(), rpmtsFilterFlags(), rpmtsFlags(), rpmtsGetRdb(), rpmtsi, rpmtsiFi(), rpmtsiFree, rpmtsiInit, rpmtsiNext(), rpmtsInitDSI(), rpmtsInitIterator(), rpmtsiOc(), rpmtsNElements(), rpmtsOp(), rpmtsOpenDB(), rpmtsProblems(), rpmtsRootDir(), rpmtsSetChrootDone(), rpmtsSetCurrDir(), rpmtsSetFlags(), rpmtsSetRelocateElement(), rpmtsSetTid(), rpmtsSetVSFlags(), rpmtsUnorderedSuccessors(), rpmtsVSFlags(), RPMVSF_NEEDPAYLOAD, rpmVSFlags, sharedCmp(), skipFiles(), TR_ADDED, TR_REMOVED, uint_32, rpmpsm_s::unorderedSuccessor, xcalloc(), XFA_SKIPPING, and xmalloc().

Referenced by rpmErase(), rpmInstall(), rpmRollback(), and rpmts_Run().

int sharedCmp const void *    one,
const void *    two
[static]
 

Definition at line 68 of file transaction.c.

Referenced by rpmtsRun().

void skipFiles const rpmts    ts,
rpmfi    fi
[static]
 

Skip any files that do not match install policies.

Parameters:
ts  transaction set
fi  file info set

Definition at line 687 of file transaction.c.

References _, _free(), alloca(), FA_SKIPCOLOR, FA_SKIPNETSHARED, FA_SKIPNSTATE, freeSplitString(), int_16, rpmExpand(), rpmExpandNumeric(), rpmfi, rpmfiBN(), rpmfiDC(), rpmfiDN(), rpmfiDX(), rpmfiFColor(), rpmfiFFlags(), rpmfiFMode(), rpmfiInit(), rpmfiInitD(), RPMFILE_CONFIG, RPMFILE_DOC, rpmfiNext(), rpmfiNextD(), RPMMESS_DEBUG, rpmMessage, RPMTRANS_FLAG_NOCONFIGS, RPMTRANS_FLAG_NODOCS, rpmts, rpmtsColor(), rpmtsFlags(), splitString(), uint_32, whatis(), XDIR, and XFA_SKIPPING.

Referenced by rpmtsRun().


Variable Documentation

int _fps_debug = 0
 

Definition at line 265 of file transaction.c.

int _linear_fps_search = 0 [static]
 

Definition at line 320 of file transaction.c.


Generated on Sun Oct 26 13:02:06 2003 for rpm by doxygen1.2.18