Package state machine to handle a package from a transaction set. More...
#include "system.h"
#include "psm.h"
#include <rpmmacro.h>
#include <rpmurl.h>
#include "depends.h"
#include "rpmlead.h"
#include "signature.h"
#include "ugid.h"
#include "misc.h"
#include "rpmdb.h"
#include "debug.h"
Go to the source code of this file.
Data Structures | |
struct | tagMacro |
Macros to be defined from per-header tag values. More... | |
Functions | |
int | rpmVersionCompare (Header first, Header second) |
Compare headers to determine which header is "newer". | |
void | loadFi (Header h, TFI_t fi) |
Load data from header into transaction file element info. | |
void | freeFi (TFI_t fi) |
Destroy transaction element file info. | |
const char *const | fiTypeString (TFI_t fi) |
Return formatted string representation of package disposition. | |
static int | rpmInstallLoadMacros (TFI_t fi, Header h) |
Define per-header macros. | |
static int | mergeFiles (TFI_t fi, Header h, Header newH) |
Copy file data from h to newH. | |
static int | markReplacedFiles (PSM_t psm) |
Mark files in database shared with this package as "replaced". | |
static rpmRC | chkdir (const char *dpath, const char *dname) |
Create directory if it does not exist, make sure path is writable. | |
rpmRC | rpmInstallSourcePackage (const char *rootDir, FD_t fd, const char **specFilePtr, rpmCallbackFunction notify, rpmCallbackData notifyData, char **cookie) |
Install source package. | |
static const char *const | tag2sln (int tag) |
Return scriptlet name from tag. | |
static int | runScript (PSM_t psm, Header h, const char *sln, int progArgc, const char **progArgv, const char *script, int arg1, int arg2) |
Run scriptlet with args. | |
static rpmRC | runInstScript (PSM_t psm) |
Retrieve and run scriptlet from header. | |
static int | handleOneTrigger (PSM_t psm, Header sourceH, Header triggeredH, int arg2, unsigned char *triggersAlreadyRun) |
static int | runTriggers (PSM_t psm) |
Run trigger scripts in the database that are fired by this header. | |
static int | runImmedTriggers (PSM_t psm) |
Run triggers from this header that are fired by headers in the database. | |
static const char *const | pkgStageString (pkgStage a) |
int | psmStage (PSM_t psm, pkgStage stage) |
Package state machine driver. | |
Variables | |
static struct tagMacro | tagMacros [] |
Macros to be defined from per-header tag values. | |
static char * | SCRIPT_PATH |
Package state machine to handle a package from a transaction set.
Definition in file psm.c.
static rpmRC chkdir | ( | const char * | dpath, | |
const char * | dname | |||
) | [static] |
const char* const fiTypeString | ( | TFI_t | fi | ) |
void freeFi | ( | TFI_t | fi | ) |
static int markReplacedFiles | ( | PSM_t | psm | ) | [static] |
static const char* const pkgStageString | ( | pkgStage | a | ) | [static] |
rpmRC rpmInstallSourcePackage | ( | const char * | rootDir, | |
FD_t | fd, | |||
const char ** | specFilePtr, | |||
rpmCallbackFunction | notify, | |||
rpmCallbackData | notifyData, | |||
char ** | cookie | |||
) |
Install source package.
rootDir | path to top of install tree (or NULL) | |
fd | file handle |
specFilePtr | address of spec file name (or NULL) |
notify | progress callback | |
notifyData | progress callback private data |
cooke | address of cookie pointer (or NULL) |
static int runImmedTriggers | ( | PSM_t | psm | ) | [static] |
static int runScript | ( | PSM_t | psm, | |
Header | h, | |||
const char * | sln, | |||
int | progArgc, | |||
const char ** | progArgv, | |||
const char * | script, | |||
int | arg1, | |||
int | arg2 | |||
) | [static] |
Run scriptlet with args.
Run a script with an interpreter. If the interpreter is not specified, /bin/sh will be used. If the interpreter is /bin/sh, then the args from the header will be ignored, passing instead arg1 and arg2.
psm | package state machine data | |
h | header | |
sln | name of scriptlet section | |
progArgc | no. of args from header | |
progArgv | args from header, progArgv[0] is the interpreter to use | |
script | scriptlet from header | |
arg1 | no. instances of package installed after scriptlet exec (-1 is no arg) | |
arg2 | ditto, but for the target package |
static int runTriggers | ( | PSM_t | psm | ) | [static] |
static const char* const tag2sln | ( | int | tag | ) | [static] |
char* SCRIPT_PATH [static] |