diff options
author | Ralf Corsépius <corsepiu@fedoraproject.org> | 2007-10-30 12:17:16 +0100 |
---|---|---|
committer | Ralf Corsépius <corsepiu@fedoraproject.org> | 2007-10-30 12:17:16 +0100 |
commit | c36d94ded4e65b45e4d448acd2f32866da8be445 (patch) | |
tree | 4395b59a5f34b859845bdc9d75445fae6a5e1132 /lib | |
parent | 41d0a9fd3e8615efbb333746dfd2ea1ad9e285e3 (diff) | |
parent | 591cd9852badfcbed43737deeb60ea8f4ae9c10e (diff) | |
download | librpm-tizen-c36d94ded4e65b45e4d448acd2f32866da8be445.tar.gz librpm-tizen-c36d94ded4e65b45e4d448acd2f32866da8be445.tar.bz2 librpm-tizen-c36d94ded4e65b45e4d448acd2f32866da8be445.zip |
merge.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rpmds.c | 23 | ||||
-rw-r--r-- | lib/rpmds.h | 25 | ||||
-rw-r--r-- | lib/rpmts.c | 7 | ||||
-rw-r--r-- | lib/transaction.c | 21 |
4 files changed, 31 insertions, 45 deletions
diff --git a/lib/rpmds.c b/lib/rpmds.c index 4de501bf1..ee91740a8 100644 --- a/lib/rpmds.c +++ b/lib/rpmds.c @@ -5,7 +5,6 @@ #include "rpmlib.h" -#define _RPMDS_INTERNAL #include "rpmds.h" #include "debug.h" @@ -21,6 +20,28 @@ int _rpmds_nopromote = 1; 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) { if (ds == NULL) return NULL; diff --git a/lib/rpmds.h b/lib/rpmds.h index 8984aae41..32bc25a0e 100644 --- a/lib/rpmds.h +++ b/lib/rpmds.h @@ -21,31 +21,6 @@ extern int _rpmds_debug; */ 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. * @param ds dependency set diff --git a/lib/rpmts.c b/lib/rpmts.c index e794a047b..c297b42d3 100644 --- a/lib/rpmts.c +++ b/lib/rpmts.c @@ -16,7 +16,6 @@ #include "rpmlock.h" #include "rpmerr.h" -#define _RPMTE_INTERNAL /* XXX te->h */ #include "rpmte.h" #define _RPMTS_INTERNAL @@ -1418,11 +1417,13 @@ void * rpmtsNotify(rpmts ts, rpmte te, { void * ptr = NULL; 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: check rc */ - ptr = ts->notify(te->h, what, amount, total, + ptr = ts->notify(h, what, amount, total, rpmteKey(te), ts->notifyData); + headerUnlink(h); /* undo rpmteHeader() ref */ } return ptr; } diff --git a/lib/transaction.c b/lib/transaction.c index 04742312c..a38076642 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -35,19 +35,6 @@ #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) @@ -988,14 +975,16 @@ static rpmRC _rpmtsRollback(rpmts rollbackTransaction) */ tsi = rpmtsiInit(rollbackTransaction); while((te = rpmtsiNext(tsi, 0)) != NULL) { + fnpyKey key = NULL; rpmlog(RPMLOG_NOTICE, _("Cleaning up repackaged packages:\n")); switch (rpmteType(te)) { /* The install elements are repackaged packages */ case TR_ADDED: /* Make sure the filename is still there. XXX: Can't happen */ - if(te->key) { - rpmlog(RPMLOG_NOTICE, _("\tRemoving %s:\n"), te->key); - (void) unlink(te->key); /* XXX: Should check for an error? */ + key = rpmteKey(te); + if(key) { + rpmlog(RPMLOG_NOTICE, _("\tRemoving %s:\n"), key); + (void) unlink(key); /* XXX: Should check for an error? */ } break; |