lib/transaction.c -
#include 'system.h'
#include 'rpmmacro.h'
#include 'psm.h'
#include 'rpmdb.h'
#include 'fprint.h'
#include 'rpmhash.h'
#include 'misc.h'
#include 'debug.h'
struct diskspaceInfo
struct tsIterator_s
Iterator across transaction elements, forward on install, backward on erase.
#define MNT_DEV_PREFIX '/mnt/'
#define MNT_DEV_PREFIX_LENGTH (sizeof(MNT_DEV_PREFIX)-1)
#define adj_fs_blocks(_nb) (((_nb) * 21) / 20)
#define BLOCK_ROUND(size, block) (((size) + (block) - 1) / (block))
#define XSTRCMP(a, b) ((!(a) && !(b)) || ((a) && (b) && !strcmp((a), (b))))
#define alloca_strdup(_s) strcpy(alloca(strlen(_s)+1), (_s))
#define NOTIFY(_ts, _al) if ((_ts)->notify) (void) (_ts)->notify _al
void * freeFl (rpmTransactionSet ts, TFI_t flList)
void rpmtransSetScriptFd (rpmTransactionSet ts, FD_t fd)
int rpmtransGetKeys (const rpmTransactionSet ts, const void ***ep, int *nep)
rpmProblemSet psCreate (void)
void psAppend (rpmProblemSet probs, rpmProblemType type, const struct availablePackage *alp, const char *dn, const char *bn, Header altH, unsigned long ulong1)
int archOkay (Header h)
int osOkay (Header h)
void rpmProblemSetFree (rpmProblemSet probs)
Destroy problem set.
const char *const ftstring (fileTypes ft)
fileTypes whatis (uint_16 mode)
Header relocateFileList (const rpmTransactionSet ts, TFI_t fi, struct availablePackage *alp, Header origH, fileAction *actions)
Relocate files in header.
int psTrim (rpmProblemSet filter, rpmProblemSet target)
int sharedCmp (const void *one, const void *two)
fileAction decideFileFate (const char *dirName, const char *baseName, short dbMode, const char *dbMd5, const char *dbLink, short newMode, const char *newMd5, const char *newLink, int newFlags, rpmtransFlags transFlags)
int filecmp (short mode1, const char *md51, const char *link1, short mode2, const char *md52, const char *link2)
int handleInstInstalledFiles (TFI_t fi, rpmdb db, struct sharedFileInfo *shared, int sharedCount, int reportConflicts, rpmProblemSet probs, rpmtransFlags transFlags)
int handleRmvdInstalledFiles (TFI_t fi, rpmdb db, struct sharedFileInfo *shared, int sharedCount)
void handleOverlappedFiles (TFI_t fi, hashTable ht, rpmProblemSet probs, struct diskspaceInfo *dsl)
Update disk space needs on each partition for this package.
int ensureOlder (struct availablePackage *alp, Header old, rpmProblemSet probs)
void skipFiles (const rpmTransactionSet ts, TFI_t fi)
int tsGetOc (void *a)
Return transaction element order count.
availablePackage * tsGetAlp (void *a)
Return transaction element available package pointer.
void * tsFreeIterator (const void *a)
Destroy transaction element iterator.
void * tsInitIterator (const void *a)
Create transaction element iterator.
TFI_t tsNextIterator (void *a)
Return next transaction element's file info.
int rpmRunTransactions (rpmTransactionSet ts, rpmCallbackFunction notify, rpmCallbackData notifyData, rpmProblemSet okProbs, rpmProblemSet *newProbs, rpmtransFlags transFlags, rpmprobFilterFlags ignoreSet)
Definition in file transaction.c.
Definition at line 65 of file transaction.c.
Referenced by rpmRunTransactions().
Definition at line 301 of file transaction.c.
Definition at line 69 of file transaction.c.
Referenced by handleOverlappedFiles().
Definition at line 42 of file transaction.c.
Referenced by rpmRunTransactions().
Definition at line 43 of file transaction.c.
Referenced by rpmRunTransactions().
Definition at line 1517 of file transaction.c.
Referenced by rpmRunTransactions().
Definition at line 71 of file transaction.c.
Definition at line 203 of file transaction.c.
References headerGetEntry(), int_8, RPM_INT8_TYPE, RPM_MACHTABLE_INSTARCH, rpmGetArchInfo(), rpmMachineScore(), and RPMTAG_ARCH.
Referenced by rpmRunTransactions().
Definition at line 788 of file transaction.c.
References _, alloca(), domd5(), FA_ALTNAME, FA_CREATE, FA_SAVE, FA_SKIP, fileAction, fileTypes, LINK, REG, RPMFILE_MISSINGOK, RPMFILE_NOREPLACE, RPMMESS_DEBUG, rpmMessage, RPMTRANS_FLAG_ALLFILES, rpmtransFlags, stpcpy(), whatis(), and XDIR.
Referenced by handleInstInstalledFiles().
Definition at line 1234 of file transaction.c.
References psAppend(), RPMPROB_OLDPACKAGE, and rpmVersionCompare().
Referenced by rpmRunTransactions().
Definition at line 881 of file transaction.c.
References fileTypes, LINK, REG, and whatis().
Referenced by handleInstInstalledFiles(), and handleOverlappedFiles().
Definition at line 73 of file transaction.c.
References _free(), and freeFi().
Referenced by rpmRunTransactions().
Definition at line 273 of file transaction.c.
References BDEV, CDEV, fileTypes, LINK, PIPE, REG, SOCK, and XDIR.
Referenced by relocateFileList().
Definition at line 898 of file transaction.c.
References decideFileFate(), filecmp(), HFD_t, HGE_t, psAppend(), rpmdbFreeIterator(), RPMDBI_PACKAGES, rpmdbInitIterator(), rpmdbNextIterator(), RPMFILE_CONFIG, RPMFILE_STATE_NORMAL, RPMPROB_FILE_CONFLICT, RPMTAG_FILEFLAGS, RPMTAG_FILELINKTOS, RPMTAG_FILEMD5S, RPMTAG_FILEMODES, RPMTAG_FILESIZES, RPMTAG_FILESTATES, rpmTagType, rpmtransFlags, uint_16, uint_32, XFA_SKIPPING, xmalloc(), and xrealloc().
Referenced by rpmRunTransactions().
Update disk space needs on each partition for this package.
Definition at line 1035 of file transaction.c.
References transactionFileInfo_s::actions, transactionFileInfo_s::ap, BLOCK_ROUND, diskspaceInfo::bneeded, diskspaceInfo::bsize, diskspaceInfo::dev, FA_ALTNAME, FA_BACKUP, FA_CREATE, FA_ERASE, FA_SAVE, FA_SKIP, FA_UNKNOWN, transactionFileInfo_s::fc, filecmp(), transactionFileInfo_s::fmodes, FP_EQUAL, transactionFileInfo_s::fps, transactionFileInfo_s::fsizes, availablePackage::h, htGetEntry(), diskspaceInfo::ineeded, mdfile(), psAppend(), RPMFILE_CONFIG, RPMFILE_NOREPLACE, RPMFILE_STATE_NORMAL, RPMPROB_NEW_FILE_CONFLICT, stpcpy(), transactionFileInfo_s::type, uint_32, XFA_SKIPPING, and xrealloc().
Referenced by rpmRunTransactions().
Definition at line 994 of file transaction.c.
References FA_SKIP, HGE_t, rpmdbFreeIterator(), RPMDBI_PACKAGES, rpmdbInitIterator(), rpmdbNextIterator(), RPMFILE_STATE_NORMAL, and RPMTAG_FILESTATES.
Referenced by rpmRunTransactions().
Definition at line 234 of file transaction.c.
References headerGetEntry(), RPM_INT8_TYPE, RPM_MACHTABLE_INSTOS, rpmMachineScore(), and RPMTAG_OS.
Referenced by rpmRunTransactions().
Definition at line 139 of file transaction.c.
References rpmProblem_s::altNEVR, rpmProblem_s::h, headerLink(), headerNVR(), rpmProblem_s::ignoreProblem, rpmProblem_s::key, rpmProblem_s::pkgNEVR, rpmProblemType, stpcpy(), rpmProblem_s::str1, rpmProblem_s::type, rpmProblem_s::ulong1, xmalloc(), and xrealloc().
Referenced by ensureOlder(), handleInstInstalledFiles(), handleOverlappedFiles(), relocateFileList(), and rpmRunTransactions().
Definition at line 127 of file transaction.c.
References rpmProblemSet_s::numProblems, rpmProblemSet_s::numProblemsAlloced, rpmProblemSet_s::probs, and xmalloc().
Referenced by rpmRunTransactions().
Definition at line 737 of file transaction.c.
References rpmProblem_s::h, rpmProblem_s::ignoreProblem, rpmProblem_s::key, rpmProblem_s::str1, rpmProblem_s::type, and XSTRCMP.
Referenced by rpmRunTransactions().
Relocate files in header.
Todo: multilib file dispositions need to be checked.
Parameters:
Returns: header with relocated files
Definition at line 313 of file transaction.c.
References _, _free(), alloca(), alloca_strdup, FA_SKIPMULTILIB, FA_SKIPNSTATE, fileAction, fileTypes, ftstring(), HAE_t, headerCopy(), headerIsEntry(), headerLink(), HFD_t, HGE_t, HME_t, int_32, isFileMULTILIB, rpmRelocation_s::newPath, rpmRelocation_s::oldPath, psAppend(), RPM_INT32_TYPE, RPM_STRING_ARRAY_TYPE, RPMMESS_DEBUG, rpmMessage, RPMPROB_BADRELOCATE, RPMPROB_FILTER_FORCERELOCATE, RPMTAG_BASENAMES, RPMTAG_DIRINDEXES, RPMTAG_DIRNAMES, RPMTAG_FILEFLAGS, RPMTAG_FILEMODES, RPMTAG_INSTPREFIXES, RPMTAG_ORIGBASENAMES, RPMTAG_ORIGDIRINDEXES, RPMTAG_ORIGDIRNAMES, RPMTAG_PREFIXES, rpmTagType, stpcpy(), stripTrailingChar(), uint_16, uint_32, whatis(), XDIR, xmalloc(), and xrealloc().
Referenced by rpmRunTransactions().
Destroy problem set.
Parameters:
Definition at line 259 of file transaction.c.
References _free(), rpmProblem_s::altNEVR, rpmProblem_s::h, headerFree(), rpmProblemSet_s::numProblems, rpmProblem_s::pkgNEVR, rpmProblemSet_s::probs, and rpmProblem_s::str1.
Referenced by rpmInstall(), rpmRollback(), and rpmtransRun().
Definition at line 774 of file transaction.c.
References sharedFileInfo::otherPkg.
Referenced by rpmRunTransactions().
Definition at line 1253 of file transaction.c.
References _, _free(), alloca(), FA_SKIPNETSHARED, FA_SKIPNSTATE, freeSplitString(), rpmExpand(), rpmExpandNumeric(), RPMFILE_DOC, RPMMESS_DEBUG, rpmMessage, RPMTRANS_FLAG_NODOCS, splitString(), whatis(), XDIR, and XFA_SKIPPING.
Referenced by rpmRunTransactions().
Destroy transaction element iterator.
Parameters:
Returns: NULL always
Definition at line 1468 of file transaction.c.
References _free().
Referenced by rpmRunTransactions().
Return transaction element available package pointer.
Parameters:
Returns: available package pointer
Definition at line 1447 of file transaction.c.
References rpmTransactionSet_s::addedPackages, rpmTransactionSet_s::flList, availableList_s::list, tsIterator_s::ocsave, rpmTransactionSet_s::order, tsIterator_s::ts, transactionFileInfo_s::type, and transactionElement_s::u.
Referenced by rpmRunTransactions().
Return transaction element order count.
Parameters:
Returns: element order count
Definition at line 1434 of file transaction.c.
References tsIterator_s::ocsave.
Referenced by rpmRunTransactions().
Create transaction element iterator.
Parameters:
Returns: transaction element iterator
Definition at line 1479 of file transaction.c.
References tsIterator_s::oc, tsIterator_s::ocsave, rpmTransactionSet_s::orderCount, tsIterator_s::reverse, RPMTRANS_FLAG_REVERSE, rpmTransactionSet_s::transFlags, tsIterator_s::ts, and xcalloc().
Referenced by rpmRunTransactions().
Return next transaction element's file info.
Parameters:
Returns: next index, -1 on termination
Definition at line 1498 of file transaction.c.
References rpmTransactionSet_s::flList, tsIterator_s::oc, tsIterator_s::ocsave, rpmTransactionSet_s::orderCount, tsIterator_s::reverse, and tsIterator_s::ts.
Referenced by rpmRunTransactions().
Definition at line 289 of file transaction.c.
References BDEV, CDEV, fileTypes, LINK, PIPE, REG, S_ISLNK, S_ISSOCK, SOCK, uint_16, and XDIR.
Referenced by decideFileFate(), filecmp(), relocateFileList(), and skipFiles().
Generated automatically by Doxygen for rpm from the source code.
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |