Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

lib/rpmrollback.c File Reference

#include "system.h"
#include <rpmcli.h>
#include "rpmdb.h"
#include "rpmds.h"
#include "rpmte.h"
#include "rpmts.h"
#include "manifest.h"
#include "misc.h"
#include "rpmgi.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

Functions

static int IDTintcmp (const void *a, const void *b)
IDTX IDTXfree (IDTX idtx)
 Destroy id index.
IDTX IDTXnew (void)
 Create id index.
IDTX IDTXgrow (IDTX idtx, int need)
 Insure that index has room for "need" elements.
IDTX IDTXsort (IDTX idtx)
 Sort tag (instance,value) pairs.
IDTX IDTXload (rpmts ts, rpmTag tag, uint_32 rbtid)
 Load tag (instance,value) pairs from rpm databse, and return sorted id index.
IDTX IDTXglob (rpmts ts, const char *globstr, rpmTag tag, uint_32 rbtid)
 Load tag (instance,value) pairs from packages, and return sorted id index.
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.
static int rpmrbProblems (rpmts ts, const char *msg, int rc)
int rpmrbCheck (rpmts ts)
int rpmrbOrder (rpmts ts)
int rpmrbRun (rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
int rpmRollback (rpmts ts, QVA_t ia, const char **argv)
 Rollback transactions, erasing new, reinstalling old, package(s).

Variables

static int reverse = -1


Detailed Description

Definition in file rpmrollback.c.


Define Documentation

#define _RPMTE_INTERNAL
 

Definition at line 12 of file rpmrollback.c.

#define _RPMTS_INTERNAL
 

Definition at line 14 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:
ts transaction set
lname type of link
AV argv array
AC no. of args
B string
Returns:
1 if found, 0 not found, -1 error

Definition at line 234 of file rpmrollback.c.

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

Referenced by findErases(), and markLinkedFailed().

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:
ts transaction set (ts->teInstall set to last added pkg)
p most recently added install element (NULL skips linking)
thistid current transaction id
ip currently installed package(s) to be erased
niids no. of currently installed package(s)
Returns:
-1 on error, otherwise no. of erase elemnts added
< End of chain marker.

Definition at line 279 of file rpmrollback.c.

References cmpArgvStr(), IDT_s::done, IDT_s::h, headerFreeData(), headerGetEntryMinMemory(), IDT_s::instance, RPMMESS_DEBUG, rpmMessage, RPMTAG_BLINKHDRID, RPMTAG_BLINKNEVRA, RPMTAG_BLINKPKGID, RPMTE_CHAIN_END, rpmteChain(), rpmtsAddEraseElement(), and IDT_s::val.

Referenced by rpmRollback().

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

Definition at line 32 of file rpmrollback.c.

References reverse.

Referenced by IDTXsort().

IDTX IDTXfree IDTX  idtx  ) 
 

Destroy id index.

Parameters:
idtx id index
Returns:
NULL always

Definition at line 40 of file rpmrollback.c.

References _free(), IDT_s::h, headerFree(), IDTindex_s::idt, and IDT_s::key.

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

IDTX IDTXglob rpmts  ts,
const char *  globstr,
rpmTag  tag,
uint_32  rbtid
 

Load tag (instance,value) pairs from packages, and return sorted id index.

Parameters:
ts transaction set
globstr glob expression
tag rpm tag
rbtid rollback goal
Returns:
id index

Definition at line 138 of file rpmrollback.c.

References _, _free(), IDT_s::done, Fclose(), Ferror(), Fopen(), Fstrerror(), IDT_s::h, headerFree(), headerGetEntry(), headerGetOrigin(), headerIsEntry(), headerLink(), IDTindex_s::idt, IDTXgrow(), IDTXsort(), IDT_s::instance, IDT_s::key, IDTindex_s::nidt, RPMERR_OPEN, rpmError, rpmgiEscapeSpaces(), rpmGlob(), RPMRC_NOKEY, RPMRC_NOTTRUSTED, RPMRC_OK, rpmReadPackageFile(), RPMTAG_SOURCERPM, and IDT_s::val.

Referenced by rpmRollback(), and rpmts_IDTXglob().

IDTX IDTXgrow IDTX  idtx,
int  need
 

Insure that index has room for "need" elements.

Parameters:
idtx id index
need additional no. of elements needed
Returns:
id index (with room for "need" elements)

Definition at line 64 of file rpmrollback.c.

References IDTindex_s::alloced, IDTindex_s::delta, IDTindex_s::idt, IDTXnew(), IDTindex_s::nidt, IDTindex_s::size, and xrealloc().

Referenced by IDTXglob(), and IDTXload().

IDTX IDTXload rpmts  ts,
rpmTag  tag,
uint_32  rbtid
 

Load tag (instance,value) pairs from rpm databse, and return sorted id index.

Parameters:
ts transaction set
tag rpm tag
rbtid rollback goal
Returns:
id index

Definition at line 88 of file rpmrollback.c.

References IDT_s::done, IDT_s::h, headerGetEntry(), headerLink(), IDTindex_s::idt, IDTXgrow(), IDTXsort(), IDT_s::instance, IDT_s::key, IDTindex_s::nidt, RPM_INT32_TYPE, RPM_NULL_TYPE, rpmdbFreeIterator(), rpmdbGetIteratorOffset(), rpmdbNextIterator(), rpmdbSetIteratorRE(), RPMTAG_NAME, rpmtsInitIterator(), and IDT_s::val.

Referenced by rpmRollback(), and rpmts_IDTXload().

IDTX IDTXnew void   ) 
 

Create id index.

Returns:
new id index

Definition at line 56 of file rpmrollback.c.

References xcalloc().

Referenced by IDTXgrow().

IDTX IDTXsort IDTX  idtx  ) 
 

Sort tag (instance,value) pairs.

Parameters:
idtx id index
Returns:
id index

Definition at line 81 of file rpmrollback.c.

References IDTindex_s::idt, IDTintcmp(), IDTindex_s::nidt, and IDTindex_s::size.

Referenced by IDTXglob(), and IDTXload().

int rpmrbCheck rpmts  ts  ) 
 

Definition at line 387 of file rpmrollback.c.

References N_, rpmrbProblems(), and rpmtsCheck().

Referenced by main().

int rpmrbOrder rpmts  ts  ) 
 

Definition at line 392 of file rpmrollback.c.

References N_, rpmrbProblems(), and rpmtsOrder().

Referenced by main().

static int rpmrbProblems rpmts  ts,
const char *  msg,
int  rc
[static]
 

Definition at line 374 of file rpmrollback.c.

References RPMMESS_ERROR, rpmMessage, rpmpsFree(), rpmpsNumProblems(), rpmpsPrint(), and rpmtsProblems().

Referenced by rpmrbCheck(), rpmrbOrder(), rpmrbRun(), and rpmRollback().

int rpmrbRun rpmts  ts,
rpmps  okProbs,
rpmprobFilterFlags  ignoreSet
 

Definition at line 397 of file rpmrollback.c.

References N_, rpmrbProblems(), and rpmtsRun().

Referenced by main().


Variable Documentation

int reverse = -1 [static]
 

Definition at line 28 of file rpmrollback.c.


Generated on Mon Aug 23 10:33:30 2010 for rpm by  doxygen 1.4.4