#include "system.h"
#include <rpmio.h>
#include <rpmcli.h>
#include "rpmdb.h"
#include "rpmds.h"
#include "manifest.h"
#include "misc.h"
#include "rpmgi.h"
#include "debug.h"
Go to the source code of this file.
Defines | |
#define | _RPMTE_INTERNAL |
#define | _RPMTS_INTERNAL |
#define | _RPMTS_PRINT |
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, uint32_t rbtid) |
Load tag (instance,value) pairs from rpm databse, and return sorted id index. | |
IDTX | IDTXglob (rpmts ts, const char *globstr, rpmTag tag, uint32_t 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. | |
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 8 of file rpmrollback.c.
#define _RPMTS_INTERNAL |
Definition at line 9 of file rpmrollback.c.
#define _RPMTS_PRINT |
Definition at line 10 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().
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) |
Definition at line 279 of file rpmrollback.c.
References _free(), alloca(), rpmDataType_u::argv, _HE_s::c, cmpArgvStr(), D_, IDT_s::done, IDT_s::h, headerGet(), IDT_s::instance, _HE_s::p, rpmlog(), RPMLOG_DEBUG, RPMTE_CHAIN_END, rpmteChain(), rpmtsAddEraseElement(), _HE_s::tag, 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, IDT_s::key, 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 137 of file rpmrollback.c.
References _, _free(), alloca(), IDT_s::done, Fclose(), Ferror(), Fopen(), Fstrerror(), IDT_s::h, headerFree(), headerGet(), headerGetOrigin(), headerIsEntry(), headerLink(), IDTindex_s::idt, IDTXgrow(), IDTXsort(), IDT_s::instance, IDT_s::key, IDTindex_s::nidt, _HE_s::p, rpmDataType_u::ptr, rpmgiEscapeSpaces(), rpmGlob(), rpmlog(), RPMLOG_ERR, RPMRC_NOKEY, RPMRC_NOTTRUSTED, RPMRC_OK, rpmReadPackageFile(), _HE_s::tag, IDT_s::u32, rpmDataType_u::ui32p, 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 _free(), alloca(), IDT_s::done, IDT_s::h, headerGet(), headerLink(), IDTindex_s::idt, IDTXgrow(), IDTXsort(), IDT_s::instance, IDT_s::key, IDTindex_s::nidt, _HE_s::p, rpmDataType_u::ptr, rpmdbFreeIterator(), rpmdbGetIteratorOffset(), rpmdbNextIterator(), rpmdbSetIteratorRE(), rpmtsInitIterator(), _HE_s::tag, IDT_s::u32, rpmDataType_u::ui32p, 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 IDTindex_s::delta, IDTindex_s::size, and 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 reverse = -1 [static] |
Definition at line 28 of file rpmrollback.c.