merge.
This commit is contained in:
commit
c36d94ded4
|
@ -7,7 +7,6 @@
|
||||||
#include "rpmfc.h"
|
#include "rpmfc.h"
|
||||||
#include "rpmerr.h"
|
#include "rpmerr.h"
|
||||||
|
|
||||||
#define _RPMDS_INTERNAL
|
|
||||||
#include "rpmds.h"
|
#include "rpmds.h"
|
||||||
#include "rpmfi.h"
|
#include "rpmfi.h"
|
||||||
|
|
||||||
|
@ -1661,34 +1660,70 @@ assert(ac == c);
|
||||||
|
|
||||||
/* Add Provides: */
|
/* Add Provides: */
|
||||||
if (fc->provides != NULL && (c = rpmdsCount(fc->provides)) > 0 && !fc->skipProv) {
|
if (fc->provides != NULL && (c = rpmdsCount(fc->provides)) > 0 && !fc->skipProv) {
|
||||||
p = (const void **) fc->provides->N;
|
const char **names = xcalloc(c, sizeof(char *));
|
||||||
xx = headerAddEntry(pkg->header, RPMTAG_PROVIDENAME, RPM_STRING_ARRAY_TYPE,
|
const char **evrs = xcalloc(c, sizeof(char *));
|
||||||
p, c);
|
const char **flags = xcalloc(c, sizeof(int_32 *));
|
||||||
/* XXX rpm prior to 3.0.2 did not always supply EVR and Flags. */
|
int i;
|
||||||
p = (const void **) fc->provides->EVR;
|
rpmds pi = rpmdsInit(fc->provides);
|
||||||
assert(p != NULL);
|
while ((i = rpmdsNext(pi)) >= 0) {
|
||||||
xx = headerAddEntry(pkg->header, RPMTAG_PROVIDEVERSION, RPM_STRING_ARRAY_TYPE,
|
names[i] = rpmdsN(pi);
|
||||||
p, c);
|
evrs[i] = rpmdsEVR(pi);
|
||||||
p = (const void **) fc->provides->Flags;
|
flags[i] = rpmdsFlags(pi);
|
||||||
assert(p != NULL);
|
}
|
||||||
xx = headerAddEntry(pkg->header, RPMTAG_PROVIDEFLAGS, RPM_INT32_TYPE,
|
|
||||||
p, c);
|
assert(names != NULL);
|
||||||
|
xx = headerAddEntry(pkg->header,
|
||||||
|
RPMTAG_PROVIDENAME,
|
||||||
|
RPM_STRING_ARRAY_TYPE,
|
||||||
|
names, c);
|
||||||
|
/* XXX rpm prior to 3.0.2 did not always supply EVR and Flags. */
|
||||||
|
assert(evrs != NULL);
|
||||||
|
xx = headerAddEntry(pkg->header,
|
||||||
|
RPMTAG_PROVIDEVERSION,
|
||||||
|
RPM_STRING_ARRAY_TYPE,
|
||||||
|
evrs, c);
|
||||||
|
assert(flags != NULL);
|
||||||
|
xx = headerAddEntry(pkg->header,
|
||||||
|
RPMTAG_PROVIDEFLAGS,
|
||||||
|
RPM_INT32_TYPE,
|
||||||
|
flags, c);
|
||||||
|
free(names);
|
||||||
|
free(evrs);
|
||||||
|
free(flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add Requires: */
|
/* Add Requires: */
|
||||||
if (fc->requires != NULL && (c = rpmdsCount(fc->requires)) > 0 && !fc->skipReq) {
|
if (fc->requires != NULL && (c = rpmdsCount(fc->requires)) > 0 && !fc->skipReq) {
|
||||||
p = (const void **) fc->requires->N;
|
const char **names = xcalloc(c, sizeof(char *));
|
||||||
xx = headerAddEntry(pkg->header, RPMTAG_REQUIRENAME, RPM_STRING_ARRAY_TYPE,
|
const char **evrs = xcalloc(c, sizeof(char *));
|
||||||
p, c);
|
const char **flags = xcalloc(c, sizeof(int_32 *));
|
||||||
/* XXX rpm prior to 3.0.2 did not always supply EVR and Flags. */
|
int i;
|
||||||
p = (const void **) fc->requires->EVR;
|
rpmds ri = rpmdsInit(fc->requires);
|
||||||
assert(p != NULL);
|
while ((i = rpmdsNext(ri)) >= 0) {
|
||||||
xx = headerAddEntry(pkg->header, RPMTAG_REQUIREVERSION, RPM_STRING_ARRAY_TYPE,
|
names[i] = rpmdsN(ri);
|
||||||
p, c);
|
evrs[i] = rpmdsEVR(ri);
|
||||||
p = (const void **) fc->requires->Flags;
|
flags[i] = rpmdsFlags(ri);
|
||||||
assert(p != NULL);
|
}
|
||||||
xx = headerAddEntry(pkg->header, RPMTAG_REQUIREFLAGS, RPM_INT32_TYPE,
|
|
||||||
p, c);
|
assert(names != NULL);
|
||||||
|
xx = headerAddEntry(pkg->header,
|
||||||
|
RPMTAG_REQUIRENAME,
|
||||||
|
RPM_STRING_ARRAY_TYPE,
|
||||||
|
names, c);
|
||||||
|
/* XXX rpm prior to 3.0.2 did not always supply EVR and Flags. */
|
||||||
|
assert(evrs != NULL);
|
||||||
|
xx = headerAddEntry(pkg->header,
|
||||||
|
RPMTAG_REQUIREVERSION,
|
||||||
|
RPM_STRING_ARRAY_TYPE,
|
||||||
|
evrs, c);
|
||||||
|
assert(flags != NULL);
|
||||||
|
xx = headerAddEntry(pkg->header,
|
||||||
|
RPMTAG_REQUIREFLAGS,
|
||||||
|
RPM_INT32_TYPE,
|
||||||
|
flags, c);
|
||||||
|
free(names);
|
||||||
|
free(evrs);
|
||||||
|
free(flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add dependency dictionary(#dependencies) */
|
/* Add dependency dictionary(#dependencies) */
|
||||||
|
|
23
lib/rpmds.c
23
lib/rpmds.c
|
@ -5,7 +5,6 @@
|
||||||
|
|
||||||
#include "rpmlib.h"
|
#include "rpmlib.h"
|
||||||
|
|
||||||
#define _RPMDS_INTERNAL
|
|
||||||
#include "rpmds.h"
|
#include "rpmds.h"
|
||||||
|
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
@ -21,6 +20,28 @@ int _rpmds_nopromote = 1;
|
||||||
|
|
||||||
int _rpmds_unspecified_epoch_noise = 0;
|
int _rpmds_unspecified_epoch_noise = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A package dependency set.
|
||||||
|
*/
|
||||||
|
struct rpmds_s {
|
||||||
|
const char * Type; /*!< Tag name. */
|
||||||
|
const char * DNEVR; /*!< Formatted dependency string. */
|
||||||
|
Header h; /*!< Header for dependency set (or NULL) */
|
||||||
|
const char ** N; /*!< Name. */
|
||||||
|
const char ** EVR; /*!< Epoch-Version-Release. */
|
||||||
|
int32_t * Flags; /*!< Bit(s) identifying context/comparison. */
|
||||||
|
uint32_t * Color; /*!< Bit(s) calculated from file color(s). */
|
||||||
|
int32_t * Refs; /*!< No. of file refs. */
|
||||||
|
int32_t BT; /*!< Package build time tie breaker. */
|
||||||
|
rpmTag tagN; /*!< Header tag. */
|
||||||
|
rpmTagType Nt, EVRt, Ft; /*!< Tag data types. */
|
||||||
|
int32_t Count; /*!< No. of elements */
|
||||||
|
int i; /*!< Element index. */
|
||||||
|
unsigned l; /*!< Low element (bsearch). */
|
||||||
|
unsigned u; /*!< High element (bsearch). */
|
||||||
|
int nopromote; /*!< Don't promote Epoch: in rpmdsCompare()? */
|
||||||
|
int nrefs; /*!< Reference count. */
|
||||||
|
};
|
||||||
rpmds XrpmdsUnlink(rpmds ds, const char * msg, const char * fn, unsigned ln)
|
rpmds XrpmdsUnlink(rpmds ds, const char * msg, const char * fn, unsigned ln)
|
||||||
{
|
{
|
||||||
if (ds == NULL) return NULL;
|
if (ds == NULL) return NULL;
|
||||||
|
|
25
lib/rpmds.h
25
lib/rpmds.h
|
@ -21,31 +21,6 @@ extern int _rpmds_debug;
|
||||||
*/
|
*/
|
||||||
extern int _rpmds_nopromote;
|
extern int _rpmds_nopromote;
|
||||||
|
|
||||||
#if defined(_RPMDS_INTERNAL)
|
|
||||||
/**
|
|
||||||
* A package dependency set.
|
|
||||||
*/
|
|
||||||
struct rpmds_s {
|
|
||||||
const char * Type; /*!< Tag name. */
|
|
||||||
const char * DNEVR; /*!< Formatted dependency string. */
|
|
||||||
Header h; /*!< Header for dependency set (or NULL) */
|
|
||||||
const char ** N; /*!< Name. */
|
|
||||||
const char ** EVR; /*!< Epoch-Version-Release. */
|
|
||||||
int32_t * Flags; /*!< Bit(s) identifying context/comparison. */
|
|
||||||
uint32_t * Color; /*!< Bit(s) calculated from file color(s). */
|
|
||||||
int32_t * Refs; /*!< No. of file refs. */
|
|
||||||
int32_t BT; /*!< Package build time tie breaker. */
|
|
||||||
rpmTag tagN; /*!< Header tag. */
|
|
||||||
rpmTagType Nt, EVRt, Ft; /*!< Tag data types. */
|
|
||||||
int32_t Count; /*!< No. of elements */
|
|
||||||
int i; /*!< Element index. */
|
|
||||||
unsigned l; /*!< Low element (bsearch). */
|
|
||||||
unsigned u; /*!< High element (bsearch). */
|
|
||||||
int nopromote; /*!< Don't promote Epoch: in rpmdsCompare()? */
|
|
||||||
int nrefs; /*!< Reference count. */
|
|
||||||
};
|
|
||||||
#endif /* _RPMDS_INTERNAL */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unreference a dependency set instance.
|
* Unreference a dependency set instance.
|
||||||
* @param ds dependency set
|
* @param ds dependency set
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
#include "rpmlock.h"
|
#include "rpmlock.h"
|
||||||
#include "rpmerr.h"
|
#include "rpmerr.h"
|
||||||
|
|
||||||
#define _RPMTE_INTERNAL /* XXX te->h */
|
|
||||||
#include "rpmte.h"
|
#include "rpmte.h"
|
||||||
|
|
||||||
#define _RPMTS_INTERNAL
|
#define _RPMTS_INTERNAL
|
||||||
|
@ -1418,11 +1417,13 @@ void * rpmtsNotify(rpmts ts, rpmte te,
|
||||||
{
|
{
|
||||||
void * ptr = NULL;
|
void * ptr = NULL;
|
||||||
if (ts && ts->notify && te) {
|
if (ts && ts->notify && te) {
|
||||||
assert(!(te->type == TR_ADDED && te->h == NULL));
|
Header h = rpmteHeader(te);
|
||||||
|
assert(!(rpmteType(te) == TR_ADDED && h == NULL));
|
||||||
/* FIX: cast? */
|
/* FIX: cast? */
|
||||||
/* FIX: check rc */
|
/* FIX: check rc */
|
||||||
ptr = ts->notify(te->h, what, amount, total,
|
ptr = ts->notify(h, what, amount, total,
|
||||||
rpmteKey(te), ts->notifyData);
|
rpmteKey(te), ts->notifyData);
|
||||||
|
headerUnlink(h); /* undo rpmteHeader() ref */
|
||||||
}
|
}
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,19 +35,6 @@
|
||||||
|
|
||||||
#include "idtx.h"
|
#include "idtx.h"
|
||||||
|
|
||||||
|
|
||||||
/* XXX: This is a hack. I needed a to setup a notify callback
|
|
||||||
* for the rollback transaction, but I did not want to create
|
|
||||||
* a header for rpminstall.c.
|
|
||||||
*/
|
|
||||||
extern void * rpmShowProgress(const void * arg,
|
|
||||||
const rpmCallbackType what,
|
|
||||||
const unsigned long amount,
|
|
||||||
const unsigned long total,
|
|
||||||
fnpyKey key,
|
|
||||||
void * data)
|
|
||||||
;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
static int archOkay(const char * pkgArch)
|
static int archOkay(const char * pkgArch)
|
||||||
|
@ -988,14 +975,16 @@ static rpmRC _rpmtsRollback(rpmts rollbackTransaction)
|
||||||
*/
|
*/
|
||||||
tsi = rpmtsiInit(rollbackTransaction);
|
tsi = rpmtsiInit(rollbackTransaction);
|
||||||
while((te = rpmtsiNext(tsi, 0)) != NULL) {
|
while((te = rpmtsiNext(tsi, 0)) != NULL) {
|
||||||
|
fnpyKey key = NULL;
|
||||||
rpmlog(RPMLOG_NOTICE, _("Cleaning up repackaged packages:\n"));
|
rpmlog(RPMLOG_NOTICE, _("Cleaning up repackaged packages:\n"));
|
||||||
switch (rpmteType(te)) {
|
switch (rpmteType(te)) {
|
||||||
/* The install elements are repackaged packages */
|
/* The install elements are repackaged packages */
|
||||||
case TR_ADDED:
|
case TR_ADDED:
|
||||||
/* Make sure the filename is still there. XXX: Can't happen */
|
/* Make sure the filename is still there. XXX: Can't happen */
|
||||||
if(te->key) {
|
key = rpmteKey(te);
|
||||||
rpmlog(RPMLOG_NOTICE, _("\tRemoving %s:\n"), te->key);
|
if(key) {
|
||||||
(void) unlink(te->key); /* XXX: Should check for an error? */
|
rpmlog(RPMLOG_NOTICE, _("\tRemoving %s:\n"), key);
|
||||||
|
(void) unlink(key); /* XXX: Should check for an error? */
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue