rpm 5.3.7
|
File state machine to handle a payload within an rpm package. More...
#include <iosm.h>
Go to the source code of this file.
Typedefs | |
typedef struct iosm_s * | FSM_t |
File state machine data. | |
typedef struct iosmIterator_s * | FSMI_t |
Iterator across package file info, forward on install, backward on erase. | |
Functions | |
IOSM_t | newFSM (void) |
Create file state machine instance. | |
IOSM_t | freeFSM (IOSM_t fsm) |
Destroy file state machine instance. | |
int | fsmSetup (void *_fsm, iosmFileStage goal, const char *afmt, const void *_ts, const void *_fi, FD_t cfd, unsigned int *archiveSize, const char **failedFile) |
Load external data into file state machine. | |
int | fsmTeardown (void *_fsm) |
Clean file state machine. | |
int | fsmMapPath (IOSM_t fsm) |
Map next file path and action. | |
int | fsmMapAttrs (IOSM_t fsm) |
Map file stat(2) info. | |
int | fsmNext (IOSM_t fsm, iosmFileStage nstage) |
File state machine driver. | |
int | fsmStage (IOSM_t fsm, iosmFileStage stage) |
File state machine driver. | |
Variables | |
int | _fsm_debug |
File state machine to handle a payload within an rpm package.
Definition in file fsm.h.
Destroy file state machine instance.
fsm | file state machine |
Definition at line 549 of file fsm.c.
References _free(), freeHardLink(), and mapFreeIterator().
Referenced by rpmfiFini().
int fsmMapAttrs | ( | IOSM_t | fsm | ) |
Map file stat(2) info.
fsm | file state machine |
Definition at line 885 of file fsm.c.
References _, fsmGetFi(), gnameToGid(), IOSM_MAP_GID, IOSM_MAP_MODE, IOSM_MAP_TYPE, IOSM_MAP_UID, IOSM_PKGINSTALL, rpmlog(), RPMLOG_WARNING, and unameToUid().
Referenced by fsmStage().
int fsmMapPath | ( | IOSM_t | fsm | ) |
Map next file path and action.
fsm | file state machine |
Definition at line 794 of file fsm.c.
References _free(), FA_ALTNAME, FA_BACKUP, FA_COPYIN, FA_COPYOUT, FA_CREATE, FA_ERASE, FA_SAVE, FA_SKIP, FA_SKIPCOLOR, FA_SKIPNETSHARED, FA_SKIPNSTATE, FA_UNKNOWN, fsmFsPath(), fsmGetFi(), IOSM_MAP_PATH, RPMFILE_GHOST, RPMFILE_STATE_NETSHARED, RPMFILE_STATE_NOTINSTALLED, RPMFILE_STATE_WRONGCOLOR, rpmteType(), SUFFIX_RPMNEW, SUFFIX_RPMORIG, SUFFIX_RPMSAVE, and TR_REMOVED.
Referenced by fsmStage().
int fsmNext | ( | IOSM_t | fsm, |
iosmFileStage | nstage | ||
) |
File state machine driver.
fsm | file state machine |
nstage | next stage |
Definition at line 430 of file fsm.c.
References fsmStage(), rpmsqJoin(), and rpmsqThread().
Referenced by fsmCommitLinks(), fsmMakeLinks(), fsmMkdirs(), fsmRmdirs(), fsmSetup(), fsmStage(), saveHardLink(), writeFile(), and writeLinkedFile().
int fsmSetup | ( | void * | _fsm, |
iosmFileStage | goal, | ||
const char * | afmt, | ||
const void * | _ts, | ||
const void * | _fi, | ||
FD_t | cfd, | ||
unsigned int * | archiveSize, | ||
const char ** | failedFile | ||
) |
Load external data into file state machine.
_fsm | file state machine |
goal | |
afmt | archive format (NULL uses cpio) |
_ts | transaction set |
_fi | transaction element file info |
cfd | payload descriptor |
archiveSize | pointer to archive size |
failedFile | pointer to first file name that failed. |
Definition at line 619 of file fsm.c.
References _fsm_debug, _fsm_threads, _iosmNext, _tsmask, arHeaderRead(), arHeaderWrite(), arSetup(), arTrailerWrite(), cpioHeaderRead(), cpioHeaderWrite(), cpioTrailerWrite(), FA_COPYOUT, fdGetCpioPos(), fdLink(), fdSetCpioPos(), fsmNext(), fsmUNSAFE, IOSM_CREATE, IOSM_PKGBUILD, IOSM_PKGCOMMIT, IOSM_PKGERASE, IOSM_PKGINSTALL, mapInitIterator(), reverse, RPMCALLBACK_INST_START, rpmteType(), RPMTRANS_FLAG_NOCONTEXTS, RPMTRANS_FLAG_NOFDIGESTS, rpmtsFlags(), rpmtsGetTid(), rpmtsLink(), rpmtsNotify(), TAR_BLOCK_SIZE, tarHeaderRead(), tarHeaderWrite(), tarTrailerWrite(), TR_ADDED, and TR_REMOVED.
Referenced by cpio_doio(), and rpmpsmStage().
int fsmStage | ( | IOSM_t | fsm, |
iosmFileStage | stage | ||
) |
File state machine driver.
fsm | file state machine |
stage | next stage |
Definition at line 1586 of file fsm.c.
References _, _fafilter, _free(), alloca(), errno, extractRegular(), FA_ERASE, FA_UNKNOWN, Fclose(), fdGetCpioPos(), Fileno(), Fopen(), freeHardLink(), fsmCommitLinks(), fsmFsPath(), fsmGetFi(), fsmGetTs(), fsmMakeLinks(), fsmMapAttrs(), fsmMapFContext(), fsmMapPath(), fsmMkdirs(), fsmNext(), fsmRmdirs(), fsmUNSAFE, IOSM_ALL_HARDLINKS, IOSM_CHMOD, IOSM_CHOWN, IOSM_CHROOT, IOSM_COMMIT, IOSM_CREATE, IOSM_DEAD, IOSM_DESTROY, IOSM_DREAD, IOSM_DWRITE, IOSM_EAT, IOSM_FINI, IOSM_FOLLOW_SYMLINKS, IOSM_HREAD, IOSM_HWRITE, IOSM_INIT, IOSM_INTERNAL, IOSM_LCHOWN, IOSM_LINK, IOSM_LSETFCON, IOSM_LSTAT, IOSM_MAP, IOSM_MKDIR, IOSM_MKDIRS, IOSM_MKFIFO, IOSM_MKLINKS, IOSM_MKNOD, IOSM_NEXT, IOSM_NOTIFY, IOSM_PAD, IOSM_PAYLOAD_EXTRACT, IOSM_PAYLOAD_LIST, IOSM_PKGBUILD, IOSM_PKGCOMMIT, IOSM_PKGERASE, IOSM_PKGINSTALL, IOSM_POS, IOSM_POST, IOSM_PRE, IOSM_PROCESS, IOSM_RCLOSE, IOSM_READ, IOSM_READLINK, IOSM_RENAME, IOSM_RMDIR, IOSM_RMDIRS, IOSM_ROPEN, IOSM_STAT, IOSM_SYMLINK, IOSM_SYSCALL, IOSM_TRAILER, IOSM_UNDO, IOSM_UNKNOWN, IOSM_UNLINK, IOSM_UTIME, IOSM_VERBOSE, IOSM_VERIFY, IOSM_WCLOSE, IOSM_WOPEN, IOSM_WRITE, iosmFileActionSkipped(), iosmFileStageString(), iosmStage(), IS_DEV_LOG, Lstat(), mapFind(), mapNextIterator(), RPMCALLBACK_INST_PROGRESS, RPMFILE_GHOST, RPMFILE_MISSINGOK, rpmfiTypeString(), rpmlog(), RPMLOG_DEBUG, RPMLOG_ERR, RPMLOG_WARNING, rpmtsGetRdb(), rpmtsNotify(), S_ISLNK, S_ISSOCK, saveHardLink(), stpcpy(), Unlink(), urlPath(), writeFile(), writeLinkedFile(), xmalloc(), and xstrdup().
Referenced by fsmNext().
int fsmTeardown | ( | void * | _fsm | ) |
Clean file state machine.
_fsm | file state machine |
Definition at line 743 of file fsm.c.
References _free(), fdFree(), fsmGetTs(), fsmUNSAFE, IOSM_DESTROY, mapFreeIterator(), rpmswAdd(), RPMTS_OP_DIGEST, rpmtsFree(), and rpmtsOp().
Referenced by cpio_doio(), and rpmpsmStage().
IOSM_t newFSM | ( | void | ) |
Create file state machine instance.
Definition at line 543 of file fsm.c.
References xcalloc().
Referenced by rpmfiNew().
int _fsm_debug |