diff options
author | jbj <devnull@localhost> | 2001-11-12 22:54:39 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2001-11-12 22:54:39 +0000 |
commit | 49f98b8daed5ea05f585495d2df856a56b0567fa (patch) | |
tree | 237e024b6b42cb41fd9e73207e458884ac8d795f /lib | |
parent | 21a35690b3d6e79206ae62724cb8fbd538be57cb (diff) | |
download | librpm-tizen-49f98b8daed5ea05f585495d2df856a56b0567fa.tar.gz librpm-tizen-49f98b8daed5ea05f585495d2df856a56b0567fa.tar.bz2 librpm-tizen-49f98b8daed5ea05f585495d2df856a56b0567fa.zip |
transaction.c: lclint cleanups.
CVS patchset: 5178
CVS date: 2001/11/12 22:54:39
Diffstat (limited to 'lib')
-rw-r--r-- | lib/problems.c | 2 | ||||
-rw-r--r-- | lib/query.c | 16 | ||||
-rw-r--r-- | lib/rpmds.c | 7 | ||||
-rw-r--r-- | lib/rpmlib.h | 4 | ||||
-rw-r--r-- | lib/transaction.c | 39 | ||||
-rw-r--r-- | lib/verify.c | 16 |
6 files changed, 31 insertions, 53 deletions
diff --git a/lib/problems.c b/lib/problems.c index 1fa3cfde5..2be6abbe6 100644 --- a/lib/problems.c +++ b/lib/problems.c @@ -154,7 +154,7 @@ int rpmProblemSetTrim(rpmProblemSet ps, rpmProblemSet filter) continue; } while ((t - ps->probs) < ps->numProblems) { - /*@-nullpass@*/ /* LCL: looks good to me */ + /*@-nullpass@*/ /* LCL: looks good to me <shrug> */ if (f->type == t->type && t->key == f->key && XSTRCMP(f->str1, t->str1)) /*@innerbreak@*/ break; diff --git a/lib/query.c b/lib/query.c index 3356571fd..20536ce5c 100644 --- a/lib/query.c +++ b/lib/query.c @@ -543,10 +543,8 @@ int showMatches(QVA_t qva, rpmTransactionSet ts) while ((h = rpmdbNextIterator(qva->qva_mi)) != NULL) { int rc; - /*@-nullpass@*/ if ((rc = qva->qva_showPackage(qva, ts, h)) != 0) ec = rc; - /*@=nullpass@*/ } qva->qva_mi = rpmdbFreeIterator(qva->qva_mi); return ec; @@ -571,6 +569,7 @@ int rpmQueryVerify(QVA_t qva, rpmTransactionSet ts, const char * arg) int res = 0; Header h; int rc; + int xx; if (qva->qva_showPackage == NULL) return 1; @@ -605,7 +604,7 @@ restart: } ts->verify_legacy = 1; - /*@-mustmod@*/ /* LCL: something fishy here, was segfault */ + /*@=mustmod@*/ /* LCL: something fishy here, was segfault */ rpmrc = rpmReadPackageFile(ts, fd, fileURL, &h); /*@=mustmod@*/ ts->verify_legacy = 0; @@ -683,7 +682,7 @@ restart: int anyarch = 1; int force = 1; - /*@-mods@*/ + /*@-mods@*/ /* FIX: make spec abstract */ rc = parseSpecVec(&spec, arg, "/", buildRoot, recursing, passPhrase, cookie, anyarch, force); /*@=mods@*/ @@ -702,11 +701,8 @@ restart: break; } - for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) { - /*@-noeffectuncon@*/ /* FIX: check rc */ - (void) qva->qva_showPackage(qva, ts, pkg->header); - /*@=noeffectuncon@*/ - } + for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) + xx = qva->qva_showPackage(qva, ts, pkg->header); spec = freeSpecVec(spec); } break; @@ -782,9 +778,7 @@ restart: if (*s == '\0') { char fnbuf[PATH_MAX]; - /*@-unrecog -moduncon @*/ fn = realpath(arg, fnbuf); - /*@=unrecog =moduncon @*/; if (fn) fn = xstrdup(fn); else diff --git a/lib/rpmds.c b/lib/rpmds.c index 63bf773c6..57845e00d 100644 --- a/lib/rpmds.c +++ b/lib/rpmds.c @@ -20,6 +20,12 @@ /*@unchecked@*/ static int _fi_debug = 0; +/** + * Enable noisy range comparison debugging message? + */ +/*@unchecked@*/ +static int _noisy_range_comparison_debug_message = 0; + TFI_t XrpmfiUnlink(TFI_t fi, const char * msg, const char * fn, unsigned ln) { if (fi == NULL) return NULL; @@ -810,6 +816,7 @@ int dsCompare(const rpmDepSet A, const rpmDepSet B) } exit: + if (_noisy_range_comparison_debug_message) rpmMessage(RPMMESS_DEBUG, _(" %s A %s\tB %s\n"), (result ? _("YES") : _("NO ")), aDepend, bDepend); aDepend = _free(aDepend); diff --git a/lib/rpmlib.h b/lib/rpmlib.h index 6fb8d5893..e80c4e22c 100644 --- a/lib/rpmlib.h +++ b/lib/rpmlib.h @@ -1628,6 +1628,10 @@ typedef enum rpmprobFilterFlags_e { /** \ingroup rpmtrans * Process all packages in transaction set. + * + * @warning The value returned in *newProbs is now refcounted, and should + * be free'd using rpmProblemSetFree(). + * * @param ts transaction set * @param notify progress callback * @param notifyData progress callback private data diff --git a/lib/transaction.c b/lib/transaction.c index 01b999cd8..7de3a191c 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -111,9 +111,7 @@ int rpmtransGetKeys(const rpmTransactionSet ts, fnpyKey ** ep, int * nep) /*@switchbreak@*/ break; case TR_REMOVED: default: - /*@-mods@*/ /* FIX: double indirection. */ *e = NULL; - /*@=mods@*/ /*@switchbreak@*/ break; } e++; @@ -335,7 +333,6 @@ static int handleInstInstalledFiles(const rpmTransactionSet ts, fi->fmodes[fileNum], fi->fmd5s[fileNum], fi->flinks[fileNum])) { - /*@-compdef@*/ /* FIX: *fi->replaced undefined */ if (reportConflicts) { const char * altNEVR = hGetNEVR(h, NULL); rpmProblemSetAppend(ts->probs, RPMPROB_FILE_CONFLICT, @@ -345,10 +342,9 @@ static int handleInstInstalledFiles(const rpmTransactionSet ts, 0); altNEVR = _free(altNEVR); } - /*@=compdef@*/ if (!(otherFlags[otherFileNum] | fi->fflags[fileNum]) & RPMFILE_CONFIG) { - /*@-assignexpose@*/ + /*@-assignexpose@*/ /* FIX: p->replaced, not fi */ if (!shared->isRemoved) fi->replaced[numReplaced++] = *shared; /*@=assignexpose@*/ @@ -545,7 +541,6 @@ static void handleOverlappedFiles(const rpmTransactionSet ts, } /* Mark added overlapped non-identical files as a conflict. */ - /*@-branchstate@*/ /* FIX: p->key ??? */ if ((ts->ignoreSet & RPMPROB_FILTER_REPLACENEWFILES) && filecmp(recs[otherPkgNum]->fmodes[otherFileNum], recs[otherPkgNum]->fmd5s[otherFileNum], @@ -561,7 +556,6 @@ static void handleOverlappedFiles(const rpmTransactionSet ts, altNEVR, 0); } - /*@=branchstate@*/ /* Try to get the disk accounting correct even if a conflict. */ fixupSize = recs[otherPkgNum]->fsizes[otherFileNum]; @@ -673,7 +667,6 @@ static int ensureOlder(rpmTransactionSet ts, rc = headerMatchesDepFlags(h, req); req = dsFree(req); - /*@-branchstate@*/ /* FIX: p->key ??? */ if (rc == 0) { const char * altNEVR = hGetNEVR(h, NULL); rpmProblemSetAppend(ts->probs, RPMPROB_OLDPACKAGE, @@ -685,7 +678,6 @@ static int ensureOlder(rpmTransactionSet ts, rc = 1; } else rc = 0; - /*@=branchstate@*/ return rc; } @@ -904,10 +896,9 @@ int rpmRunTransactions( rpmTransactionSet ts, ts->notify = notify; ts->notifyData = notifyData; - /*@-assignexpose@*/ - ts->probs = *newProbs = rpmProblemSetCreate(); + ts->probs = rpmProblemSetFree(ts->probs); + ts->probs = rpmProblemSetCreate(); *newProbs = rpmpsLink(ts->probs, "RunTransactions"); - /*@=assignexpose@*/ ts->ignoreSet = ignoreSet; ts->currDir = _free(ts->currDir); ts->currDir = currentDirectory(); @@ -916,9 +907,7 @@ int rpmRunTransactions( rpmTransactionSet ts, ts->id = (int_32) time(NULL); memset(psm, 0, sizeof(*psm)); - /*@-assignexpose@*/ psm->ts = rpmtsLink(ts, "tsRun"); - /*@=assignexpose@*/ /* Get available space on mounted file systems. */ if (!(ts->ignoreSet & RPMPROB_FILTER_DISKSPACE) && @@ -991,19 +980,19 @@ int rpmRunTransactions( rpmTransactionSet ts, while ((p = teNext(pi, TR_ADDED)) != NULL) { rpmdbMatchIterator mi; - /*@-branchstate@*/ /* FIX: p->key ??? */ - if (!archOkay(p->arch) && !(ts->ignoreSet & RPMPROB_FILTER_IGNOREARCH)) - rpmProblemSetAppend(ts->probs, RPMPROB_BADARCH, + if (!(ts->ignoreSet & RPMPROB_FILTER_IGNOREARCH)) + if (!archOkay(p->arch)) + rpmProblemSetAppend(ts->probs, RPMPROB_BADARCH, p->NEVR, p->key, p->arch, NULL, NULL, 0); - if (!osOkay(p->os) && !(ts->ignoreSet & RPMPROB_FILTER_IGNOREOS)) - rpmProblemSetAppend(ts->probs, RPMPROB_BADOS, + if (!(ts->ignoreSet & RPMPROB_FILTER_IGNOREOS)) + if (!osOkay(p->os)) + rpmProblemSetAppend(ts->probs, RPMPROB_BADOS, p->NEVR, p->key, p->os, NULL, NULL, 0); - /*@=branchstate@*/ if (!(ts->ignoreSet & RPMPROB_FILTER_OLDPACKAGE)) { Header h; @@ -1319,9 +1308,7 @@ int rpmRunTransactions( rpmTransactionSet ts, { if (psm->ts != NULL) psm->ts = rpmtsUnlink(psm->ts, "tsRun (problems)"); - /*@-nullstate@*/ /* FIX: ts->flList may be NULL */ return ts->orderCount; - /*@=nullstate@*/ } /* =============================================== @@ -1374,24 +1361,20 @@ int rpmRunTransactions( rpmTransactionSet ts, rpmMessage(RPMMESS_DEBUG, "========== +++ %s\n", p->NEVR); h = NULL; { - /*@-noeffectuncon @*/ /* FIX: ??? */ p->fd = ts->notify(fi->h, RPMCALLBACK_INST_OPEN_FILE, 0, 0, p->key, ts->notifyData); - /*@=noeffectuncon @*/ if (p->fd != NULL) { rpmRC rpmrc; - /*@-mustmod@*/ /* LCL: segfault */ + /*@=mustmod@*/ /* LCL: segfault */ rpmrc = rpmReadPackageFile(ts, p->fd, "rpmRunTransactions", &h); /*@=mustmod@*/ if (!(rpmrc == RPMRC_OK || rpmrc == RPMRC_BADSIZE)) { - /*@-noeffectuncon @*/ /* FIX: check rc */ - (void) ts->notify(fi->h, RPMCALLBACK_INST_CLOSE_FILE, + p->fd = ts->notify(fi->h, RPMCALLBACK_INST_CLOSE_FILE, 0, 0, p->key, ts->notifyData); - /*@=noeffectuncon @*/ p->fd = NULL; ourrc++; } diff --git a/lib/verify.c b/lib/verify.c index b8d737d9e..70df8b62c 100644 --- a/lib/verify.c +++ b/lib/verify.c @@ -290,30 +290,20 @@ static int rpmVerifyScript(/*@unused@*/ QVA_t qva, rpmTransactionSet ts, psm->ts = rpmtsLink(ts, "rpmVerifyScript"); - if (scriptFd != NULL) { - /*@-type@*/ /* FIX: ??? */ + if (scriptFd != NULL) ts->scriptFd = fdLink(scriptFd, "rpmVerifyScript"); - /*@=type@*/ - } - /*@-type@*/ + psm->fi = fiNew(ts, NULL, h, RPMTAG_BASENAMES, 1); - /*@=type@*/ if (psm->fi != NULL) { /* XXX can't happen */ psm->stepName = "verify"; psm->scriptTag = RPMTAG_VERIFYSCRIPT; psm->progTag = RPMTAG_VERIFYSCRIPTPROG; rc = psmStage(psm, PSM_SCRIPT); } - /*@-type@*/ psm->fi = fiFree(psm->fi, 1); - /*@=type@*/ - if (scriptFd != NULL) { - /*@-type@*/ /* FIX: ??? */ + if (ts->scriptFd != NULL) ts->scriptFd = fdFree(ts->scriptFd, "rpmVerifyScript"); - /*@=type@*/ - ts->scriptFd = NULL; - } rpmtransClean(ts); /* XXX this is sure to cause heartburn */ |