|
rpm
5.4.10
|
File state machine to handle a payload from a package. More...
#include "system.h"#include <rpmio_internal.h>#include <rpmcb.h>#include <ugid.h>#include <rpmsq.h>#include <rpmsw.h>#include <rpmsx.h>#include "../rpmdb/rpmtag.h"#include <iosm.h>#include "cpio.h"#include "tar.h"#include "ar.h"#include "../lib/rpmfi.h"#include "debug.h"
Go to the source code of this file.
Data Structures | |
| struct | dnli_s |
| Directory name iterator. More... | |
Macros | |
| #define | _IOSM_INTERNAL |
| #define | iosmUNSAFE iosmStage |
| #define | _RPMFI_INTERNAL |
| #define | _RPMFI_NOMETHODS |
| #define | alloca_strdup(_s) strcpy((char *)alloca(strlen(_s)+1), (_s)) |
| #define | _IOSM_DEBUG 0 |
| #define | SUFFIX_RPMORIG ".rpmorig" |
| #define | SUFFIX_RPMSAVE ".rpmsave" |
| #define | SUFFIX_RPMNEW ".rpmnew" |
| #define | IS_DEV_LOG(_x) |
| #define | _fafilter(_a) |
| #define | IOSM_SKIPPING(_a) ((_a) == FA_SKIP || (_a) == FA_SKIPNSTATE || (_a) == FA_SKIPNETSHARED || (_a) == FA_SKIPCOLOR) |
Typedefs | |
| typedef struct rpmts_s * | rpmts |
| typedef struct rpmte_s * | rpmte |
| typedef iosmMapFlags | cpioMapFlags |
| typedef struct rpmds_s * | rpmds |
| typedef struct rpmRelocation_s * | rpmRelocation |
| typedef struct rpmdb_s * | rpmdb |
| typedef struct rpmmi_s * | rpmmi |
| typedef struct rpmPRCO_s * | rpmPRCO |
| typedef struct Spec_s * | Spec |
| typedef struct dnli_s * | DNLI_t |
| Directory name iterator. | |
Functions | |
| void * | iosmGetFi (const IOSM_t iosm) |
| Retrieve transaction element file info from I/O state machine iterator. | |
| static const char * | iosmFsPath (const IOSM_t iosm, const struct stat *st, const char *subdir, const char *suffix) |
| Build path to file from file info, ornamented with subdir and suffix. | |
| static void * | mapFreeIterator (void *_iter) |
| Destroy file info iterator. | |
| static void * | mapInitIterator (rpmfi fi, int reverse) |
| Create file info iterator. | |
| static int | mapNextIterator (void *_iter) |
| Return next index into file info. | |
| static int | iosmStrCmp (const void *a, const void *b) |
| static int | mapFind (IOSMI_t iter, const char *iosmPath) |
| Locate archive path in file info. | |
| static void * | dnlFreeIterator (const void *_dnli) |
| Destroy directory name iterator. | |
| static int | dnlCount (const DNLI_t dnli) |
| static int | dnlIndex (const DNLI_t dnli) |
| static void * | dnlInitIterator (const IOSM_t iosm, int reverse) |
| Create directory name iterator. | |
| static const char * | dnlNextIterator (DNLI_t dnli) |
| Return next directory name (from file info). | |
| int | iosmNext (IOSM_t iosm, iosmFileStage nstage) |
| File state machine driver. | |
| static int | saveHardLink (IOSM_t iosm) |
| Save hard link in chain. | |
| static void * | freeHardLink (struct hardLink_s *li) |
| Destroy set of hard links. | |
| IOSM_t | newIOSM (void) |
| Create I/O state machine instance. | |
| IOSM_t | freeIOSM (IOSM_t iosm) |
| Destroy I/O state machine instance. | |
| static int | arSetup (IOSM_t iosm, rpmfi fi) |
| int | iosmSetup (IOSM_t iosm, iosmFileStage goal, const char *afmt, const void *_ts, const void *_fi, FD_t cfd, unsigned int *archiveSize, const char **failedFile) |
| Load external data into I/O state machine. | |
| int | iosmTeardown (IOSM_t iosm) |
| Clean I/O state machine. | |
| static int | iosmMapFContext (IOSM_t iosm) |
| int | iosmMapPath (IOSM_t iosm) |
| Map next file path and action. | |
| int | iosmMapAttrs (IOSM_t iosm) |
| Map file stat(2) info. | |
| static int | extractRegular (IOSM_t iosm) |
| Create file from payload stream. | |
| static int | writeFile (IOSM_t iosm, int writeData) |
| Write next item to payload stream. | |
| static int | writeLinkedFile (IOSM_t iosm) |
| Write set of linked files to payload stream. | |
| static int | iosmMakeLinks (IOSM_t iosm) |
| Create pending hard links to existing file. | |
| static int | iosmCommitLinks (IOSM_t iosm) |
| Commit hard linked file set atomically. | |
| static int | iosmRmdirs (IOSM_t iosm) |
| Remove (if created) directories not explicitly included in package. | |
| static int | iosmMkdirs (IOSM_t iosm) |
| Create (if necessary) directories not explicitly included in package. | |
| int | iosmStage (IOSM_t iosm, iosmFileStage stage) |
| File state machine driver. | |
| int | iosmFileActionSkipped (iosmFileAction action) |
| Is the file going to be skipped? | |
| const char * | iosmFileActionString (iosmFileAction a) |
| Return formatted string representation of file disposition. | |
| const char * | iosmFileStageString (iosmFileStage a) |
| Return formatted string representation of file stages. | |
| char * | iosmStrerror (int rc) |
| Return formatted error message on payload handling failure. | |
Variables | |
| int | _iosm_debug = 0 |
| int | _iosm_threads = 0 |
| int(* | _iosmNext )(IOSM_t iosm, iosmFileStage nstage) = &iosmNext |
| Vector to iosmNext. | |
File state machine to handle a payload from a package.
Definition in file iosm.c.
| #define _fafilter | ( | _a | ) |
| #define alloca_strdup | ( | _s | ) | strcpy((char *)alloca(strlen(_s)+1), (_s)) |
| #define IOSM_SKIPPING | ( | _a | ) | ((_a) == FA_SKIP || (_a) == FA_SKIPNSTATE || (_a) == FA_SKIPNETSHARED || (_a) == FA_SKIPCOLOR) |
Definition at line 2669 of file iosm.c.
Referenced by iosmFileActionSkipped().
| #define iosmUNSAFE iosmStage |
Definition at line 23 of file iosm.c.
Referenced by iosmMakeLinks(), iosmMkdirs(), iosmSetup(), iosmStage(), iosmTeardown(), and writeFile().
| #define IS_DEV_LOG | ( | _x | ) |
Definition at line 1625 of file iosm.c.
Referenced by iosmStage().
| #define SUFFIX_RPMNEW ".rpmnew" |
Definition at line 107 of file iosm.c.
Referenced by iosmMapPath().
| #define SUFFIX_RPMORIG ".rpmorig" |
Definition at line 105 of file iosm.c.
Referenced by iosmMapPath().
| #define SUFFIX_RPMSAVE ".rpmsave" |
Definition at line 106 of file iosm.c.
Referenced by iosmMapPath().
| typedef iosmMapFlags cpioMapFlags |
| typedef struct rpmRelocation_s* rpmRelocation |
Definition at line 596 of file iosm.c.
References iosm_s::lmtab, iosm_s::lmtablen, iosm_s::lmtaboff, rpmfiBN(), rpmfiInit(), rpmfiNext(), stpcpy(), urlPath(), and xmalloc.
Referenced by fsmSetup(), and iosmSetup().
|
inlinestatic |
Definition at line 306 of file iosm.c.
References dnli_s::fi.
Referenced by iosmMkdirs(), and iosmRmdirs().
|
static |
Destroy directory name iterator.
| _dnli | directory name iterator |
| NULL | always |
Definition at line 294 of file iosm.c.
References _free(), and dnli_s::active.
Referenced by iosmMkdirs(), and iosmRmdirs().
|
inlinestatic |
Definition at line 314 of file iosm.c.
References dnli_s::isave.
Referenced by iosmMkdirs(), and iosmRmdirs().
|
static |
Create directory name iterator.
| iosm | file state machine data |
| reverse | traverse directory names in reverse order? |
Definition at line 328 of file iosm.c.
References dnli_s::active, D_, dnli_s::fi, dnli_s::i, iosmFileActionSkipped(), iosmGetFi(), reverse, dnli_s::reverse, rpmfiInit(), rpmfiNext(), rpmlog(), RPMLOG_DEBUG, urlPath(), and xcalloc().
Referenced by iosmMkdirs(), and iosmRmdirs().
|
static |
Return next directory name (from file info).
| dnli | directory name iterator |
Definition at line 426 of file iosm.c.
References dnli_s::active, dnli_s::fi, dnli_s::i, dnli_s::isave, and dnli_s::reverse.
Referenced by iosmMkdirs(), and iosmRmdirs().
|
static |
Create file from payload stream.
| iosm | file state machine data |
Definition at line 1028 of file iosm.c.
References _free(), iosm_s::digest, iosm_s::digestlen, fdFiniDigest(), iosm_s::fdigest, iosm_s::fdigestalgo, fdInitDigest(), Fflush(), Fileno(), IOSM_DREAD, IOSM_NOTIFY, IOSM_WCLOSE, IOSM_WOPEN, IOSM_WRITE, IOSMERR_DIGEST_MISMATCH, iosmNext(), iosm_s::sb, iosm_s::wfd, iosm_s::wrlen, iosm_s::wrnb, and iosm_s::wrsize.
Referenced by iosmStage().
|
static |
Destroy set of hard links.
| li | set of hard links |
Definition at line 564 of file iosm.c.
References _free(), hardLink_s::filex, and hardLink_s::nsuffix.
Referenced by freeIOSM(), and iosmStage().
Destroy I/O state machine instance.
| iosm | I/O state machine |
Definition at line 580 of file iosm.c.
References _free(), iosm_s::dnlx, freeHardLink(), iosm_s::iter, iosm_s::ldn, iosm_s::li, iosm_s::links, mapFreeIterator(), hardLink_s::next, and iosm_s::path.
| int iosmFileActionSkipped | ( | iosmFileAction | action | ) |
Is the file going to be skipped?
| iosm | I/O state machine |
Definition at line 2672 of file iosm.c.
References IOSM_SKIPPING.
Referenced by dnlInitIterator(), fsmCommitLinks(), fsmMakeLinks(), fsmStage(), handleInstInstalledFile(), handleOverlappedFiles(), iosmCommitLinks(), iosmMakeLinks(), iosmStage(), rpmtsAddFingerprints(), rpmtsSkipFiles(), and saveHardLink().
| const char* iosmFileActionString | ( | iosmFileAction | a | ) |
Return formatted string representation of file disposition.
| a | file disposition |
Definition at line 2677 of file iosm.c.
References FA_ALTNAME, FA_BACKUP, FA_COPYIN, FA_COPYOUT, FA_CREATE, FA_ERASE, FA_SAVE, FA_SKIP, FA_SKIPCOLOR, FA_SKIPNETSHARED, FA_SKIPNSTATE, and FA_UNKNOWN.
| const char* iosmFileStageString | ( | iosmFileStage | a | ) |
Return formatted string representation of file stages.
| a | file stage |
Definition at line 2697 of file iosm.c.
References IOSM_CHMOD, IOSM_CHOWN, IOSM_CHROOT, IOSM_COMMIT, IOSM_CREATE, IOSM_DESTROY, IOSM_DREAD, IOSM_DWRITE, IOSM_EAT, IOSM_FINI, IOSM_HREAD, IOSM_HWRITE, IOSM_INIT, 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_PKGBUILD, IOSM_PKGCOMMIT, IOSM_PKGERASE, IOSM_PKGINSTALL, IOSM_PKGUNDO, 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_TRAILER, IOSM_UNDO, IOSM_UNKNOWN, IOSM_UNLINK, IOSM_UTIME, IOSM_VERIFY, IOSM_WCLOSE, IOSM_WOPEN, and IOSM_WRITE.
Referenced by fsmStage(), and iosmStage().
| void* iosmGetFi | ( | const IOSM_t | iosm | ) |
Retrieve transaction element file info from I/O state machine iterator.
| iosm | I/O state machine |
Definition at line 97 of file iosm.c.
References iosmIterator_s::fi, and iosm_s::iter.
Referenced by dnlInitIterator(), iosmMapAttrs(), iosmMapFContext(), iosmMapPath(), iosmMkdirs(), iosmStage(), saveHardLink(), and writeFile().
| int iosmMapAttrs | ( | IOSM_t | iosm | ) |
Map file stat(2) info.
| iosm | I/O state machine |
Definition at line 949 of file iosm.c.
References _, iosm_s::digest, iosm_s::digestlen, iosm_s::fdigest, iosm_s::fdigestalgo, gnameToGid(), iosm_s::goal, IOSM_MAP_GID, IOSM_MAP_MODE, IOSM_MAP_TYPE, IOSM_MAP_UID, IOSM_PKGINSTALL, iosmGetFi(), iosm_s::ix, iosm_s::mapFlags, iosm_s::nofdigests, rpmlog(), RPMLOG_WARNING, iosm_s::sb, and unameToUid().
Referenced by iosmStage().
|
static |
Definition at line 835 of file iosm.c.
References iosm_s::fcontext, iosmGetFi(), iosm_s::ix, iosm_s::nofcontexts, iosm_s::path, rpmsxMatch(), and iosm_s::sb.
Referenced by iosmStage().
| int iosmMapPath | ( | IOSM_t | iosm | ) |
Map next file path and action.
| iosm | I/O state machine |
Definition at line 858 of file iosm.c.
References _free(), iosm_s::action, iosm_s::adding, iosm_s::astriplen, iosm_s::baseName, iosm_s::dirName, FA_ALTNAME, FA_BACKUP, FA_COPYIN, FA_COPYOUT, FA_CREATE, FA_ERASE, FA_SAVE, FA_SKIP, FA_SKIPCOLOR, FA_SKIPNETSHARED, FA_SKIPNSTATE, FA_UNKNOWN, iosm_s::fflags, IOSM_MAP_PATH, iosmFsPath(), iosmGetFi(), iosm_s::ix, iosm_s::mapFlags, iosm_s::nsuffix, iosm_s::osuffix, iosm_s::path, RPMFILE_GHOST, RPMFILE_STATE_NETSHARED, RPMFILE_STATE_NOTINSTALLED, RPMFILE_STATE_WRONGCOLOR, rpmteType(), iosm_s::sb, iosm_s::subdir, iosm_s::suffix, SUFFIX_RPMNEW, SUFFIX_RPMORIG, SUFFIX_RPMSAVE, and TR_REMOVED.
Referenced by iosmStage().
|
static |
Create (if necessary) directories not explicitly included in package.
| iosm | file state machine data |
Definition at line 1469 of file iosm.c.
References _free(), D_, dc, dnlCount(), dnlFreeIterator(), dnlIndex(), dnlInitIterator(), dnlNextIterator(), iosm_s::dnlx, iosm_s::fcontext, IOSM_LSETFCON, IOSM_LSTAT, IOSM_MKDIR, IOSMERR_ENOENT, iosmGetFi(), iosmNext(), iosmUNSAFE, iosm_s::ldn, iosm_s::ldnalloc, iosm_s::ldnlen, iosm_s::osb, iosm_s::path, iosm_s::rdbuf, rpmlog(), RPMLOG_DEBUG, rpmsxMatch(), iosm_s::sb, stpcpy(), urlPath(), xcalloc(), and xrealloc.
Referenced by iosmStage().
| int iosmNext | ( | IOSM_t | iosm, |
| iosmFileStage | nstage | ||
| ) |
File state machine driver.
| iosm | I/O state machine |
| nstage | next stage |
Definition at line 461 of file iosm.c.
References iosmStage(), iosm_s::multithreaded, iosm_s::nstage, rpmsqJoin(), and rpmsqThread().
Referenced by extractRegular(), iosmCommitLinks(), iosmMakeLinks(), iosmMkdirs(), iosmRmdirs(), iosmSetup(), iosmStage(), saveHardLink(), writeFile(), and writeLinkedFile().
|
static |
Remove (if created) directories not explicitly included in package.
| iosm | file state machine data |
Definition at line 1414 of file iosm.c.
References dc, dnlCount(), dnlFreeIterator(), dnlIndex(), dnlInitIterator(), dnlNextIterator(), iosm_s::dnlx, IOSM_RMDIR, iosmNext(), iosm_s::ldn, iosm_s::path, iosm_s::rdbuf, and stpcpy().
Referenced by iosmStage().
| int iosmSetup | ( | IOSM_t | iosm, |
| iosmFileStage | goal, | ||
| const char * | afmt, | ||
| const void * | _ts, | ||
| const void * | _fi, | ||
| FD_t | cfd, | ||
| unsigned int * | archiveSize, | ||
| const char ** | failedFile | ||
| ) |
Load external data into I/O state machine.
| iosm | I/O 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 669 of file iosm.c.
References _iosm_debug, _iosm_threads, _iosmNext, _tsmask, iosm_s::adding, iosm_s::archiveSize, arHeaderRead(), arHeaderWrite(), arSetup(), arTrailerWrite(), iosm_s::blksize, iosm_s::cfd, iosm_s::commit, cpioHeaderRead(), cpioHeaderWrite(), cpioTrailerWrite(), iosm_s::debug, FA_COPYOUT, iosm_s::failedFile, fdGetCpioPos(), fdLink(), fdSetCpioPos(), iosm_s::goal, iosm_s::headerRead, iosm_s::headerWrite, IOSM_CREATE, IOSM_PKGBUILD, IOSM_PKGCOMMIT, IOSM_PKGERASE, IOSM_PKGINSTALL, iosmNext(), iosmUNSAFE, iosm_s::iter, mapInitIterator(), iosm_s::multithreaded, iosm_s::nofcontexts, iosm_s::nofdigests, iosm_s::rc, reverse, RPMCALLBACK_INST_START, rpmteType(), RPMTRANS_FLAG_NOCONTEXTS, RPMTRANS_FLAG_NOFDIGESTS, rpmtsFlags(), rpmtsGetTid(), rpmtsLink(), rpmtsNotify(), iosm_s::sufbuf, TAR_BLOCK_SIZE, tarHeaderRead(), tarHeaderWrite(), tarTrailerWrite(), TR_ADDED, TR_REMOVED, iosm_s::trailerWrite, and iosmIterator_s::ts.
| int iosmStage | ( | IOSM_t | iosm, |
| iosmFileStage | stage | ||
| ) |
File state machine driver.
| iosm | I/O state machine |
| stage | next stage |
Definition at line 1632 of file iosm.c.
References _, _fafilter, _free(), iosm_s::action, alloca(), iosm_s::astriplen, iosm_s::blksize, iosm_s::cfd, Chmod(), Chown(), iosm_s::commit, CPIO_TRAILER, hardLink_s::createdPath, iosm_s::debug, iosm_s::diskchecked, iosm_s::dnlx, errno, iosm_s::exists, extractRegular(), FA_ERASE, FA_UNKNOWN, Fadvise(), iosm_s::failedFile, Fclose(), iosm_s::fcontext, fdGetCpioPos(), fdSetCpioPos(), FDSTAT_DIGEST, fdstat_op(), Ferror(), iosm_s::fflags, hardLink_s::filex, Fopen(), Fread(), freeHardLink(), Fwrite(), iosm_s::goal, iosm_s::headerRead, iosm_s::headerWrite, 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_SBIT_CHECK, 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, iosmCommitLinks(), IOSMERR_CHMOD_FAILED, IOSMERR_CHOWN_FAILED, IOSMERR_ENOENT, IOSMERR_ENOTEMPTY, IOSMERR_HDR_TRAILER, IOSMERR_LINK_FAILED, IOSMERR_LSETFCON_FAILED, IOSMERR_LSTAT_FAILED, IOSMERR_MISSING_HARDLINK, IOSMERR_MKDIR_FAILED, IOSMERR_MKFIFO_FAILED, IOSMERR_MKNOD_FAILED, IOSMERR_OPEN_FAILED, IOSMERR_READ_FAILED, IOSMERR_READLINK_FAILED, IOSMERR_RENAME_FAILED, IOSMERR_RMDIR_FAILED, IOSMERR_STAT_FAILED, IOSMERR_SYMLINK_FAILED, IOSMERR_UNKNOWN_FILETYPE, IOSMERR_UNLINK_FAILED, IOSMERR_UNMAPPED_FILE, IOSMERR_UTIME_FAILED, IOSMERR_WRITE_FAILED, iosmFileActionSkipped(), iosmFileStageString(), iosmFsPath(), iosmGetFi(), iosmGetTs(), iosmMakeLinks(), iosmMapAttrs(), iosmMapFContext(), iosmMapPath(), iosmMkdirs(), iosmNext(), iosmRmdirs(), iosmUNSAFE, IS_DEV_LOG, iosm_s::iter, iosm_s::ix, Lchown(), iosm_s::ldn, iosm_s::ldnalloc, iosm_s::ldnlen, iosm_s::li, Link(), hardLink_s::linkIndex, iosm_s::links, hardLink_s::linksLeft, iosm_s::lpath, Lstat(), mapFind(), iosm_s::mapFlags, mapNextIterator(), Mkdir(), iosm_s::mkdirsdone, Mkfifo(), Mknod(), hardLink_s::next, hardLink_s::nlink, iosm_s::nsuffix, iosm_s::op_digest, iosm_s::opath, iosm_s::osb, iosm_s::osuffix, iosm_s::path, iosm_s::postpone, iosm_s::rc, iosm_s::rdb, iosm_s::rdbuf, iosm_s::rdlen, iosm_s::rdnb, iosm_s::rdsize, Readlink(), Rename(), iosm_s::repackaged, iosm_s::rfd, Rmdir(), RPMCALLBACK_INST_PROGRESS, RPMFILE_GHOST, RPMFILE_MISSINGOK, rpmlog(), RPMLOG_DEBUG, RPMLOG_ERR, RPMLOG_WARNING, rpmswAdd(), rpmsxLsetfilecon(), rpmtsNotify(), S_ISLNK, S_ISSOCK, saveHardLink(), hardLink_s::sb, iosm_s::sb, iosm_s::stage, Stat(), stpcpy(), iosm_s::strict_erasures, iosm_s::subdir, iosm_s::sufbuf, iosm_s::suffix, Symlink(), iosm_s::trailerWrite, Unlink(), urlPath(), Utime(), iosm_s::wfd, iosm_s::wrb, iosm_s::wrbuf, writeFile(), writeLinkedFile(), iosm_s::wrlen, iosm_s::wrnb, iosm_s::wrsize, xmalloc, and xstrdup().
Referenced by fsmStage(), and iosmNext().
| int iosmTeardown | ( | IOSM_t | iosm | ) |
Clean I/O state machine.
| iosm | I/O state machine |
Definition at line 802 of file iosm.c.
References _free(), iosm_s::cfd, iosm_s::debug, iosm_s::failedFile, fdFree(), IOSM_DESTROY, iosmGetTs(), iosmUNSAFE, iosm_s::iter, iosm_s::lmtab, mapFreeIterator(), iosm_s::op_digest, iosm_s::rc, rpmswAdd(), RPMTS_OP_DIGEST, rpmtsFree(), rpmtsOp(), and iosmIterator_s::ts.
|
static |
Locate archive path in file info.
| iter | file info iterator |
| iosmPath | archive path |
Definition at line 247 of file iosm.c.
References _RPMFI_NOMETHODS, Spec_s::fi, iosmIterator_s::fi, iosmIterator_s::i, iosmStrCmp(), mapNextIterator(), and rpmfiFC().
Referenced by iosmStage().
|
static |
Destroy file info iterator.
| _iter | file info iterator |
| NULL | always |
Definition at line 150 of file iosm.c.
References _free(), iosmIterator_s::fi, and rpmfiUnlink().
Referenced by freeIOSM(), and iosmTeardown().
|
static |
Create file info iterator.
| fi | transaction element file info |
| reverse | iterate in reverse order? |
Definition at line 171 of file iosm.c.
References Spec_s::fi, iosmIterator_s::fi, iosmIterator_s::i, iosmIterator_s::isave, reverse, iosmIterator_s::reverse, rpmfiLink(), and xcalloc().
Referenced by iosmSetup().
|
static |
Return next index into file info.
| _iter | file info iterator |
Definition at line 194 of file iosm.c.
References iosmIterator_s::fi, iosmIterator_s::i, iosmIterator_s::isave, and iosmIterator_s::reverse.
Referenced by iosmStage(), and mapFind().
| IOSM_t newIOSM | ( | void | ) |
|
static |
Save hard link in chain.
| iosm | file state machine data |
Definition at line 478 of file iosm.c.
References _free(), hardLink_s::createdPath, hardLink_s::filex, iosm_s::goal, IOSM_MAP, IOSM_PKGBUILD, IOSM_PKGINSTALL, iosmFileActionSkipped(), iosmGetFi(), iosmNext(), iosm_s::ix, iosm_s::li, hardLink_s::linkIndex, iosm_s::links, hardLink_s::linksLeft, hardLink_s::next, hardLink_s::nlink, hardLink_s::nsuffix, iosm_s::nsuffix, iosm_s::path, hardLink_s::sb, iosm_s::sb, and xcalloc().
Referenced by iosmStage().
|
static |
Write next item to payload stream.
| iosm | file state machine data |
| writeData | should data be written? |
Definition at line 1100 of file iosm.c.
References alloca(), iosm_s::baseName, iosm_s::dirName, Fileno(), IOSM_DWRITE, IOSM_HWRITE, IOSM_MAP_ABSOLUTE, IOSM_MAP_ADDDOT, IOSM_MAP_PATH, IOSM_PAD, IOSM_RCLOSE, IOSM_READ, IOSM_READLINK, IOSM_ROPEN, iosmGetFi(), iosmNext(), iosmUNSAFE, iosm_s::ix, iosm_s::lpath, iosm_s::mapFlags, iosm_s::opath, iosm_s::osb, iosm_s::path, iosm_s::rdbuf, iosm_s::rdlen, iosm_s::rdnb, iosm_s::rdsize, iosm_s::rfd, S_ISLNK, iosm_s::sb, stpcpy(), urlPath(), iosm_s::wrnb, and xstrdup().
Referenced by iosmStage(), and writeLinkedFile().
|
static |
Write set of linked files to payload stream.
| iosm | file state machine data |
Definition at line 1235 of file iosm.c.
References _free(), iosm_s::astriplen, iosm_s::failedFile, hardLink_s::filex, iosm_s::headerWrite, IOSM_MAP, iosmNext(), iosm_s::ix, iosm_s::li, iosm_s::lpath, hardLink_s::nlink, iosm_s::nsuffix, iosm_s::path, stpcpy(), tarHeaderWrite(), urlPath(), writeFile(), xmalloc, and xstrdup().
Referenced by iosmStage().
| int _iosm_debug = 0 |
Definition at line 75 of file iosm.c.
Referenced by iosmSetup().
| int _iosm_threads = 0 |
Definition at line 79 of file iosm.c.
Referenced by iosmSetup().
| int(* _iosmNext)(IOSM_t iosm, iosmFileStage nstage) = &iosmNext |
Vector to iosmNext.
Definition at line 83 of file iosm.c.
Referenced by arHeaderRead(), arHeaderWrite(), arRead(), arTrailerWrite(), arWrite(), cpioHeaderRead(), cpioHeaderWrite(), cpioRead(), cpioTrailerWrite(), cpioWrite(), fsmSetup(), iosmSetup(), tarHeaderWrite(), tarHeaderWriteName(), tarRead(), tarTrailerWrite(), and tarWrite().
1.8.1.2