#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 |
Definition in file rpmrollback.c.
#define _RPMTE_INTERNAL |
Definition at line 12 of file rpmrollback.c.
#define _RPMTS_INTERNAL |
Definition at line 14 of file rpmrollback.c.
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.
ts | transaction set | |
lname | type of link | |
AV | argv array | |
AC | no. of args | |
B | string |
Definition at line 234 of file rpmrollback.c.
References RPMPROB_NOREPACKAGE, rpmpsAppend(), rpmpsFree(), and rpmtsProblems().
Referenced by findErases(), and markLinkedFailed().
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.
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) |
< 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(), IDT_s::u32, and IDT_s::val.
Referenced by rpmRollback().
static int IDTintcmp | ( | const void * | a, | |
const void * | b | |||
) | [static] |
Destroy id index.
idtx | id index |
Definition at line 40 of file rpmrollback.c.
References _free(), IDT_s::h, headerFree(), IDTindex_s::idt, and IDTindex_s::nidt.
Referenced by rpmRollback(), rpmts_IDTXglob(), and rpmts_IDTXload().
Load tag (instance,value) pairs from packages, and return sorted id index.
ts | transaction set | |
globstr | glob expression | |
tag | rpm tag | |
rbtid | rollback goal |
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, IDT_s::u32, and IDT_s::val.
Referenced by rpmRollback(), and rpmts_IDTXglob().
Insure that index has room for "need" elements.
idtx | id index | |
need | additional no. of elements needed |
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().
Load tag (instance,value) pairs from rpm databse, and return sorted id index.
ts | transaction set | |
tag | rpm tag | |
rbtid | rollback goal |
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(), IDT_s::u32, and IDT_s::val.
Referenced by rpmRollback(), and rpmts_IDTXload().
IDTX IDTXnew | ( | void | ) |
Create id index.
Definition at line 56 of file rpmrollback.c.
References xcalloc().
Referenced by IDTXgrow().
Sort tag (instance,value) pairs.
idtx | 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().
int reverse = -1 [static] |
Definition at line 28 of file rpmrollback.c.