rpm  5.2.1
Macros | Functions | Variables
transaction.c File Reference
#include "system.h"
#include <rpmio.h>
#include <rpmiotypes.h>
#include <rpmlog.h>
#include <rpmmacro.h>
#include "fprint.h"
#include <rpmtypes.h>
#include <rpmtag.h>
#include <pkgio.h>
#include <rpmdb.h>
#include "legacy.h"
#include <rpmfi.h>
#include "fsm.h"
#include "rpmte.h"
#include "rpmts.h"
#include "psm.h"
#include "rpmds.h"
#include "rpmlock.h"
#include "misc.h"
#include <rpmcli.h>
#include <rpmrollback.h>
#include "debug.h"
Include dependency graph for transaction.c:

Go to the source code of this file.

Macros

#define _RPMDB_INTERNAL   /* XXX for dbiIndexFoo() */
 
#define _RPMFI_INTERNAL
 
#define _RPMTE_INTERNAL
 
#define _RPMTS_INTERNAL
 
#define _RPMSQ_INTERNAL
 
#define ISROOT(_d)   (((_d)[0] == '/' && (_d)[1] == '\0') ? "" : (_d))
 

Functions

static int sharedCmp (const void *one, const void *two)
 
static int handleInstInstalledFiles (const rpmts ts, rpmte p, rpmfi fi, sharedFileInfo shared, int sharedCount, int reportConflicts)
 handleInstInstalledFiles.
 
static int handleRmvdInstalledFiles (const rpmts ts, rpmfi fi, sharedFileInfo shared, int sharedCount)
 
static int fpsCompare (const void *one, const void *two)
 
static int findFps (const struct fingerPrint_s *fiFps, const struct fingerPrint_s *otherFps, int otherFc)
 
static void handleOverlappedFiles (const rpmts ts, const rpmte p, rpmfi fi)
 Update disk space needs on each partition for this package's files.
 
static int ensureOlder (rpmts ts, const rpmte p, const Header h)
 Ensure that current package is newer than installed package.
 
static void skipFiles (const rpmts ts, rpmfi fi)
 Skip any files that do not match install policies.
 
static rpmfi rpmtsiFi (const rpmtsi tsi)
 Return transaction element's file info.
 
static rpmRC _processFailedPackage (rpmts ts, rpmte p)
 Force add a failed package into the rpmdb.
 
rpmRC rpmtsRollback (rpmts rbts, rpmprobFilterFlags ignoreSet, int running, rpmte rbte)
 Rollback a failed transaction.
 
static int cmpArgvStr (const char **AV, const char *B)
 Search for string B in argv array AV.
 
static int markLinkedFailed (rpmts ts, rpmte p)
 Mark all erasure elements linked to installed element p as failed.
 
int rpmtsRun (rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
 Process all package elements in a transaction set.
 

Variables

int _fps_debug = 0
 
static int _linear_fps_search = 0
 

Macro Definition Documentation

#define _RPMDB_INTERNAL   /* XXX for dbiIndexFoo() */

Definition at line 17 of file transaction.c.

#define _RPMFI_INTERNAL

Definition at line 21 of file transaction.c.

#define _RPMSQ_INTERNAL

Definition at line 30 of file transaction.c.

#define _RPMTE_INTERNAL

Definition at line 25 of file transaction.c.

#define _RPMTS_INTERNAL

Definition at line 27 of file transaction.c.

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

Definition at line 305 of file transaction.c.

Function Documentation

static rpmRC _processFailedPackage ( rpmts  ts,
rpmte  p 
)
static

Force add a failed package into the rpmdb.

Parameters
tscurrent transaction set
pfailed rpmte.
Returns
RPMRC_OK, or RPMRC_FAIL

Definition at line 950 of file transaction.c.

References PSM_RPMDB_ADD, rpmpsmFree(), rpmpsmNew(), rpmpsmStage(), RPMRC_OK, rpmteType(), rpmpsm_s::stepName, and TR_ADDED.

Referenced by rpmtsRollback().

static int cmpArgvStr ( const char **  AV,
const char *  B 
)
static

Search for string B in argv array AV.

Parameters
AVargv array
Bstring
Returns
1 if found, 0 otherwise

Definition at line 1107 of file transaction.c.

Referenced by markLinkedFailed().

static int ensureOlder ( rpmts  ts,
const rpmte  p,
const Header  h 
)
static

Ensure that current package is newer than installed package.

Parameters
tstransaction set
pcurrent transaction element
hinstalled header
Returns
0 if not newer, 1 if okay

Definition at line 627 of file transaction.c.

References _free(), _rpmds_nopromote, alloca(), headerGet(), _HE_s::p, rpmDataType_u::ptr, rpmdsFree(), rpmdsNVRMatchesDep(), rpmdsSingle(), RPMPROB_OLDPACKAGE, rpmpsAppend(), rpmpsFree(), RPMSENSE_EQUAL, RPMSENSE_LESS, RPMTAG_NVRA, RPMTAG_REQUIRENAME, rpmteE(), rpmteKey(), rpmteN(), rpmteNEVR(), rpmteR(), rpmteV(), rpmtsProblems(), stpcpy(), rpmDataType_u::str, and _HE_s::tag.

Referenced by rpmtsRun().

static int findFps ( const struct fingerPrint_s fiFps,
const struct fingerPrint_s otherFps,
int  otherFc 
)
static

Definition at line 349 of file transaction.c.

References _linear_fps_search, FP_EQUAL, and fpsCompare().

Referenced by handleOverlappedFiles().

static int fpsCompare ( const void *  one,
const void *  two 
)
static
static int handleInstInstalledFiles ( const rpmts  ts,
rpmte  p,
rpmfi  fi,
sharedFileInfo  shared,
int  sharedCount,
int  reportConflicts 
)
static
static void handleOverlappedFiles ( const rpmts  ts,
const rpmte  p,
rpmfi  fi 
)
static
static int handleRmvdInstalledFiles ( const rpmts  ts,
rpmfi  fi,
sharedFileInfo  shared,
int  sharedCount 
)
static
static int markLinkedFailed ( rpmts  ts,
rpmte  p 
)
static

Mark all erasure elements linked to installed element p as failed.

Parameters
tstransaction set
pfailed install transaction element
Returns
0 always

Definition at line 1127 of file transaction.c.

References cmpArgvStr(), rpmtsiFree(), rpmtsiInit(), rpmtsiNext(), and TR_REMOVED.

Referenced by rpmtsRun().

static rpmfi rpmtsiFi ( const rpmtsi  tsi)
static

Return transaction element's file info.

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

Definition at line 924 of file transaction.c.

References rpmtsElement().

Referenced by rpmtsRun().

static int sharedCmp ( const void *  one,
const void *  two 
)
static

Definition at line 69 of file transaction.c.

Referenced by rpmtsRun().

static void skipFiles ( const rpmts  ts,
rpmfi  fi 
)
static

Variable Documentation

int _fps_debug = 0

Definition at line 308 of file transaction.c.

int _linear_fps_search = 0
static

Definition at line 347 of file transaction.c.

Referenced by findFps().