summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2001-11-10 01:39:50 +0000
committerjbj <devnull@localhost>2001-11-10 01:39:50 +0000
commit431499aecadbc9effe9559fb09ba9e77aca8865c (patch)
treec71f951d92e7561e1861346ebe403958336d1d0a /lib
parenteb1789dad7eec05197ba2a7f838d8587814d8526 (diff)
downloadlibrpm-tizen-431499aecadbc9effe9559fb09ba9e77aca8865c.tar.gz
librpm-tizen-431499aecadbc9effe9559fb09ba9e77aca8865c.tar.bz2
librpm-tizen-431499aecadbc9effe9559fb09ba9e77aca8865c.zip
- strip header tags for erased as well as installed transactionElements.
CVS patchset: 5167 CVS date: 2001/11/10 01:39:50
Diffstat (limited to 'lib')
-rw-r--r--lib/depends.c122
-rw-r--r--lib/depends.h4
-rw-r--r--lib/psm.h47
-rw-r--r--lib/rpmal.c2
-rw-r--r--lib/rpmal.h2
-rw-r--r--lib/rpmds.c11
-rw-r--r--lib/rpmds.h9
-rw-r--r--lib/rpminstall.c4
-rw-r--r--lib/rpmlib.h9
9 files changed, 144 insertions, 66 deletions
diff --git a/lib/depends.c b/lib/depends.c
index 87a5d5d99..29d7fd384 100644
--- a/lib/depends.c
+++ b/lib/depends.c
@@ -206,14 +206,16 @@ static int intcmp(const void * a, const void * b) /*@*/
/**
* Add removed package instance to ordered transaction set.
* @param ts transaction set
+ * @param h header
* @param dboffset rpm database instance
* @param depends installed package of pair (or RPMAL_NOMATCH on erase)
* @return 0 on success
*/
-static int removePackage(rpmTransactionSet ts, int dboffset,
+static int removePackage(rpmTransactionSet ts, Header h, int dboffset,
alKey depends)
- /*@modifies ts @*/
+ /*@modifies ts, h @*/
{
+ int scareMem = _DS_SCAREMEM;
transactionElement p;
/* Filter out duplicate erasures. */
@@ -242,13 +244,28 @@ static int removePackage(rpmTransactionSet ts, int dboffset,
}
p = ts->order + ts->orderCount;
+ ts->orderCount++;
+
memset(p, 0, sizeof(*p));
+
+ p->NEVR = hGetNEVR(h, NULL);
+ p->name = xstrdup(p->NEVR);
+ if ((p->release = strrchr(p->name, '-')) != NULL)
+ *p->release++ = '\0';
+ if ((p->version = strrchr(p->name, '-')) != NULL)
+ *p->version++ = '\0';
+
+ p->provides = dsNew(h, RPMTAG_PROVIDENAME, scareMem);
+ p->fns = fnsNew(h, RPMTAG_BASENAMES, scareMem);
+ p->requires = dsNew(h, RPMTAG_REQUIRENAME, scareMem);
+ p->conflicts = dsNew(h, RPMTAG_CONFLICTNAME, scareMem);
+ p->obsoletes = dsNew(h, RPMTAG_CONFLICTNAME, scareMem);
+
p->type = TR_REMOVED;
p->u.removed.dboffset = dboffset;
/*@-assignexpose -temptrans@*/
p->u.removed.dependsOnKey = depends;
/*@=assignexpose =temptrans@*/
- ts->orderCount++;
return 0;
}
@@ -276,11 +293,14 @@ int rpmtransAddPackage(rpmTransactionSet ts, Header h, FD_t fd,
int scareMem = _DS_SCAREMEM;
HGE_t hge = (HGE_t)headerGetEntryMinMemory;
const char * name = NULL;
- const char * addNVR = hGetNEVR(h, &name);
- const char * pkgNVR = NULL;
+ char * addNEVR = hGetNEVR(h, &name);
+ char * pkgNEVR = NULL;
+ int isSource;
int duplicate = 0;
transactionElement p;
rpmDepSet provides;
+ rpmDepSet requires;
+ rpmDepSet conflicts;
rpmDepSet obsoletes;
rpmFNSet fns;
alKey pkgKey; /* addedPackages key */
@@ -316,12 +336,12 @@ int rpmtransAddPackage(rpmTransactionSet ts, Header h, FD_t fd,
if (ph == NULL)
break;
- pkgNVR = _free(pkgNVR);
+ pkgNEVR = _free(pkgNEVR);
pname = NULL;
- pkgNVR = hGetNEVR(ph, &pname);
+ pkgNEVR = hGetNEVR(ph, &pname);
if (strcmp(pname, name)) {
- pkgNVR = _free(pkgNVR);
+ pkgNEVR = _free(pkgNEVR);
ph = headerFree(ph, "alGetHeader nomatch");
continue;
}
@@ -332,33 +352,41 @@ int rpmtransAddPackage(rpmTransactionSet ts, Header h, FD_t fd,
if (rc > 0) {
rpmMessage(RPMMESS_WARNING,
_("newer package %s already added, skipping %s\n"),
- pkgNVR, addNVR);
+ pkgNEVR, addNEVR);
goto exit;
} else if (rc == 0) {
rpmMessage(RPMMESS_WARNING,
_("package %s already added, ignoring\n"),
- pkgNVR);
+ pkgNEVR);
goto exit;
} else {
rpmMessage(RPMMESS_WARNING,
_("older package %s already added, replacing with %s\n"),
- pkgNVR, addNVR);
+ pkgNEVR, addNEVR);
duplicate = 1;
}
break;
}
+ isSource = headerIsEntry(h, RPMTAG_SOURCEPACKAGE);
+
/*@-branchstate@*/
if (duplicate) {
p = ts->order + i;
- provides = p->provides;
- fns = p->fns;
+ provides = rpmdsLink(p->provides, "xfer");
+ p->provides = rpmdsUnlink(p->provides, "xfer");
+ fns = rpmfnsLink(p->fns, "xfer");
+ p->fns = rpmfnsUnlink(p->fns, "xfer");
} else {
provides = dsNew(h, RPMTAG_PROVIDENAME, scareMem);
fns = fnsNew(h, RPMTAG_BASENAMES, scareMem);
}
/*@=branchstate@*/
+ requires = dsNew(h, RPMTAG_REQUIRENAME, scareMem);
+ conflicts = dsNew(h, RPMTAG_CONFLICTNAME, scareMem);
+ obsoletes = dsNew(h, RPMTAG_CONFLICTNAME, scareMem);
+
/* XXX cast assumes that available keys are indices, not pointers */
pkgKey = alAddPackage(ts->addedPackages, (alKey)apx, key, h, provides, fns);
if (pkgKey == RPMAL_NOMATCH) {
@@ -403,13 +431,37 @@ int rpmtransAddPackage(rpmTransactionSet ts, Header h, FD_t fd,
}
#endif
- p->provides = dsNew(h, RPMTAG_PROVIDENAME, scareMem);
- p->fns = fnsNew(h, RPMTAG_BASENAMES, scareMem);
- p->requires = dsNew(h, RPMTAG_REQUIRENAME, scareMem);
+ p->NEVR = xstrdup(addNEVR);
+ p->name = xstrdup(addNEVR);
+ if ((p->release = strrchr(p->name, '-')) != NULL)
+ *p->release++ = '\0';
+ if ((p->version = strrchr(p->name, '-')) != NULL)
+ *p->version++ = '\0';
+
+ p->provides = rpmdsUnlink(p->provides, "xfer");
+ p->provides = rpmdsLink(provides, "xfer");
+ provides = rpmdsUnlink(provides, "xfer");
+
+ p->requires = rpmdsUnlink(p->requires, "xfer");
+ p->requires = rpmdsLink(requires, "xfer");
+ requires = rpmdsUnlink(requires, "xfer");
+
+ p->conflicts = rpmdsUnlink(p->conflicts, "xfer");
+ p->conflicts = rpmdsLink(conflicts, "xfer");
+ conflicts = rpmdsUnlink(conflicts, "xfer");
+
+ p->obsoletes = rpmdsUnlink(p->obsoletes, "xfer");
+ p->obsoletes = rpmdsLink(obsoletes, "xfer");
+ obsoletes = rpmdsUnlink(obsoletes, "xfer");
+
+ p->fns = rpmfnsUnlink(p->fns, "xfer");
+ p->fns = rpmfnsLink(fns, "xfer");
+ fns = rpmfnsUnlink(fns, "xfer");
/*@-assignexpose -ownedtrans @*/
p->key = key;
/*@=assignexpose =ownedtrans @*/
+
/*@-type@*/ /* FIX: cast? */
p->fd = (fd != NULL ? fdLink(fd, "rpmtransAddPackage") : NULL);
/*@=type@*/
@@ -441,7 +493,7 @@ assert(apx == ts->numAddedPackages);
goto exit;
/* XXX binary rpms always have RPMTAG_SOURCERPM, source rpms do not */
- if (headerIsEntry(h, RPMTAG_SOURCEPACKAGE))
+ if (isSource)
goto exit;
/* Do lazy (readonly?) open of rpm database. */
@@ -453,11 +505,11 @@ assert(apx == ts->numAddedPackages);
{ rpmdbMatchIterator mi;
Header h2;
- mi = rpmtsInitIterator(ts, RPMTAG_NAME, name, 0);
+ mi = rpmtsInitIterator(ts, RPMTAG_NAME, p->name, 0);
while((h2 = rpmdbNextIterator(mi)) != NULL) {
/*@-branchstate@*/
if (rpmVersionCompare(h, h2))
- xx = removePackage(ts, rpmdbGetIteratorOffset(mi), pkgKey);
+ xx = removePackage(ts, h2, rpmdbGetIteratorOffset(mi), pkgKey);
else {
uint_32 *pp, multiLibMask = 0, oldmultiLibMask = 0;
@@ -476,7 +528,7 @@ assert(apx == ts->numAddedPackages);
mi = rpmdbFreeIterator(mi);
}
- obsoletes = dsiInit(dsNew(h, RPMTAG_OBSOLETENAME, scareMem));
+ obsoletes = dsiInit(rpmdsLink(p->obsoletes, "obsoletes"));
if (obsoletes != NULL)
while (dsiNext(obsoletes) >= 0) {
const char * Name;
@@ -485,7 +537,7 @@ assert(apx == ts->numAddedPackages);
continue; /* XXX can't happen */
/* XXX avoid self-obsoleting packages. */
- if (!strcmp(name, Name))
+ if (!strcmp(p->name, Name))
continue;
{ rpmdbMatchIterator mi;
@@ -504,21 +556,19 @@ assert(apx == ts->numAddedPackages);
/*@-branchstate@*/
if (dsiGetEVR(obsoletes) == NULL
|| headerMatchesDepFlags(h2, obsoletes))
- xx = removePackage(ts, rpmdbGetIteratorOffset(mi), pkgKey);
+ xx = removePackage(ts, h2, rpmdbGetIteratorOffset(mi), pkgKey);
/*@=branchstate@*/
}
mi = rpmdbFreeIterator(mi);
}
}
- /*@=nullstate@*/ /* FIX: obsoletes->EVR may be NULL */
obsoletes = dsFree(obsoletes);
- /*@=nullstate@*/
ec = 0;
exit:
- pkgNVR = _free(pkgNVR);
- addNVR = _free(addNVR);
+ pkgNEVR = _free(pkgNEVR);
+ addNEVR = _free(addNEVR);
return ec;
}
@@ -531,11 +581,13 @@ void rpmtransAvailablePackage(rpmTransactionSet ts, Header h, fnpyKey key)
/* XXX FIXME: return code RPMAL_NOMATCH is error */
(void) alAddPackage(ts->availablePackages, RPMAL_NOMATCH, key, h,
provides, fns);
+ fns = fnsFree(fns);
+ provides = dsFree(provides);
}
-int rpmtransRemovePackage(rpmTransactionSet ts, int dboffset)
+int rpmtransRemovePackage(rpmTransactionSet ts, Header h, int dboffset)
{
- return removePackage(ts, dboffset, RPMAL_NOMATCH);
+ return removePackage(ts, h, dboffset, RPMAL_NOMATCH);
}
/*@-nullstate@*/ /* FIX: better annotations */
@@ -562,7 +614,7 @@ rpmTransactionSet rpmtransFree(rpmTransactionSet ts)
return NULL;
pi = teInitIterator(ts);
- while ((p = teNext(pi, TR_ADDED)) != NULL) {
+ while ((p = teNextIterator(pi)) != NULL) {
rpmRelocation * r;
if (p->relocs) {
for (r = p->relocs; (r->oldPath || r->newPath); r++) {
@@ -571,14 +623,20 @@ rpmTransactionSet rpmtransFree(rpmTransactionSet ts)
}
p->relocs = _free(p->relocs);
}
+
p->provides = dsFree(p->provides);
p->requires = dsFree(p->requires);
+ p->conflicts = dsFree(p->conflicts);
+ p->obsoletes = dsFree(p->obsoletes);
p->fns = fnsFree(p->fns);
/*@-type@*/ /* FIX: cast? */
if (p->fd != NULL)
p->fd = fdFree(p->fd, "alAddPackage (rpmtransFree)");
/*@=type@*/
+
+ p->NEVR = _free(p->NEVR);
+ p->name = _free(p->name);
}
pi = teFreeIterator(pi);
@@ -1347,10 +1405,10 @@ fprintf(stderr, "*** rpmdepOrder(%p) order %p[%d]\n", ts, ts->order, ts->orderCo
p->tsi = xcalloc(1, sizeof(*p->tsi));
+#ifdef DYING
/* Retrieve info from addedPackages. */
p->NEVR = alGetNVR(ts->addedPackages, p->u.addedKey);
p->name = alGetNVR(ts->addedPackages, p->u.addedKey);
-/*@-nullpass@*/
if ((p->release = strrchr(p->name, '-')) != NULL)
*p->release++ = '\0';
if ((p->version = strrchr(p->name, '-')) != NULL)
@@ -1358,7 +1416,7 @@ fprintf(stderr, "*** rpmdepOrder(%p) order %p[%d]\n", ts, ts->order, ts->orderCo
/*@-modfilesystem@*/
prtTSI(p->NEVR, p->tsi);
/*@=modfilesystem@*/
-/*@=nullpass@*/
+#endif
}
pi = teFreeIterator(pi);
@@ -1636,8 +1694,10 @@ prtTSI(" p", p->tsi);
tsi = _free(tsi);
}
p->tsi = _free(p->tsi);
+#ifdef DYING
p->NEVR = _free(p->NEVR);
p->name = _free(p->name);
+#endif
/* Prepare added package ordering permutation. */
orderList[j].pkgKey = p->u.addedKey;
diff --git a/lib/depends.h b/lib/depends.h
index d4b4c6c1a..7e0c7d4fe 100644
--- a/lib/depends.h
+++ b/lib/depends.h
@@ -90,6 +90,10 @@ struct transactionElement_s {
/*@refcounted@*/ /*@null@*/
rpmDepSet requires; /*!< Requires: dependencies. */
/*@refcounted@*/ /*@null@*/
+ rpmDepSet conflicts; /*!< Conflicts: dependencies. */
+/*@refcounted@*/ /*@null@*/
+ rpmDepSet obsoletes; /*!< Obsoletes: dependencies. */
+/*@refcounted@*/ /*@null@*/
rpmFNSet fns; /*!< File info set. */
uint_32 multiLib; /* (TR_ADDED) MULTILIB */
diff --git a/lib/psm.h b/lib/psm.h
index f5ad3ff19..85f9e596b 100644
--- a/lib/psm.h
+++ b/lib/psm.h
@@ -32,23 +32,6 @@ struct transactionFileInfo_s {
/*@owned@*/ const char * version; /*!< Version: tag (malloc'd). */
/*@owned@*/ const char * release; /*!< Release: tag (malloc'd). */
-#ifdef NOTYET
-/*@owned@*/ const char ** provides; /*!< Provides: name strings. */
-/*@owned@*/ const char ** providesEVR; /*!< Provides: [epoch:]version[-release] strings. */
-/*@dependent@*/ int * provideFlags; /*!< Provides: logical range qualifiers. */
-/*@owned@*//*@null@*/ const char ** requires; /*!< Requires: name strings. */
-/*@owned@*//*@null@*/ const char ** requiresEVR;/*!< Requires: [epoch:]version[-release] strings. */
-/*@dependent@*//*@null@*/ int * requireFlags; /*!< Requires: logical range qualifiers. */
-/*@owned@*//*@null@*/ const char ** baseNames; /*!< Header file basenames. */
-/*@dependent@*//*@null@*/ int_32 * epoch; /*!< Header epoch (if any). */
- int providesCount; /*!< No. of Provide:'s in header. */
- int requiresCount; /*!< No. of Require:'s in header. */
- int filesCount; /*!< No. of files in header. */
- int npreds; /*!< No. of predecessors. */
- int depth; /*!< Max. depth in dependency tree. */
- struct tsortInfo_s tsi; /*!< Dependency tsort data. */
-#endif
-
uint_32 multiLib; /* MULTILIB */
/*@null@*/
fnpyKey key; /*!< Package notify key. */
@@ -71,26 +54,33 @@ struct transactionFileInfo_s {
HFD_t hfd; /*!< Vector to headerFreeData() */
int_32 epoch;
uint_32 flags; /*!< File flag default. */
- const uint_32 * fflags; /*!< File flag(s) (from header) */
- const uint_32 * fsizes; /*!< File size(s) (from header) */
- const uint_32 * fmtimes; /*!< File modification time(s) (from header) */
+
/*@owned@*/ const char ** bnl; /*!< Base name(s) (from header) */
/*@owned@*/ const char ** dnl; /*!< Directory name(s) (from header) */
- int_32 * dil; /*!< Directory indice(s) (from header) */
-/*@owned@*/ const char ** obnl; /*!< Original base name(s) (from header) */
-/*@owned@*/ const char ** odnl; /*!< Original directory name(s) (from header) */
-/*@unused@*/ int_32 * odil; /*!< Original directory indice(s) (from header) */
/*@owned@*/ const char ** fmd5s;/*!< File MD5 sum(s) (from header) */
/*@owned@*/ const char ** flinks; /*!< File link(s) (from header) */
+/*@owned@*/ const char ** flangs; /*!< File lang(s) */
+ int_32 * dil; /*!< Directory indice(s) (from header) */
+ const uint_32 * fflags; /*!< File flag(s) (from header) */
+ const uint_32 * fsizes; /*!< File size(s) (from header) */
+ const uint_32 * fmtimes; /*!< File modification time(s) (from header) */
/* XXX setuid/setgid bits are turned off if fuser/fgroup doesn't map. */
uint_16 * fmodes; /*!< File mode(s) (from header) */
uint_16 * frdevs; /*!< File rdev(s) (from header) */
-/*@only@*/ /*@null@*/ char * fstates; /*!< File state(s) (from header) */
+
/*@owned@*/ const char ** fuser; /*!< File owner(s) */
/*@owned@*/ const char ** fgroup; /*!< File group(s) */
-/*@owned@*/ const char ** flangs; /*!< File lang(s) */
+/*@owned@*/ /*@null@*/ uid_t * fuids; /*!< File uid(s) */
+/*@owned@*/ /*@null@*/ gid_t * fgids; /*!< File gid(s) */
+
+/*@only@*/ /*@null@*/ char * fstates; /*!< File state(s) (from header) */
+
int fc; /*!< No. of files. */
int dc; /*!< No. of directories. */
+
+/*@owned@*/ const char ** obnl; /*!< Original base name(s) (from header) */
+/*@owned@*/ const char ** odnl; /*!< Original directory name(s) (from header) */
+/*@unused@*/ int_32 * odil; /*!< Original directory indice(s) (from header) */
int bnlmax; /*!< Length (in bytes) of longest base name. */
int dnlmax; /*!< Length (in bytes) of longest dir name. */
int astriplen;
@@ -102,21 +92,20 @@ struct transactionFileInfo_s {
int mapflags;
/*@owned@*/ /*@null@*/ int * fmapflags;
uid_t uid;
-/*@owned@*/ /*@null@*/ uid_t * fuids; /*!< File uid(s) */
gid_t gid;
-/*@owned@*/ /*@null@*/ gid_t * fgids; /*!< File gid(s) */
int magic;
#define TFIMAGIC 0x09697923
/*@owned@*/ FSM_t fsm; /*!< File state machine data. */
int keep_header; /*!< Keep header? */
-/*@refs@*/ int nrefs; /*!< Reference count. */
/*@owned@*/ struct sharedFileInfo * replaced; /*!< (TR_ADDED) */
/*@owned@*/ uint_32 * replacedSizes; /*!< (TR_ADDED) */
unsigned int record; /*!< (TR_REMOVED) */
+
+/*@refs@*/ int nrefs; /*!< Reference count. */
};
/**
diff --git a/lib/rpmal.c b/lib/rpmal.c
index 3bb558479..0bd8a62f0 100644
--- a/lib/rpmal.c
+++ b/lib/rpmal.c
@@ -197,6 +197,7 @@ Header alGetHeader(availableList al, alKey pkgKey, int unlink)
return h;
}
+#ifdef DYING
char * alGetNVR(const availableList al, alKey pkgKey)
{
availablePackage alp = alGetPkg(al, pkgKey);
@@ -216,6 +217,7 @@ char * alGetNVR(const availableList al, alKey pkgKey)
}
return pkgNVR;
}
+#endif
availableList alCreate(int delta)
{
diff --git a/lib/rpmal.h b/lib/rpmal.h
index 183042780..df790c274 100644
--- a/lib/rpmal.h
+++ b/lib/rpmal.h
@@ -42,6 +42,7 @@ availablePackage alGetPkg(/*@null@*/ availableList al, /*@null@*/ alKey pkgKey)
/*@*/;
/*@=exportlocal@*/
+#ifdef DYING
/**
* Return (malloc'd) available package name-version-release string.
* @param al available list
@@ -51,6 +52,7 @@ availablePackage alGetPkg(/*@null@*/ availableList al, /*@null@*/ alKey pkgKey)
/*@only@*/ /*@null@*/
char * alGetNVR(/*@null@*/const availableList al, /*@null@*/ alKey pkgKey)
/*@*/;
+#endif
/**
* Initialize available packckages, items, and directory list.
diff --git a/lib/rpmds.c b/lib/rpmds.c
index db42fba42..dcdd96032 100644
--- a/lib/rpmds.c
+++ b/lib/rpmds.c
@@ -80,6 +80,11 @@ fprintf(stderr, "*** fns %p -- %s[%d]\n", fns, fns->Type, fns->fc);
fns->flangs = hfd(fns->flangs, -1);
fns->fmd5s = hfd(fns->fmd5s, -1);
+ fns->fuser = hfd(fns->fuser, -1);
+ fns->fuids = _free(fns->fuids);
+ fns->fgroup = hfd(fns->fgroup, -1);
+ fns->fgids = _free(fns->fgids);
+
fns->fstates = _free(fns->fstates);
/*@-evalorder@*/
@@ -152,8 +157,14 @@ rpmFNSet fnsNew(Header h, rpmTag tagN, int scareMem)
xx = hge(h, RPMTAG_FILERDEVS, NULL, (void **) &fns->frdevs, NULL);
xx = hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &fns->dil, NULL);
+ xx = hge(h, RPMTAG_FILEUSERNAME, NULL, (void **) &fns->fuser, NULL);
+ fns->fuids = NULL;
+ xx = hge(h, RPMTAG_FILEGROUPNAME, NULL, (void **) &fns->fgroup, NULL);
+ fns->fgids = NULL;
+
xx = hge(h, RPMTAG_FILESTATES, NULL, (void **) &fns->fstates, NULL);
_fdupe(fns, fstates);
+
if (xx == 0 || fns->fstates == NULL)
fns->fstates = xcalloc(fns->fc, sizeof(*fns->fstates));
diff --git a/lib/rpmds.h b/lib/rpmds.h
index 7fd4f1086..1ca9aa1f2 100644
--- a/lib/rpmds.h
+++ b/lib/rpmds.h
@@ -45,6 +45,15 @@ struct rpmFNSet_s {
const uint_16 * frdevs; /*!< File rdev(s) (from header) */
/*@only@*/ /*@null@*/
+ const char ** fuser; /*!< File owner(s) */
+/*@only@*/ /*@null@*/
+ const char ** fgroup; /*!< File group(s) */
+/*@only@*/ /*@null@*/
+ uid_t * fuids; /*!< File uid(s) */
+/*@only@*/ /*@null@*/
+ gid_t * fgids; /*!< File gid(s) */
+
+/*@only@*/ /*@null@*/
char * fstates; /*!< File state(s) (from header) */
int_32 dc; /*!< No. of directories. */
diff --git a/lib/rpminstall.c b/lib/rpminstall.c
index 5887c9887..9bd844bec 100644
--- a/lib/rpminstall.c
+++ b/lib/rpminstall.c
@@ -636,7 +636,7 @@ int rpmErase(rpmTransactionSet ts, const char ** argv,
while ((h = rpmdbNextIterator(mi)) != NULL) {
unsigned int recOffset = rpmdbGetIteratorOffset(mi);
if (recOffset) {
- (void) rpmtransRemovePackage(ts, recOffset);
+ (void) rpmtransRemovePackage(ts, h, recOffset);
numPackages++;
}
}
@@ -799,7 +799,7 @@ IDTX IDTXload(rpmTransactionSet ts, rpmTag tag)
/*@-nullderef@*/
idt = idtx->idt + idtx->nidt;
/*@=nullderef@*/
- idt->h = NULL;
+ idt->h = headerLink(h, "IDTXload idt->h");
idt->key = NULL;
idt->instance = rpmdbGetIteratorOffset(mi);
idt->val.i32 = *tidp;
diff --git a/lib/rpmlib.h b/lib/rpmlib.h
index b2c83095d..8cb5d5196 100644
--- a/lib/rpmlib.h
+++ b/lib/rpmlib.h
@@ -1410,7 +1410,7 @@ rpmdbMatchIterator rpmtsInitIterator(const rpmTransactionSet ts, int rpmtag,
/*@modifies db @*/;
/** \ingroup rpmtrans
- * Add package to be installed to unordered transaction set.
+ * Add package to be installed to transaction set.
*
* If fd is NULL, the callback specified in rpmtransCreateSet() is used to
* open and close the file descriptor. If Header is NULL, the fd is always
@@ -1444,13 +1444,14 @@ void rpmtransAvailablePackage(rpmTransactionSet ts, Header h,
/*@modifies h, ts @*/;
/** \ingroup rpmtrans
- * Add package to be removed to unordered transaction set.
+ * Add package to be erased to transaction set.
* @param ts transaction set
+ * @param h header
* @param dboffset rpm database instance
* @return 0 on success
*/
-int rpmtransRemovePackage(rpmTransactionSet ts, int dboffset)
- /*@modifies ts @*/;
+int rpmtransRemovePackage(rpmTransactionSet ts, Header h, int dboffset)
+ /*@modifies ts, h @*/;
/** \ingroup rpmtrans
* Re-create an empty transaction set.