RPM Package Manager, CVS Repository
http://rpm5.org/cvs/
____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson
Root: /v/rpm/cvs Email: jbj@rpm5.org
Module: rpm Date: 07-Oct-2007 21:25:22
Branch: HEAD Handle: 2007100720252101
Modified files:
rpm CHANGES
rpm/lib depends.c
rpm/rpmdb hdrinline.h header.h rpmdb.c
Log:
- jbj: expose hRET_t through headerGetExtension prototypes.
Summary:
Revision Changes Path
1.1660 +1 -0 rpm/CHANGES
1.343 +8 -8 rpm/lib/depends.c
1.16 +1 -1 rpm/rpmdb/hdrinline.h
1.29 +1 -1 rpm/rpmdb/header.h
1.166 +11 -12 rpm/rpmdb/rpmdb.c
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: rpm/CHANGES
============================================================================
$ cvs diff -u -r1.1659 -r1.1660 CHANGES
--- rpm/CHANGES 7 Oct 2007 18:58:33 -0000 1.1659
+++ rpm/CHANGES 7 Oct 2007 19:25:21 -0000 1.1660
@@ -1,4 +1,5 @@
4.5 -> 5.0:
+ - jbj: expose hRET_t through headerGetExtension prototypes.
- jbj: unbork/simplify hRET_t indirections, too much acid in the Kool-Aid.
- jbj: rpmdeps: unhide various CLI options.
- jbj: rpmdeps: invoke rpm, not /bin/rpm.
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/depends.c
============================================================================
$ cvs diff -u -r1.342 -r1.343 depends.c
--- rpm/lib/depends.c 6 Oct 2007 21:33:48 -0000 1.342
+++ rpm/lib/depends.c 7 Oct 2007 19:25:22 -0000 1.343
@@ -232,14 +232,14 @@
rc = rpmPlatformScore(platform, platpat, nplatpat);
if (rc <= 0) {
- const char * pkgNVRA = NULL;
+ hRET_t pkgNVRA;
rpmps ps = rpmtsProblems(ts);
xx = headerGetExtension(h, RPMTAG_NVRA, NULL, &pkgNVRA, NULL);
-assert(pkgNVRA != NULL);
- rpmpsAppend(ps, RPMPROB_BADPLATFORM, pkgNVRA, key,
+assert(pkgNVRA.str != NULL);
+ rpmpsAppend(ps, RPMPROB_BADPLATFORM, pkgNVRA.str, key,
platform, NULL, NULL, 0);
ps = rpmpsFree(ps);
- pkgNVRA = _free(pkgNVRA);
+ pkgNVRA.str = _free(pkgNVRA.str);
ec = 1;
}
platform = _free(platform);
@@ -1300,7 +1300,7 @@
(void) rpmdbPruneIterator(mi,
ts->removedPackages, ts->numRemovedPackages, 1);
while ((h = rpmdbNextIterator(mi)) != NULL) {
- const char * pkgNVRA = NULL;
+ hRET_t pkgNVRA;
rpmds requires = NULL;
rpmds conflicts = NULL;
rpmds dirnames = NULL;
@@ -1308,7 +1308,7 @@
int rc;
rc = headerGetExtension(h, RPMTAG_NVRA, NULL, &pkgNVRA, NULL);
-assert(pkgNVRA != NULL);
+assert(pkgNVRA.str != NULL);
if (!(depFlags & RPMDEPS_FLAG_NOREQUIRES))
requires = rpmdsNew(h, RPMTAG_REQUIRENAME, scareMem);
if (!(depFlags & RPMDEPS_FLAG_NOCONFLICTS))
@@ -1323,7 +1323,7 @@
(void) rpmdsSetNoPromote(dirnames, _rpmds_nopromote);
(void) rpmdsSetNoPromote(linktos, _rpmds_nopromote);
- rc = checkPackageDeps(ts, pkgNVRA,
+ rc = checkPackageDeps(ts, pkgNVRA.str,
requires, conflicts, dirnames, linktos,
depName, tscolor, adding);
@@ -1331,7 +1331,7 @@
dirnames = rpmdsFree(dirnames);
conflicts = rpmdsFree(conflicts);
requires = rpmdsFree(requires);
- pkgNVRA = _free(pkgNVRA);
+ pkgNVRA.str = _free(pkgNVRA.str);
if (rc) {
ec = 1;
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmdb/hdrinline.h
============================================================================
$ cvs diff -u -r1.15 -r1.16 hdrinline.h
--- rpm/rpmdb/hdrinline.h 7 Oct 2007 14:00:13 -0000 1.15
+++ rpm/rpmdb/hdrinline.h 7 Oct 2007 19:25:22 -0000 1.16
@@ -264,7 +264,7 @@
/*@unused@*/ static inline
int headerGetExtension(Header h, int_32 tag,
/*@null@*/ /*@out@*/ hTYP_t type,
- /*@null@*/ /*@out@*/ void * p,
+ /*@null@*/ /*@out@*/ hRET_t * p,
/*@null@*/ /*@out@*/ hCNT_t c)
/*@modifies *type, *p, *c @*/
{
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmdb/header.h
============================================================================
$ cvs diff -u -r1.28 -r1.29 header.h
--- rpm/rpmdb/header.h 7 Oct 2007 18:58:33 -0000 1.28
+++ rpm/rpmdb/header.h 7 Oct 2007 19:25:22 -0000 1.29
@@ -507,7 +507,7 @@
typedef
int (*HDRext) (Header h, int_32 tag,
/*@null@*/ /*@out@*/ hTYP_t type,
- /*@null@*/ /*@out@*/ void * p,
+ /*@null@*/ /*@out@*/ hRET_t * p,
/*@null@*/ /*@out@*/ hCNT_t c)
/*@modifies *type, *p, *c @*/;
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmdb/rpmdb.c
============================================================================
$ cvs diff -u -r1.165 -r1.166 rpmdb.c
--- rpm/rpmdb/rpmdb.c 7 Oct 2007 14:00:13 -0000 1.165
+++ rpm/rpmdb/rpmdb.c 7 Oct 2007 19:25:22 -0000 1.166
@@ -2134,15 +2134,10 @@
/*@modifies mi->mi_re @*/
{
HGE_t hge = (HGE_t) headerGetExtension;
+#ifdef DYING
HFD_t hfd = (HFD_t) headerFreeData;
- union {
- void * ptr;
- const char ** argv;
- const char * str;
- int_32 * i32p;
- int_16 * i16p;
- int_8 * i8p;
- } u;
+#endif
+ hRET_t u;
char numbuf[32];
rpmTagType t;
int_32 c;
@@ -2166,7 +2161,7 @@
for (i = 0; i < mi->mi_nre; i++, mire++) {
int anymatch;
- if (!hge(mi->mi_h, mire->tag, &t, (void **)&u, &c)) {
+ if (!hge(mi->mi_h, mire->tag, &t, (void *)&u, &c)) {
if (mire->tag != RPMTAG_EPOCH) {
ntags++;
continue;
@@ -2234,10 +2229,14 @@
/*@innerbreak@*/ break;
}
+#ifdef DYING
if (mire->tag == RPMTAG_NVRA)
u.str = _free(u.str);
else
u.ptr = hfd(u.ptr, t);
+#else
+ u.ptr = _free(u.ptr);
+#endif
if (anymatch)
nmatches++;
@@ -2809,10 +2808,10 @@
}
#endif
- { const char * NVRA = NULL;
+ { hRET_t NVRA;
(void) headerGetExtension(h, RPMTAG_NVRA, NULL, &NVRA, NULL);
- rpmMessage(RPMMESS_DEBUG, " --- h#%8u %s\n", hdrNum, NVRA);
- NVRA = _free(NVRA);
+ rpmMessage(RPMMESS_DEBUG, " --- h#%8u %s\n", hdrNum, NVRA.str);
+ NVRA.str = _free(NVRA.str);
}
(void) blockSignals(db, &signalMask);
@@ .
Received on Sun Oct 7 21:25:22 2007