rpm 5.3.7
Defines | Functions | Variables

lib/rpmrollback.c File Reference

#include "system.h"
#include <rpmio.h>
#include <rpmiotypes.h>
#include <rpmcb.h>
#include <argv.h>
#include <rpmtypes.h>
#include <rpmtag.h>
#include <pkgio.h>
#include <rpmdb.h>
#include <rpmds.h>
#include "manifest.h"
#include "misc.h"
#include <rpmgi.h>
#include <rpmcli.h>
#include <rpmrollback.h>
#include "debug.h"
Include dependency graph for rpmrollback.c:

Go to the source code of this file.

Defines

#define _RPMTE_INTERNAL
#define _RPMTS_INTERNAL
#define _RPMTS_PRINT
#define _RPMROLLBACK_INTERNAL

Functions

static int IDTintcmp (const void *a, const void *b)
IDTX IDTXfree (IDTX idtx)
IDTX IDTXnew (void)
IDTX IDTXgrow (IDTX idtx, int need)
IDTX IDTXsort (IDTX idtx)
IDTX IDTXload (rpmts ts, rpmTag tag, rpmuint32_t rbtid)
IDTX IDTXglob (rpmts ts, const char *globstr, rpmTag tag, rpmuint32_t rbtid)
static int cmpArgvStr (rpmts ts, const char *lname, const char **AV, int AC, const char *B)
 Search for string B in argv array AV.
static int findErases (rpmts ts, rpmte p, unsigned thistid, IDT ip, int niids)
 Find (and add to transaction set) all erase elements with matching blink.
int rpmRollback (rpmts ts, QVA_t ia, const char **argv)

Variables

static int reverse = -1

Detailed Description

Definition in file rpmrollback.c.


Define Documentation

#define _RPMROLLBACK_INTERNAL

Definition at line 27 of file rpmrollback.c.

#define _RPMTE_INTERNAL

Definition at line 21 of file rpmrollback.c.

#define _RPMTS_INTERNAL

Definition at line 22 of file rpmrollback.c.

#define _RPMTS_PRINT

Definition at line 23 of file rpmrollback.c.


Function Documentation

static int cmpArgvStr ( rpmts  ts,
const char *  lname,
const char **  AV,
int  AC,
const char *  B 
) [static]

Search for string B in argv array AV.

Parameters:
tstransaction set
lnametype of link
AVargv array
ACno. of args
Bstring
Returns:
1 if found, 0 not found, -1 error

Definition at line 247 of file rpmrollback.c.

References RPMPROB_NOREPACKAGE, rpmpsAppend(), rpmpsFree(), and rpmtsProblems().

Referenced by findErases().

static int findErases ( rpmts  ts,
rpmte  p,
unsigned  thistid,
IDT  ip,
int  niids 
) [static]

Find (and add to transaction set) all erase elements with matching blink.

In addition, recreate any added transaction element linkages.

XXX rp->h should have FLINK{HDRID,PKGID,NEVRA} populated. XXX ip->h should have BLINK{HDRID,PKGID,NEVRA} populated. XXX p = ts->teInstall is added transaction element from rp->h.

Parameters:
tstransaction set (ts->teInstall set to last added pkg)
pmost recently added install element (NULL skips linking)
thistidcurrent transaction id
ipcurrently installed package(s) to be erased
niidsno. of currently installed package(s)
Returns:
-1 on error, otherwise no. of erase elemnts added

< End of chain marker.

Definition at line 292 of file rpmrollback.c.

References _free(), alloca(), rpmDataType_u::argv, _HE_s::c, cmpArgvStr(), D_, headerGet(), _HE_s::p, rpmlog(), RPMLOG_DEBUG, RPMTE_CHAIN_END, rpmteChain(), rpmtsAddEraseElement(), and _HE_s::tag.

Referenced by rpmRollback().

static int IDTintcmp ( const void *  a,
const void *  b 
) [static]

Definition at line 43 of file rpmrollback.c.

References reverse.

Referenced by IDTXsort().

IDTX IDTXfree ( IDTX  idtx)

Definition at line 51 of file rpmrollback.c.

References _free(), and headerFree().

Referenced by rpmRollback(), rpmts_IDTXglob(), and rpmts_IDTXload().

IDTX IDTXglob ( rpmts  ts,
const char *  globstr,
rpmTag  tag,
rpmuint32_t  rbtid 
)
IDTX IDTXgrow ( IDTX  idtx,
int  need 
)

Definition at line 76 of file rpmrollback.c.

References IDTXnew(), and xrealloc().

Referenced by IDTXglob(), and IDTXload().

IDTX IDTXload ( rpmts  ts,
rpmTag  tag,
rpmuint32_t  rbtid 
)
IDTX IDTXnew ( void  )

Definition at line 68 of file rpmrollback.c.

References xcalloc().

Referenced by IDTXgrow().

IDTX IDTXsort ( IDTX  idtx)

Definition at line 93 of file rpmrollback.c.

References IDTintcmp().

Referenced by IDTXglob(), and IDTXload().

int rpmRollback ( rpmts  ts,
QVA_t  ia,
const char **  argv 
)

Variable Documentation

int reverse = -1 [static]

Definition at line 39 of file rpmrollback.c.

Referenced by IDTintcmp().