diff options
author | jbj <devnull@localhost> | 2001-10-19 01:24:21 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2001-10-19 01:24:21 +0000 |
commit | 308f022df4ceee11a0cae80521ff1ddbcbfadcee (patch) | |
tree | 1854284b2cc1128a2566d1ffc1ff7dc1d8d2993f | |
parent | 73df151e8fb2df5b6a57eaf944fabebad0fd47d9 (diff) | |
download | librpm-tizen-308f022df4ceee11a0cae80521ff1ddbcbfadcee.tar.gz librpm-tizen-308f022df4ceee11a0cae80521ff1ddbcbfadcee.tar.bz2 librpm-tizen-308f022df4ceee11a0cae80521ff1ddbcbfadcee.zip |
Rewire digests, step 1.
CVS patchset: 5120
CVS date: 2001/10/19 01:24:21
-rw-r--r-- | beecrypt/beecrypt.spec | 63 | ||||
-rw-r--r-- | build/Makefile.am | 1 | ||||
-rw-r--r-- | lib/depends.c | 2 | ||||
-rw-r--r-- | lib/poptQV.c | 2 | ||||
-rw-r--r-- | lib/psm.c | 8 | ||||
-rw-r--r-- | lib/psm.h | 3 | ||||
-rw-r--r-- | lib/transaction.c | 566 | ||||
-rw-r--r-- | po/rpm.pot | 81 | ||||
-rw-r--r-- | rpmio/.lclintrc | 78 | ||||
-rw-r--r-- | rpmio/macro.c | 12 | ||||
-rw-r--r-- | rpmio/rpmmacro.h | 10 | ||||
-rw-r--r-- | rpmio/rpmpgp.h | 1 |
12 files changed, 114 insertions, 713 deletions
diff --git a/beecrypt/beecrypt.spec b/beecrypt/beecrypt.spec index 01b5ceca0..e69de29bb 100644 --- a/beecrypt/beecrypt.spec +++ b/beecrypt/beecrypt.spec @@ -1,63 +0,0 @@ -Summary: The BeeCrypt Cryptography Library -Name: beecrypt -Version: 2.2.0 -Release: 1 -Copyright: LGPL -Group: Development/Libraries -Source0: http://beecrypt.virtualunlimited.com/download/beecrypt-%{version}.tar.gz -URL: http://beecrypt.virtualunlimited.com/ -Buildroot: %{_tmppath}/%{name}-root - -%description -The BeeCrypt Cryptography Library. - -%package devel -Summary: The BeeCrypt Cryptography Library headers -Group: Development/Libraries -Requires: beecrypt = %{version} - -%description devel -The BeeCrypt Cryptography Library headers. - -%prep -%setup -q - -%build -%configure --enable-static -make -make apidocs - -%install -rm -rf ${RPM_BUILD_ROOT} -make DESTDIR="${RPM_BUILD_ROOT}" install - -%clean -rm -rf ${RPM_BUILD_ROOT} - -%post -p /sbin/ldconfig - -%postun -p /sbin/ldconfig - -%files -%defattr(-,root,root) -%doc BENCHMARKS NEWS README* -%{_libdir}/libbeecrypt.so.2.2.0 - -%files devel -%defattr(-,root,root) -%doc BUGS ChangeLog apidocs/* -%{_libdir}/libbeecrypt.so.2 -%{_libdir}/libbeecrypt.so -%{_libdir}/libbeecrypt.la -%{_libdir}/libbeecrypt.a -%{_includedir}/beecrypt - -%changelog -* Mon Oct 8 2001 Jeff Johnson <jbj@redhat.com> -- upgrade to 2.2.0pre. - -* Mon Sep 24 2001 Jeff Johnsopn <jbj@redhat.com> -- add static libraries. - -* Tue Sep 18 2001 Jeff Johnson <jbj@redhat.com> -- repackage. diff --git a/build/Makefile.am b/build/Makefile.am index 8fada49e9..0ee488f56 100644 --- a/build/Makefile.am +++ b/build/Makefile.am @@ -7,6 +7,7 @@ INCLUDES = \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/rpmdb \ -I$(top_srcdir)/rpmio \ + -I$(top_srcdir)/beecrypt \ -I$(top_srcdir)/popt \ @INCPATH@ diff --git a/lib/depends.c b/lib/depends.c index a8e925ddf..f6ff01dfa 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -1335,7 +1335,7 @@ static int unsatisfiedDepend(rpmTransactionSet ts, } mi = rpmdbFreeIterator(mi); -#ifdef DYING +#if defined(DYING) || defined(__LCLINT__) mi = rpmdbInitIterator(ts->rpmdb, RPMTAG_NAME, keyName, 0); (void) rpmdbPruneIterator(mi, ts->removedPackages, ts->numRemovedPackages, 1); diff --git a/lib/poptQV.c b/lib/poptQV.c index e7d106ce4..bb3ef14a3 100644 --- a/lib/poptQV.c +++ b/lib/poptQV.c @@ -198,8 +198,10 @@ struct poptOption rpmQueryPoptTable[] = { */ struct poptOption rpmVerifyPoptTable[] = { #ifdef DYING +/*@-type@*/ /* FIX: cast? */ { NULL, '\0', POPT_ARG_CALLBACK | POPT_CBFLAG_INC_DATA, verifyArgCallback, 0, NULL, NULL }, +/*@=type@*/ #endif /* DYING */ { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmQVSourcePoptTable, 0, NULL, NULL }, @@ -2519,18 +2519,14 @@ assert(psm->mi == NULL); xx = chdir(ts->currDir); } break; - case PSM_SCRIPT: -#ifdef DYING - rpmMessage(RPMMESS_DEBUG, _("%s: running %s script(s) (if any)\n"), - psm->stepName, tag2sln(psm->scriptTag)); -#endif + case PSM_SCRIPT: /* Run current package scriptlets. */ rc = runInstScript(psm); break; case PSM_TRIGGERS: /* Run triggers in other package(s) this package sets off. */ rc = runTriggers(psm); break; - case PSM_IMMED_TRIGGERS: + case PSM_IMMED_TRIGGERS: /* Run triggers in this package other package(s) set off. */ rc = runImmedTriggers(psm); break; @@ -201,8 +201,7 @@ fileTypes whatis(uint_16 mode) Header relocateFileList(const rpmTransactionSet ts, TFI_t fi, struct availablePackage * alp, Header origH, fileAction * actions) - /*@globals fileSystem @*/ - /*@modifies ts, fi, alp, origH, actions, fileSystem @*/; + /*@modifies ts, fi, alp, origH, actions @*/; /** * Load data from header into transaction file element info. diff --git a/lib/transaction.c b/lib/transaction.c index 4ac5a3eac..0986606f6 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -135,89 +135,6 @@ int rpmtransGetKeys(const rpmTransactionSet ts, const void *** ep, int * nep) return rc; } -#ifdef DYING -/** - */ -static rpmProblemSet psCreate(void) - /*@*/ -{ - rpmProblemSet probs; - - probs = xcalloc(1, sizeof(*probs)); /* XXX memory leak */ - probs->numProblems = probs->numProblemsAlloced = 0; - probs->probs = NULL; - - return probs; -} - -/** - */ -static void psAppend(rpmProblemSet probs, rpmProblemType type, - const struct availablePackage * alp, - const char * dn, const char *bn, - Header altH, unsigned long ulong1) - /*@modifies *probs, alp @*/ -{ - rpmProblem p; - char *t; - - if (probs->numProblems == probs->numProblemsAlloced) { - if (probs->numProblemsAlloced) - probs->numProblemsAlloced *= 2; - else - probs->numProblemsAlloced = 2; - probs->probs = xrealloc(probs->probs, - probs->numProblemsAlloced * sizeof(*probs->probs)); - } - - p = probs->probs + probs->numProblems; - probs->numProblems++; - memset(p, 0, sizeof(*p)); - p->type = type; - /*@-assignexpose@*/ - p->key = alp->key; - /*@=assignexpose@*/ - p->ulong1 = ulong1; - p->ignoreProblem = 0; - p->str1 = NULL; - p->h = NULL; - p->pkgNEVR = NULL; - p->altNEVR = NULL; - - if (dn || bn) { - p->str1 = - t = xcalloc(1, (dn ? strlen(dn) : 0) + (bn ? strlen(bn) : 0) + 1); - if (dn) t = stpcpy(t, dn); - if (bn) t = stpcpy(t, bn); - } - - if (alp) { - p->h = headerLink(alp->h); - p->pkgNEVR = - t = xcalloc(1, strlen(alp->name) + - strlen(alp->version) + - strlen(alp->release) + sizeof("--")); - t = stpcpy(t, alp->name); - t = stpcpy(t, "-"); - t = stpcpy(t, alp->version); - t = stpcpy(t, "-"); - t = stpcpy(t, alp->release); - } - - if (altH) { - const char * n, * v, * r; - (void) headerNVR(altH, &n, &v, &r); - p->altNEVR = - t = xcalloc(1, strlen(n) + strlen(v) + strlen(r) + sizeof("--")); - t = stpcpy(t, n); - t = stpcpy(t, "-"); - t = stpcpy(t, v); - t = stpcpy(t, "-"); - t = stpcpy(t, r); - } -} -#endif /* DYING */ - /** */ static int archOkay(Header h) @@ -292,472 +209,6 @@ void rpmProblemSetFree(rpmProblemSet probs) free(probs); } -#ifdef DYING -/** - */ -static /*@observer@*/ const char *const ftstring (fileTypes ft) - /*@*/ -{ - switch (ft) { - case XDIR: return "directory"; - case CDEV: return "char dev"; - case BDEV: return "block dev"; - case LINK: return "link"; - case SOCK: return "sock"; - case PIPE: return "fifo/pipe"; - case REG: return "file"; - default: return "unknown file type"; - } - /*@notreached@*/ -} - -/** - */ -static fileTypes whatis(uint_16 mode) - /*@*/ -{ - if (S_ISDIR(mode)) return XDIR; - if (S_ISCHR(mode)) return CDEV; - if (S_ISBLK(mode)) return BDEV; - if (S_ISLNK(mode)) return LINK; - if (S_ISSOCK(mode)) return SOCK; - if (S_ISFIFO(mode)) return PIPE; - return REG; -} - -#define alloca_strdup(_s) strcpy(alloca(strlen(_s)+1), (_s)) - -/** - * Relocate files in header. - * @todo multilib file dispositions need to be checked. - * @param ts transaction set - * @param fi transaction element file info - * @param alp available package - * @param origH package header - * @param actions file dispositions - * @return header with relocated files - */ -static Header relocateFileList(const rpmTransactionSet ts, TFI_t fi, - struct availablePackage * alp, - Header origH, fileAction * actions) - /*@modifies ts, fi, alp, origH, actions @*/ -{ - HGE_t hge = fi->hge; - HAE_t hae = fi->hae; - HME_t hme = fi->hme; - HFD_t hfd = (fi->hfd ? fi->hfd : headerFreeData); - static int _printed = 0; - int allowBadRelocate = (ts->ignoreSet & RPMPROB_FILTER_FORCERELOCATE); - rpmRelocation * rawRelocations = alp->relocs; - rpmRelocation * relocations = NULL; - int numRelocations; - const char ** validRelocations; - rpmTagType validType; - int numValid; - const char ** baseNames; - const char ** dirNames; - int_32 * dirIndexes; - int_32 * newDirIndexes; - int_32 fileCount; - int_32 dirCount; - uint_32 * fFlags = NULL; - uint_16 * fModes = NULL; - char * skipDirList; - Header h; - int nrelocated = 0; - int fileAlloced = 0; - char * fn = NULL; - int haveRelocatedFile = 0; - int reldel = 0; - int len; - int i, j, xx; - - if (!hge(origH, RPMTAG_PREFIXES, &validType, - (void **) &validRelocations, &numValid)) - numValid = 0; - - numRelocations = 0; - if (rawRelocations) - while (rawRelocations[numRelocations].newPath || - rawRelocations[numRelocations].oldPath) - numRelocations++; - - /* - * If no relocations are specified (usually the case), then return the - * original header. If there are prefixes, however, then INSTPREFIXES - * should be added, but, since relocateFileList() can be called more - * than once for the same header, don't bother if already present. - */ - if (rawRelocations == NULL || numRelocations == 0) { - if (numValid) { - if (!headerIsEntry(origH, RPMTAG_INSTPREFIXES)) - xx = hae(origH, RPMTAG_INSTPREFIXES, - validType, validRelocations, numValid); - validRelocations = hfd(validRelocations, validType); - } - /* XXX FIXME multilib file actions need to be checked. */ - return headerLink(origH); - } - - h = headerLink(origH); - - relocations = alloca(sizeof(*relocations) * numRelocations); - - /* Build sorted relocation list from raw relocations. */ - for (i = 0; i < numRelocations; i++) { - char * t; - - /* - * Default relocations (oldPath == NULL) are handled in the UI, - * not rpmlib. - */ - if (rawRelocations[i].oldPath == NULL) continue; /* XXX can't happen */ - - /* FIXME: Trailing /'s will confuse us greatly. Internal ones will - too, but those are more trouble to fix up. :-( */ - t = alloca_strdup(rawRelocations[i].oldPath); - /*@-branchstate@*/ - relocations[i].oldPath = (t[0] == '/' && t[1] == '\0') - ? t - : stripTrailingChar(t, '/'); - /*@=branchstate@*/ - - /* An old path w/o a new path is valid, and indicates exclusion */ - if (rawRelocations[i].newPath) { - int del; - - t = alloca_strdup(rawRelocations[i].newPath); - /*@-branchstate@*/ - relocations[i].newPath = (t[0] == '/' && t[1] == '\0') - ? t - : stripTrailingChar(t, '/'); - /*@=branchstate@*/ - - /*@-nullpass@*/ /* FIX: relocations[i].oldPath == NULL */ - /* Verify that the relocation's old path is in the header. */ - for (j = 0; j < numValid; j++) - if (!strcmp(validRelocations[j], relocations[i].oldPath)) - /*@innerbreak@*/ break; - /* XXX actions check prevents problem from being appended twice. */ - if (j == numValid && !allowBadRelocate && actions) - psAppend(ts->probs, RPMPROB_BADRELOCATE, alp, - relocations[i].oldPath, NULL, NULL, 0); - del = - strlen(relocations[i].newPath) - strlen(relocations[i].oldPath); - /*@=nullpass@*/ - - if (del > reldel) - reldel = del; - } else { - relocations[i].newPath = NULL; - } - } - - /* stupid bubble sort, but it's probably faster here */ - for (i = 0; i < numRelocations; i++) { - int madeSwap; - madeSwap = 0; - for (j = 1; j < numRelocations; j++) { - rpmRelocation tmpReloc; - if (relocations[j - 1].oldPath == NULL || /* XXX can't happen */ - relocations[j ].oldPath == NULL || /* XXX can't happen */ - strcmp(relocations[j - 1].oldPath, relocations[j].oldPath) <= 0) - /*@innercontinue@*/ continue; - /*@-usereleased@*/ /* LCL: ??? */ - tmpReloc = relocations[j - 1]; - relocations[j - 1] = relocations[j]; - relocations[j] = tmpReloc; - /*@=usereleased@*/ - madeSwap = 1; - } - if (!madeSwap) break; - } - - if (!_printed) { - _printed = 1; - rpmMessage(RPMMESS_DEBUG, _("========== relocations\n")); - for (i = 0; i < numRelocations; i++) { - if (relocations[i].oldPath == NULL) continue; /* XXX can't happen */ - if (relocations[i].newPath == NULL) - rpmMessage(RPMMESS_DEBUG, _("%5d exclude %s\n"), - i, relocations[i].oldPath); - else - rpmMessage(RPMMESS_DEBUG, _("%5d relocate %s -> %s\n"), - i, relocations[i].oldPath, relocations[i].newPath); - } - } - - /* Add relocation values to the header */ - if (numValid) { - const char ** actualRelocations; - int numActual; - - actualRelocations = xmalloc(numValid * sizeof(*actualRelocations)); - numActual = 0; - for (i = 0; i < numValid; i++) { - for (j = 0; j < numRelocations; j++) { - if (relocations[j].oldPath == NULL || /* XXX can't happen */ - strcmp(validRelocations[i], relocations[j].oldPath)) - /*@innercontinue@*/ continue; - /* On install, a relocate to NULL means skip the path. */ - if (relocations[j].newPath) { - actualRelocations[numActual] = relocations[j].newPath; - numActual++; - } - /*@innerbreak@*/ break; - } - if (j == numRelocations) { - actualRelocations[numActual] = validRelocations[i]; - numActual++; - } - } - - if (numActual) - xx = hae(h, RPMTAG_INSTPREFIXES, RPM_STRING_ARRAY_TYPE, - (void **) actualRelocations, numActual); - - actualRelocations = _free(actualRelocations); - validRelocations = hfd(validRelocations, validType); - } - - xx = hge(h, RPMTAG_BASENAMES, NULL, (void **) &baseNames, &fileCount); - xx = hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, NULL); - xx = hge(h, RPMTAG_DIRNAMES, NULL, (void **) &dirNames, &dirCount); - xx = hge(h, RPMTAG_FILEFLAGS, NULL, (void **) &fFlags, NULL); - xx = hge(h, RPMTAG_FILEMODES, NULL, (void **) &fModes, NULL); - - skipDirList = alloca(dirCount * sizeof(*skipDirList)); - memset(skipDirList, 0, dirCount * sizeof(*skipDirList)); - - newDirIndexes = alloca(sizeof(*newDirIndexes) * fileCount); - memcpy(newDirIndexes, dirIndexes, sizeof(*newDirIndexes) * fileCount); - dirIndexes = newDirIndexes; - - /* - * For all relocations, we go through sorted file/relocation lists - * backwards so that /usr/local relocations take precedence over /usr - * ones. - */ - - /* Relocate individual paths. */ - - for (i = fileCount - 1; i >= 0; i--) { - fileTypes ft; - int fnlen; - - /* - * If only adding libraries of different arch into an already - * installed package, skip all other files. - */ - if (alp->multiLib && !isFileMULTILIB((fFlags[i]))) { - if (actions) { - actions[i] = FA_SKIPMULTILIB; - rpmMessage(RPMMESS_DEBUG, _("excluding multilib path %s%s\n"), - dirNames[dirIndexes[i]], baseNames[i]); - } - continue; - } - - len = reldel + - strlen(dirNames[dirIndexes[i]]) + strlen(baseNames[i]) + 1; - /*@-branchstate@*/ - if (len >= fileAlloced) { - fileAlloced = len * 2; - fn = xrealloc(fn, fileAlloced); - } - /*@=branchstate@*/ - *fn = '\0'; - fnlen = stpcpy( stpcpy(fn, dirNames[dirIndexes[i]]), baseNames[i]) - fn; - - /* - * See if this file path needs relocating. - */ - /* - * XXX FIXME: Would a bsearch of the (already sorted) - * relocation list be a good idea? - */ - for (j = numRelocations - 1; j >= 0; j--) { - if (relocations[j].oldPath == NULL) /* XXX can't happen */ - /*@innercontinue@*/ continue; - len = strcmp(relocations[j].oldPath, "/") - ? strlen(relocations[j].oldPath) - : 0; - - if (fnlen < len) - /*@innercontinue@*/ continue; - /* - * Only subdirectories or complete file paths may be relocated. We - * don't check for '\0' as our directory names all end in '/'. - */ - if (!(fn[len] == '/' || fnlen == len)) - /*@innercontinue@*/ continue; - - if (strncmp(relocations[j].oldPath, fn, len)) - /*@innercontinue@*/ continue; - /*@innerbreak@*/ break; - } - if (j < 0) continue; - - ft = whatis(fModes[i]); - - /* On install, a relocate to NULL means skip the path. */ - if (relocations[j].newPath == NULL) { - if (ft == XDIR) { - /* Start with the parent, looking for directory to exclude. */ - for (j = dirIndexes[i]; j < dirCount; j++) { - len = strlen(dirNames[j]) - 1; - while (len > 0 && dirNames[j][len-1] == '/') len--; - if (fnlen != len) - /*@innercontinue@*/ continue; - if (strncmp(fn, dirNames[j], fnlen)) - /*@innercontinue@*/ continue; - /*@innerbreak@*/ break; - } - if (j < dirCount) - skipDirList[j] = 1; - } - if (actions) { - actions[i] = FA_SKIPNSTATE; - rpmMessage(RPMMESS_DEBUG, _("excluding %s %s\n"), - ftstring(ft), fn); - } - continue; - } - - /* Relocation on full paths only, please. */ - if (fnlen != len) continue; - - if (actions) - rpmMessage(RPMMESS_DEBUG, _("relocating %s to %s\n"), - fn, relocations[j].newPath); - nrelocated++; - - strcpy(fn, relocations[j].newPath); - { char * te = strrchr(fn, '/'); - if (te) { - if (te > fn) te++; /* root is special */ - fnlen = te - fn; - } else - te = fn + strlen(fn); - /*@-nullpass -nullderef@*/ /* LCL: te != NULL here. */ - if (strcmp(baseNames[i], te)) /* basename changed too? */ - baseNames[i] = alloca_strdup(te); - *te = '\0'; /* terminate new directory name */ - /*@=nullpass =nullderef@*/ - } - - /* Does this directory already exist in the directory list? */ - for (j = 0; j < dirCount; j++) { - if (fnlen != strlen(dirNames[j])) - /*@innercontinue@*/ continue; - if (strncmp(fn, dirNames[j], fnlen)) - /*@innercontinue@*/ continue; - /*@innerbreak@*/ break; - } - - if (j < dirCount) { - dirIndexes[i] = j; - continue; - } - - /* Creating new paths is a pita */ - if (!haveRelocatedFile) { - const char ** newDirList; - - haveRelocatedFile = 1; - newDirList = xmalloc((dirCount + 1) * sizeof(*newDirList)); - for (j = 0; j < dirCount; j++) - newDirList[j] = alloca_strdup(dirNames[j]); - dirNames = hfd(dirNames, RPM_STRING_ARRAY_TYPE); - dirNames = newDirList; - } else { - dirNames = xrealloc(dirNames, - sizeof(*dirNames) * (dirCount + 1)); - } - - dirNames[dirCount] = alloca_strdup(fn); - dirIndexes[i] = dirCount; - dirCount++; - } - - /* Finish off by relocating directories. */ - for (i = dirCount - 1; i >= 0; i--) { - for (j = numRelocations - 1; j >= 0; j--) { - - if (relocations[j].oldPath == NULL) /* XXX can't happen */ - /*@innercontinue@*/ continue; - len = strcmp(relocations[j].oldPath, "/") - ? strlen(relocations[j].oldPath) - : 0; - - if (len && strncmp(relocations[j].oldPath, dirNames[i], len)) - /*@innercontinue@*/ continue; - - /* - * Only subdirectories or complete file paths may be relocated. We - * don't check for '\0' as our directory names all end in '/'. - */ - if (dirNames[i][len] != '/') - /*@innercontinue@*/ continue; - - if (relocations[j].newPath) { /* Relocate the path */ - const char * s = relocations[j].newPath; - char * t = alloca(strlen(s) + strlen(dirNames[i]) - len + 1); - - (void) stpcpy( stpcpy(t, s) , dirNames[i] + len); - if (actions) - rpmMessage(RPMMESS_DEBUG, - _("relocating directory %s to %s\n"), dirNames[i], t); - dirNames[i] = t; - nrelocated++; - } - } - } - - /* Save original filenames in header and replace (relocated) filenames. */ - if (nrelocated) { - int c; - void * p; - rpmTagType t; - - p = NULL; - xx = hge(h, RPMTAG_BASENAMES, &t, &p, &c); - xx = hae(h, RPMTAG_ORIGBASENAMES, t, p, c); - p = hfd(p, t); - - p = NULL; - xx = hge(h, RPMTAG_DIRNAMES, &t, &p, &c); - xx = hae(h, RPMTAG_ORIGDIRNAMES, t, p, c); - p = hfd(p, t); - - p = NULL; - xx = hge(h, RPMTAG_DIRINDEXES, &t, &p, &c); - xx = hae(h, RPMTAG_ORIGDIRINDEXES, t, p, c); - p = hfd(p, t); - - xx = hme(h, RPMTAG_BASENAMES, RPM_STRING_ARRAY_TYPE, - baseNames, fileCount); - fi->bnl = hfd(fi->bnl, RPM_STRING_ARRAY_TYPE); - xx = hge(h, RPMTAG_BASENAMES, NULL, (void **) &fi->bnl, &fi->fc); - - xx = hme(h, RPMTAG_DIRNAMES, RPM_STRING_ARRAY_TYPE, - dirNames, dirCount); - fi->dnl = hfd(fi->dnl, RPM_STRING_ARRAY_TYPE); - xx = hge(h, RPMTAG_DIRNAMES, NULL, (void **) &fi->dnl, &fi->dc); - - xx = hme(h, RPMTAG_DIRINDEXES, RPM_INT32_TYPE, - dirIndexes, fileCount); - xx = hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &fi->dil, NULL); - } - - baseNames = hfd(baseNames, RPM_STRING_ARRAY_TYPE); - dirNames = hfd(dirNames, RPM_STRING_ARRAY_TYPE); - fn = _free(fn); - - return h; -} -#endif /* DYING */ - /** * Filter a problem set. * As the problem sets are generated in an order solely dependent @@ -945,7 +396,7 @@ static int filecmp(short mode1, const char * md51, const char * link1, /** */ -/* XXX ts->{probs,rpmdb} modified, could be const ... ts */ +/* XXX only ts->{probs,rpmdb} modified */ static int handleInstInstalledFiles(const rpmTransactionSet ts, TFI_t fi, struct sharedFileInfo * shared, int sharedCount, int reportConflicts) @@ -1047,7 +498,7 @@ static int handleInstInstalledFiles(const rpmTransactionSet ts, TFI_t fi, /** */ -/* XXX ts->rpmdb modified, could be const ... ts */ +/* XXX only ts->rpmdb modified */ static int handleRmvdInstalledFiles(const rpmTransactionSet ts, TFI_t fi, struct sharedFileInfo * shared, int sharedCount) /*@globals fileSystem @*/ @@ -1090,7 +541,7 @@ static int handleRmvdInstalledFiles(const rpmTransactionSet ts, TFI_t fi, /** * Update disk space needs on each partition for this package. */ -/* XXX ts->{probs,di} modified, could be const ... ts */ +/* XXX only ts->{probs,di} modified */ static void handleOverlappedFiles(const rpmTransactionSet ts, TFI_t fi) /*@globals fileSystem @*/ /*@modifies ts, fi, fileSystem @*/ @@ -1790,23 +1241,14 @@ int rpmRunTransactions( rpmTransactionSet ts, /*@-branchstate@*/ switch (fi->type) { case TR_ADDED: -#ifdef DYING - i = ts->order[oc].u.addedIndex; -#endif /* XXX watchout: fi->type must be set for tsGetAlp() to "work" */ fi->ap = tsGetAlp(tsi); fi->record = 0; loadFi(ts, fi, fi->ap->h, 1); -/* XXX free fi->ap->h here */ +/* XXX free fi->ap->h here if/when possible */ if (fi->fc == 0) continue; -#ifdef DYING - { Header foo = relocateFileList(ts, fi, fi->ap, fi->h, fi->actions); - foo = headerFree(foo); - } -#endif - /* Skip netshared paths, not our i18n files, and excluded docs */ skipFiles(ts, fi); /*@switchbreak@*/ break; diff --git a/po/rpm.pot b/po/rpm.pot index 2cb33ff24..ca6cb3558 100644 --- a/po/rpm.pot +++ b/po/rpm.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2001-10-18 12:38-0400\n" +"POT-Creation-Date: 2001-10-18 21:22-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -2690,47 +2690,47 @@ msgstr "" msgid "display a verbose file listing" msgstr "" -#: lib/poptQV.c:209 +#: lib/poptQV.c:211 msgid "don't verify MD5 digest of files" msgstr "" -#: lib/poptQV.c:212 +#: lib/poptQV.c:214 msgid "don't verify size of files" msgstr "" -#: lib/poptQV.c:215 +#: lib/poptQV.c:217 msgid "don't verify symlink path of files" msgstr "" -#: lib/poptQV.c:218 +#: lib/poptQV.c:220 msgid "don't verify owner of files" msgstr "" -#: lib/poptQV.c:221 +#: lib/poptQV.c:223 msgid "don't verify group of files" msgstr "" -#: lib/poptQV.c:224 +#: lib/poptQV.c:226 msgid "don't verify modification time of files" msgstr "" -#: lib/poptQV.c:227 lib/poptQV.c:230 +#: lib/poptQV.c:229 lib/poptQV.c:232 msgid "don't verify mode of files" msgstr "" -#: lib/poptQV.c:233 +#: lib/poptQV.c:235 msgid "don't verify files in package" msgstr "" -#: lib/poptQV.c:235 +#: lib/poptQV.c:237 msgid "don't verify package dependencies" msgstr "" -#: lib/poptQV.c:237 lib/poptQV.c:241 +#: lib/poptQV.c:239 lib/poptQV.c:243 msgid "don't execute %verifyscript (if any)" msgstr "" -#: lib/poptQV.c:244 +#: lib/poptQV.c:246 msgid "don't verify header SHA1 digest" msgstr "" @@ -2799,36 +2799,36 @@ msgstr "" msgid "unknown error %d encountered while manipulating package %s" msgstr "" -#: lib/psm.c:313 lib/transaction.c:478 +#: lib/psm.c:313 msgid "========== relocations\n" msgstr "" -#: lib/psm.c:317 lib/transaction.c:482 +#: lib/psm.c:317 #, c-format msgid "%5d exclude %s\n" msgstr "" -#: lib/psm.c:320 lib/transaction.c:485 +#: lib/psm.c:320 #, c-format msgid "%5d relocate %s -> %s\n" msgstr "" -#: lib/psm.c:390 lib/transaction.c:555 +#: lib/psm.c:390 #, c-format msgid "excluding multilib path %s%s\n" msgstr "" -#: lib/psm.c:456 lib/transaction.c:621 +#: lib/psm.c:456 #, c-format msgid "excluding %s %s\n" msgstr "" -#: lib/psm.c:466 lib/transaction.c:631 +#: lib/psm.c:466 #, c-format msgid "relocating %s to %s\n" msgstr "" -#: lib/psm.c:545 lib/transaction.c:710 +#: lib/psm.c:545 #, c-format msgid "relocating directory %s to %s\n" msgstr "" @@ -2905,11 +2905,6 @@ msgstr "" msgid "%s failed: %s\n" msgstr "" -#: lib/psm.c:2524 -#, c-format -msgid "%s: running %s script(s) (if any)\n" -msgstr "" - #: lib/query.c:119 #, c-format msgid "incorrect format: %s\n" @@ -3428,13 +3423,13 @@ msgstr "" msgid "You must set \"%%_pgp_name\" in your macro file\n" msgstr "" -#: lib/transaction.c:857 +#: lib/transaction.c:308 #, c-format msgid "%s skipped due to missingok flag\n" msgstr "" #. @innercontinue@ -#: lib/transaction.c:1485 +#: lib/transaction.c:936 #, c-format msgid "excluding directory %s\n" msgstr "" @@ -3760,87 +3755,87 @@ msgid "======================== active %d empty %d\n" msgstr "" #. XXX just in case -#: rpmio/macro.c:353 +#: rpmio/macro.c:355 #, c-format msgid "%3d>%*s(empty)" msgstr "" -#: rpmio/macro.c:396 +#: rpmio/macro.c:398 #, c-format msgid "%3d<%*s(empty)\n" msgstr "" -#: rpmio/macro.c:627 +#: rpmio/macro.c:629 #, c-format msgid "Macro %%%s has unterminated body\n" msgstr "" -#: rpmio/macro.c:654 +#: rpmio/macro.c:656 #, c-format msgid "Macro %%%s has illegal name (%%define)\n" msgstr "" -#: rpmio/macro.c:660 +#: rpmio/macro.c:662 #, c-format msgid "Macro %%%s has unterminated opts\n" msgstr "" -#: rpmio/macro.c:665 +#: rpmio/macro.c:667 #, c-format msgid "Macro %%%s has empty body\n" msgstr "" -#: rpmio/macro.c:671 +#: rpmio/macro.c:673 #, c-format msgid "Macro %%%s failed to expand\n" msgstr "" -#: rpmio/macro.c:706 +#: rpmio/macro.c:708 #, c-format msgid "Macro %%%s has illegal name (%%undefine)\n" msgstr "" -#: rpmio/macro.c:818 +#: rpmio/macro.c:820 #, c-format msgid "Macro %%%s (%s) was not used below level %d\n" msgstr "" -#: rpmio/macro.c:936 +#: rpmio/macro.c:938 #, c-format msgid "Unknown option %c in %s(%s)\n" msgstr "" -#: rpmio/macro.c:1135 +#: rpmio/macro.c:1137 #, c-format msgid "Recursion depth(%d) greater than max(%d)\n" msgstr "" -#: rpmio/macro.c:1202 rpmio/macro.c:1219 +#: rpmio/macro.c:1204 rpmio/macro.c:1221 #, c-format msgid "Unterminated %c: %s\n" msgstr "" -#: rpmio/macro.c:1260 +#: rpmio/macro.c:1262 #, c-format msgid "A %% is followed by an unparseable macro\n" msgstr "" -#: rpmio/macro.c:1389 +#: rpmio/macro.c:1391 #, c-format msgid "Macro %%%.*s not found, skipping\n" msgstr "" -#: rpmio/macro.c:1465 +#: rpmio/macro.c:1467 msgid "Target buffer overflow\n" msgstr "" #. XXX Fstrerror -#: rpmio/macro.c:1658 rpmio/macro.c:1664 +#: rpmio/macro.c:1664 rpmio/macro.c:1670 #, c-format msgid "File %s: %s\n" msgstr "" -#: rpmio/macro.c:1667 +#: rpmio/macro.c:1673 #, c-format msgid "File %s is smaller than %u bytes\n" msgstr "" diff --git a/rpmio/.lclintrc b/rpmio/.lclintrc index 0d1f2d9de..f50dda39b 100644 --- a/rpmio/.lclintrc +++ b/rpmio/.lclintrc @@ -1,37 +1,59 @@ -I. -I.. -I../popt -DHAVE_CONFIG_H -D_GNU_SOURCE +partial ++forcehints -warnunixlib -warnposix +unixlib -# XXX ignore doxygen markings --unrecogcomments - -# don't-bother-me-yet parameters --branchstate # ~43 occurences --mustfree # ~122 alloca is painful - -# not-yet normal parameters --boolops # ~244 w->n -#-null # ~84 --predboolint # ~147 w->n --type # ~373 - -# -weak paramaters -#+boolint -#-boolops -#+ignorequals -#+ignoresigns -#-mustfree -#+longintegral -#+matchanyintegral -#-nullpass -#-observertrans -#-predboolint -#-predboolothers -#-retvalint -#-retvalother -#-shiftsigned +-unrecogcomments # XXX ignore doxygen markings + ++strict # lclint level + +# --- +partial artifacts +-declundef +-exportheadervar +-exportlocal + +-enummemuse +-fcnuse +-typeuse +-varuse + +# --- not-yet at strict level +-bitwisesigned # pita +-elseifcomplete # 95 occurences +-exportconst # 839 occurences +-exportfcn +-exporttype +-exportvar +-fielduse # 1 occurence <bits/sigset.h> +-forblock # tedious +-ifblock # tedious +-incondefs # <bits/{ipc,pthreadtypes}.h> heartburn +-matchfields # <bits/ipc.h> heartburn +-namechecks # tedious ANSI compliance checks +-numenummembers 1024 # RPMTAG has 138 members +-numstructfields 256 # Java jni.h has 229 fields +-ptrarith # tedious +-strictops +-strictusereleased +-stringliterallen 4096 # redhat*PubKey's are big +-whileblock # tedious + +# --- not-yet at checks level +-ansi-reserved ++enumint +-mustfree +-predboolptr +-usedef + +# --- not-yet at standard level +-boolops +-predboolint ++boolint ++charint ++ignorequals ++matchanyintegral diff --git a/rpmio/macro.c b/rpmio/macro.c index 4c8b267de..983aa640c 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -236,6 +236,7 @@ rpmDumpMacroTable(MacroContext mc, FILE * fp) * @param namelen no. of byes * @return address of slot in macro table with name (or NULL) */ +/*@-mustmod@*/ /* LCL: segfault with modifies nothing annotation */ /*@dependent@*/ /*@null@*/ static MacroEntry * findEntry(MacroContext mc, const char * name, size_t namelen) /*@globals rpmGlobalMacroContext @*/ @@ -265,6 +266,7 @@ findEntry(MacroContext mc, const char * name, size_t namelen) /* XXX TODO: find 1st empty slot and return that */ return ret; } +/*@=mustmod@*/ /* =============================================================== */ @@ -1511,6 +1513,7 @@ delMacro(MacroContext mc, const char * n) } } +/*@-mustmod@*/ /* LCL: mc is modified through mb->mc, mb is abstract */ int rpmDefineMacro(MacroContext mc, const char * macro, int level) { @@ -1521,9 +1524,10 @@ rpmDefineMacro(MacroContext mc, const char * macro, int level) /*@-temptrans -assignexpose@*/ mb->mc = (mc ? mc : rpmGlobalMacroContext); /*@=temptrans =assignexpose@*/ - (void)doDefine(mb, macro, level, 0); + (void) doDefine(mb, macro, level, 0); return 0; } +/*@=mustmod@*/ void rpmLoadMacros(MacroContext mc, int level) @@ -1547,13 +1551,15 @@ rpmLoadMacros(MacroContext mc, int level) } void -rpmInitMacros(MacroContext mc, const char *macrofiles) +rpmInitMacros(/*@unused@*/ MacroContext mc, const char *macrofiles) { char *m, *mfile, *me; if (macrofiles == NULL) return; +#ifdef DYING if (mc == NULL) mc = rpmGlobalMacroContext; +#endif for (mfile = m = xstrdup(macrofiles); mfile && *mfile != '\0'; mfile = me) { FD_t fd; @@ -1602,7 +1608,7 @@ rpmInitMacros(MacroContext mc, const char *macrofiles) if (c != '%') /*@innercontinue@*/ continue; n++; /* skip % */ - (void)rpmDefineMacro(NULL, n, RMIL_MACROFILES); + (void) rpmDefineMacro(NULL, n, RMIL_MACROFILES); } (void) Fclose(fd); } diff --git a/rpmio/rpmmacro.h b/rpmio/rpmmacro.h index df9d5b961..04871739c 100644 --- a/rpmio/rpmmacro.h +++ b/rpmio/rpmmacro.h @@ -122,23 +122,23 @@ int rpmDefineMacro (/*@null@*/ MacroContext mc, const char * macro, /*@modifies mc, rpmGlobalMacroContext @*/; /** - * Load macros from context into global context. + * Load macros from specific context into global context. * @param mc macro context (NULL does nothing). * @param level macro recursion level (0 is entry API) */ void rpmLoadMacros (/*@null@*/ MacroContext mc, int level) /*@globals rpmGlobalMacroContext@*/ - /*@modifies mc, rpmGlobalMacroContext @*/; + /*@modifies rpmGlobalMacroContext @*/; /** - * Initialize macro context from set of macrofile(s). - * @param mc macro context (NULL uses global context). + * Initialize global macro context from set of macrofile(s). + * @param mc (unused) * @param macrofiles colon separated list of macro files (NULL does nothing) */ void rpmInitMacros (/*@null@*/ MacroContext mc, const char * macrofiles) /*@globals rpmGlobalMacroContext, rpmCLIMacroContext, fileSystem @*/ - /*@modifies mc, rpmGlobalMacroContext, fileSystem @*/; + /*@modifies rpmGlobalMacroContext, fileSystem @*/; /** * Destroy macro context. diff --git a/rpmio/rpmpgp.h b/rpmio/rpmpgp.h index fb5f2b5da..cbcdb95c3 100644 --- a/rpmio/rpmpgp.h +++ b/rpmio/rpmpgp.h @@ -262,6 +262,7 @@ extern struct pgpValTbl_s pgpCompressionTbl[]; * * Implementations MUST implement SHA-1. Implementations SHOULD * implement MD5. + * @todo Add SHA256. */ typedef enum pgpHashAlgo_e { PGPHASHALGO_MD5 = 1, /*!< MD5 */ |