diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2010-03-22 12:49:45 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2010-03-22 12:49:45 +0200 |
commit | c586c9955cb79a98345d44138904f3ee009d9314 (patch) | |
tree | 6239e22fe0a547d86230ebca0bda7ab1d4685e8a | |
parent | e307f8df46870dc890bd65ef3ca0ad025f24375a (diff) | |
download | rpm-c586c9955cb79a98345d44138904f3ee009d9314.tar.gz rpm-c586c9955cb79a98345d44138904f3ee009d9314.tar.bz2 rpm-c586c9955cb79a98345d44138904f3ee009d9314.zip |
Lose the useless rpmfi refcounting etc debug messages + debug switches
- get the debug messages out of API, this is what should've been in commit
dbdbe8010cd944f026a5a4e5d071eb31d29d81c4
-rw-r--r-- | build/pack.c | 5 | ||||
-rw-r--r-- | lib/fsm.c | 4 | ||||
-rw-r--r-- | lib/poptALL.c | 4 | ||||
-rw-r--r-- | lib/psm.c | 2 | ||||
-rw-r--r-- | lib/rpmal.c | 2 | ||||
-rw-r--r-- | lib/rpmfi.c | 38 | ||||
-rw-r--r-- | lib/rpmfi.h | 9 | ||||
-rw-r--r-- | lib/rpmte.c | 2 | ||||
-rw-r--r-- | python/rpmte-py.c | 2 |
9 files changed, 19 insertions, 49 deletions
diff --git a/build/pack.c b/build/pack.c index fa947bff5..3af9facb4 100644 --- a/build/pack.c +++ b/build/pack.c @@ -789,7 +789,7 @@ rpmRC packageBinaries(rpmSpec spec) memset(csa, 0, sizeof(*csa)); csa->cpioArchiveSize = 0; csa->cpioFdIn = fdNew(RPMDBG_M("init (packageBinaries)")); - csa->cpioList = rpmfiLink(pkg->cpioList, RPMDBG_M("packageBinaries")); + csa->cpioList = rpmfiLink(pkg->cpioList); rc = writeRPM(&pkg->header, NULL, fn, csa, spec->passPhrase, NULL); csa->cpioList = rpmfiFree(csa->cpioList); @@ -845,8 +845,7 @@ rpmRC packageSources(rpmSpec spec) memset(csa, 0, sizeof(*csa)); csa->cpioArchiveSize = 0; csa->cpioFdIn = fdNew(RPMDBG_M("init (packageSources)")); - csa->cpioList = rpmfiLink(spec->sourceCpioList, - RPMDBG_M("packageSources")); + csa->cpioList = rpmfiLink(spec->sourceCpioList); spec->sourcePkgId = NULL; rc = writeRPM(&spec->sourceHeader, &spec->sourcePkgId, fn, @@ -142,7 +142,7 @@ static void * mapFreeIterator(void * p) /* XXX rpmswExit() */ iter->ts = rpmtsFree(iter->ts); iter->te = NULL; /* XXX rpmte is not refcounted yet */ - iter->fi = rpmfiUnlink(iter->fi, RPMDBG_M("mapFreeIterator")); + iter->fi = rpmfiUnlink(iter->fi); } return _free(p); } @@ -161,7 +161,7 @@ mapInitIterator(rpmts ts, rpmte te, rpmfi fi) iter = xcalloc(1, sizeof(*iter)); iter->ts = rpmtsLink(ts); iter->te = te; /* XXX rpmte is not refcounted yet */ - iter->fi = rpmfiLink(fi, RPMDBG_M("mapIterator")); + iter->fi = rpmfiLink(fi); iter->reverse = (rpmteType(te) == TR_REMOVED); iter->i = (iter->reverse ? (rpmfiFC(fi) - 1) : 0); iter->isave = iter->i; diff --git a/lib/poptALL.c b/lib/poptALL.c index 9983101f8..6f87be44c 100644 --- a/lib/poptALL.c +++ b/lib/poptALL.c @@ -46,8 +46,6 @@ extern int _rpmds_debug; /* XXX avoid -lrpmbuild linkage. */ int _rpmfc_debug; -extern int _rpmfi_debug; - extern int _rpmps_debug; extern int _rpmsq_debug; @@ -236,8 +234,6 @@ struct poptOption rpmcliAllPoptTable[] = { NULL, NULL}, { "rpmfcdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmfc_debug, -1, NULL, NULL}, - { "rpmfidebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmfi_debug, -1, - NULL, NULL}, { "rpmiodebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmio_debug, -1, N_("debug rpmio I/O"), NULL}, { "rpmpsdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmps_debug, -1, @@ -676,7 +676,7 @@ static rpmpsm rpmpsmNew(rpmts ts, rpmte te) #else psm->te = te; #endif - psm->fi = rpmfiLink(rpmteFI(te), RPMDBG_M("rpmpsmNew")); + psm->fi = rpmfiLink(rpmteFI(te)); } return psm; diff --git a/lib/rpmal.c b/lib/rpmal.c index 9ed6a1e94..90a1df1e3 100644 --- a/lib/rpmal.c +++ b/lib/rpmal.c @@ -227,7 +227,7 @@ void rpmalAdd(rpmal al, rpmte p) alp->provides = rpmdsLink(rpmteDS(p, RPMTAG_PROVIDENAME), RPMDBG_M("Provides (rpmalAdd)")); - alp->fi = rpmfiLink(rpmteFI(p), RPMDBG_M("Files (rpmalAdd)")); + alp->fi = rpmfiLink(rpmteFI(p)); if (al->providesHash != NULL) { // index is already created rpmalAddProvides(al, pkgNum, alp->provides); diff --git a/lib/rpmfi.c b/lib/rpmfi.c index 5dc113c89..6ffcafb8e 100644 --- a/lib/rpmfi.c +++ b/lib/rpmfi.c @@ -86,24 +86,17 @@ static strcache strcacheFree(strcache cache) return NULL; } - -int _rpmfi_debug = 0; - -rpmfi rpmfiUnlink(rpmfi fi, const char * msg) +rpmfi rpmfiUnlink(rpmfi fi) { - if (fi == NULL) return NULL; -if (_rpmfi_debug && msg != NULL) -fprintf(stderr, "--> fi %p -- %d %s\n", fi, fi->nrefs, msg); - fi->nrefs--; + if (fi) + fi->nrefs--; return NULL; } -rpmfi rpmfiLink(rpmfi fi, const char * msg) +rpmfi rpmfiLink(rpmfi fi) { - if (fi == NULL) return NULL; - fi->nrefs++; -if (_rpmfi_debug && msg != NULL) -fprintf(stderr, "--> fi %p ++ %d %s\n", fi, fi->nrefs, msg); + if (fi) + fi->nrefs++; return fi; } @@ -491,10 +484,6 @@ int rpmfiNext(rpmfi fi) fi->j = fi->dil[fi->i]; } else fi->i = -1; - -if (_rpmfi_debug < 0 && i != -1) -fprintf(stderr, "*** fi %p\t[%d] %s%s\n", fi, i, (i >= 0 ? fi->dnl[fi->j] : ""), (i >= 0 ? fi->bnl[fi->i] : "")); - } return i; @@ -521,10 +510,6 @@ int rpmfiNextD(rpmfi fi) j = fi->j; else fi->j = -1; - -if (_rpmfi_debug < 0 && j != -1) -fprintf(stderr, "*** fi %p\t[%d]\n", fi, j); - } return j; @@ -1055,10 +1040,7 @@ rpmfi rpmfiFree(rpmfi fi) if (fi == NULL) return NULL; if (fi->nrefs > 1) - return rpmfiUnlink(fi, __FUNCTION__); - -if (_rpmfi_debug < 0) -fprintf(stderr, "*** fi %p\t[%d]\n", fi, fi->fc); + return rpmfiUnlink(fi); if (fi->fc > 0) { fi->bnl = _free(fi->bnl); @@ -1108,7 +1090,7 @@ fprintf(stderr, "*** fi %p\t[%d]\n", fi, fi->fc); fi->h = headerFree(fi->h); - (void) rpmfiUnlink(fi, __FUNCTION__); + (void) rpmfiUnlink(fi); memset(fi, 0, sizeof(*fi)); /* XXX trash and burn */ fi = _free(fi); @@ -1267,15 +1249,13 @@ rpmfi rpmfiNew(const rpmts ts, Header h, rpmTag tagN, rpmfiFlags flags) fi->fn = NULL; exit: -if (_rpmfi_debug < 0) -fprintf(stderr, "*** fi %p\t[%d]\n", fi, (fi ? fi->fc : 0)); if (fi != NULL) { fi->h = (fi->fiflags & RPMFI_KEEPHEADER) ? headerLink(h) : NULL; } /* FIX: rpmfi null annotations */ - return rpmfiLink(fi, __FUNCTION__); + return rpmfiLink(fi); } void rpmfiSetFReplacedSize(rpmfi fi, rpm_loff_t newsize) diff --git a/lib/rpmfi.h b/lib/rpmfi.h index b33efbf6c..2e2910b20 100644 --- a/lib/rpmfi.h +++ b/lib/rpmfi.h @@ -14,8 +14,6 @@ extern "C" { #endif -extern int _rpmfi_debug; - /** \ingroup rpmfi * File types. * These are the file types used internally by rpm. The file @@ -99,19 +97,16 @@ struct rpmRelocation_s { /** \ingroup rpmfi * Unreference a file info set instance. * @param fi file info set - * @param msg * @return NULL always */ -rpmfi rpmfiUnlink (rpmfi fi, - const char * msg); +rpmfi rpmfiUnlink (rpmfi fi); /** \ingroup rpmfi * Reference a file info set instance. * @param fi file info set - * @param msg * @return new file info set reference */ -rpmfi rpmfiLink (rpmfi fi, const char * msg); +rpmfi rpmfiLink (rpmfi fi); /** \ingroup rpmfi * Return file count from file info set. diff --git a/lib/rpmte.c b/lib/rpmte.c index b6d958b8b..5a785256d 100644 --- a/lib/rpmte.c +++ b/lib/rpmte.c @@ -489,7 +489,7 @@ rpmfi rpmteSetFI(rpmte te, rpmfi fi) if (te != NULL) { te->fi = rpmfiFree(te->fi); if (fi != NULL) - te->fi = rpmfiLink(fi, __FUNCTION__); + te->fi = rpmfiLink(fi); } return NULL; } diff --git a/python/rpmte-py.c b/python/rpmte-py.c index ca95eb14e..03e6368c2 100644 --- a/python/rpmte-py.c +++ b/python/rpmte-py.c @@ -182,7 +182,7 @@ rpmte_FI(rpmteObject * s, PyObject * args, PyObject * kwds) if (fi == NULL) { Py_RETURN_NONE; } - return rpmfi_Wrap(&rpmfi_Type, rpmfiLink(fi, RPMDBG_M("rpmte_FI"))); + return rpmfi_Wrap(&rpmfi_Type, rpmfiLink(fi)); } static struct PyMethodDef rpmte_methods[] = { |