From 89e28f78e89e3f07cc4bbc61f5bf0d5d5ee1ad5a Mon Sep 17 00:00:00 2001 From: jbj Date: Wed, 14 Apr 1999 12:35:08 +0000 Subject: [PATCH] Make silly headerGetEntry consistent throughout. CVS patchset: 2995 CVS date: 1999/04/14 12:35:08 --- build/files.c | 6 ++-- build/pack.c | 2 -- build/parsePreamble.c | 4 +-- build/parsePrep.c | 4 +-- build/reqprov.c | 8 ++--- build/spec.c | 4 +-- lib/depends.c | 14 ++++---- lib/install.c | 10 +++--- lib/query.c | 2 +- lib/transaction.c | 20 ++++++------ lib/uninstall.c | 2 +- po/rpm.pot | 88 +++++++++++++++++++++++++-------------------------- 12 files changed, 80 insertions(+), 84 deletions(-) diff --git a/build/files.c b/build/files.c index d47b587..b290734 100644 --- a/build/files.c +++ b/build/files.c @@ -682,9 +682,9 @@ static int parseForSimple(Spec spec, Package pkg, char *buf, { const char *ddir, *name, *version; headerGetEntry(pkg->header, RPMTAG_NAME, NULL, - (void *) &name, NULL); + (void **) &name, NULL); headerGetEntry(pkg->header, RPMTAG_VERSION, NULL, - (void *) &version, NULL); + (void **) &version, NULL); ddir = rpmGetPath("%{_docdir}/", name, "-", version, NULL); strcpy(buf, ddir); @@ -1109,7 +1109,7 @@ static int processPackageFiles(Spec spec, Package pkg, fl.buildRoot = rpmGetPath(spec->buildRoot, NULL); if (headerGetEntry(pkg->header, RPMTAG_DEFAULTPREFIX, - NULL, (void *)&fl.prefix, NULL)) { + NULL, (void **)&fl.prefix, NULL)) { fl.prefix = strdup(fl.prefix); } else { fl.prefix = NULL; diff --git a/build/pack.c b/build/pack.c index 0628238..c185a2e 100644 --- a/build/pack.c +++ b/build/pack.c @@ -1,7 +1,5 @@ #include "system.h" -#include - #include "rpmbuild.h" #include "buildio.h" diff --git a/build/parsePreamble.c b/build/parsePreamble.c index 7416a4d..35dc1b9 100644 --- a/build/parsePreamble.c +++ b/build/parsePreamble.c @@ -310,7 +310,7 @@ stashSt(Spec spec, Header h, int tag, const char *lang) t->t_msgid = NULL; if (!(t->t_lang && strcmp(t->t_lang, RPMBUILD_DEFAULT_LANG))) { char *n; - if (headerGetEntry(h, RPMTAG_NAME, NULL, (void *) &n, NULL)) { + if (headerGetEntry(h, RPMTAG_NAME, NULL, (void **) &n, NULL)) { char buf[1024]; sprintf(buf, "%s(%s)", n, tagName(tag)); t->t_msgid = strdup(buf); @@ -689,7 +689,7 @@ int parsePreamble(Spec spec, int initialPackage) /* Construct the package */ if (flag == PART_SUBNAME) { headerGetEntry(spec->packages->header, RPMTAG_NAME, - NULL, (void *) &mainName, NULL); + NULL, (void **) &mainName, NULL); sprintf(fullName, "%s-%s", mainName, name); } else { strcpy(fullName, name); diff --git a/build/parsePrep.c b/build/parsePrep.c index fa2275b..8d7c20e 100644 --- a/build/parsePrep.c +++ b/build/parsePrep.c @@ -241,9 +241,9 @@ static int doSetupMacro(Spec spec, char *line) spec->buildSubdir = strdup(dirName); } else { headerGetEntry(spec->packages->header, RPMTAG_VERSION, NULL, - (void *) &version, NULL); + (void **) &version, NULL); headerGetEntry(spec->packages->header, RPMTAG_NAME, NULL, - (void *) &name, NULL); + (void **) &name, NULL); sprintf(buf, "%s-%s", name, version); spec->buildSubdir = strdup(buf); } diff --git a/build/reqprov.c b/build/reqprov.c index fc1012f..53d6f8d 100644 --- a/build/reqprov.c +++ b/build/reqprov.c @@ -48,15 +48,15 @@ int addReqProv(Spec spec, Header h, version = ""; } - if (headerGetEntry(h, nametag, NULL, (void *) &names, &len)) { + if (headerGetEntry(h, nametag, NULL, (void **) &names, &len)) { if (flagtag) { headerGetEntry(h, versiontag, NULL, - (void *) &versions, NULL); - headerGetEntry(h, flagtag, NULL, (void *) &flags, NULL); + (void **) &versions, NULL); + headerGetEntry(h, flagtag, NULL, (void **) &flags, NULL); } if (indextag) { headerGetEntry(h, indextag, NULL, - (void *) &indexes, NULL); + (void **) &indexes, NULL); } while (len) { len--; diff --git a/build/spec.c b/build/spec.c index 55074dd..cbd2c9c 100644 --- a/build/spec.c +++ b/build/spec.c @@ -64,7 +64,7 @@ int lookupPackage(Spec spec, const char *name, int flag, /*@out@*/Package *pkg) /* Construct package name */ if (flag == PART_SUBNAME) { headerGetEntry(spec->packages->header, RPMTAG_NAME, - NULL, (void *) &n, NULL); + NULL, (void **) &n, NULL); sprintf(buf, "%s-%s", n, name); fullName = buf; } else { @@ -72,7 +72,7 @@ int lookupPackage(Spec spec, const char *name, int flag, /*@out@*/Package *pkg) } for (p = spec->packages; p != NULL; p = p->next) { - headerGetEntry(p->header, RPMTAG_NAME, NULL, (void *) &n, NULL); + headerGetEntry(p->header, RPMTAG_NAME, NULL, (void **) &n, NULL); if (n && (! strcmp(fullName, n))) { break; } diff --git a/lib/depends.c b/lib/depends.c index ebb45ab..a6095b6 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -258,7 +258,7 @@ int rpmtransAddPackage(rpmTransactionSet rpmdep, Header h, FD_t fd, return 1; /* Make sure we've implemented all of the capabilities we need */ - if (headerGetEntry(h, RPMTAG_CAPABILITY, NULL, &caps, &count)) { + if (headerGetEntry(h, RPMTAG_CAPABILITY, NULL, (void **)&caps, &count)) { if (count != 1 || *caps) { return 2; } @@ -281,7 +281,7 @@ int rpmtransAddPackage(rpmTransactionSet rpmdep, Header h, FD_t fd, if (!upgrade || rpmdep->db == NULL) return 0; - headerGetEntry(h, RPMTAG_NAME, NULL, (void *) &name, &count); + headerGetEntry(h, RPMTAG_NAME, NULL, (void **) &name, &count); if (!rpmdbFindPackage(rpmdep->db, name, &matches)) { Header h2; @@ -300,7 +300,7 @@ int rpmtransAddPackage(rpmTransactionSet rpmdep, Header h, FD_t fd, dbiFreeIndexRecord(matches); } - if (headerGetEntry(h, RPMTAG_OBSOLETES, NULL, (void *) &obsoletes, + if (headerGetEntry(h, RPMTAG_OBSOLETES, NULL, (void **) &obsoletes, &count)) { for (j = 0; j < count; j++) { if (!rpmdbFindPackage(rpmdep->db, obsoletes[j], &matches)) { @@ -770,20 +770,20 @@ int headerMatchesDepFlags(Header h, const char * reqInfo, int reqFlags) { int result = 0; int sense; - headerGetEntry(h, RPMTAG_NAME, &type, (void *) &name, &count); + headerGetEntry(h, RPMTAG_NAME, &type, (void **) &name, &count); if (!(reqFlags & RPMSENSE_SENSEMASK) || !reqInfo || !strlen(reqInfo)) { return 1; } if (reqFlags & RPMSENSE_SERIAL) { - if (!headerGetEntry(h, RPMTAG_EPOCH, &type, (void *) &epoch, &count)) { + if (!headerGetEntry(h, RPMTAG_EPOCH, &type, (void **) &epoch, &count)) { return 0; } sprintf(buf, "%d", *epoch); version = buf; } else { - headerGetEntry(h, RPMTAG_VERSION, &type, (void *) &version, &count); + headerGetEntry(h, RPMTAG_VERSION, &type, (void **) &version, &count); chptr = strrchr(reqInfo, '-'); if (chptr) { char *rv = alloca(strlen(reqInfo) + 1); @@ -792,7 +792,7 @@ int headerMatchesDepFlags(Header h, const char * reqInfo, int reqFlags) { reqVersion = rv; reqRelease = reqVersion + (chptr - reqInfo) + 1; if (*reqRelease) - headerGetEntry(h, RPMTAG_RELEASE, &type, (void *) &release, &count); + headerGetEntry(h, RPMTAG_RELEASE, &type, (void **) &release, &count); else reqRelease = NULL; } diff --git a/lib/install.c b/lib/install.c index 3f683d9..a6a675e 100644 --- a/lib/install.c +++ b/lib/install.c @@ -1,7 +1,5 @@ #include "system.h" -#include - #include "rpmlib.h" #include "cpio.h" @@ -103,7 +101,7 @@ int rpmInstallSourcePackage(const char * rootdir, FD_t fd, if (cookie) { *cookie = NULL; - if (h && headerGetEntry(h, RPMTAG_COOKIE, NULL, (void *) cookie, + if (h && headerGetEntry(h, RPMTAG_COOKIE, NULL, (void **) cookie, NULL)) { *cookie = strdup(*cookie); } @@ -324,7 +322,7 @@ int installBinaryPackage(const char * rootdir, rpmdb db, FD_t fd, Header h, /* old format relocateable packages need the entire default prefix stripped to form the cpio list, while all other packages need the leading / stripped */ - if (headerGetEntry(h, RPMTAG_DEFAULTPREFIX, NULL, (void *) + if (headerGetEntry(h, RPMTAG_DEFAULTPREFIX, NULL, (void **) &defaultPrefix, NULL)) { stripSize = strlen(defaultPrefix) + 1; } else { @@ -445,7 +443,7 @@ int installBinaryPackage(const char * rootdir, rpmdb db, FD_t fd, Header h, } if (!headerGetEntry(h, RPMTAG_ARCHIVESIZE, &type, - (void *) &archiveSizePtr, &count)) + (void **) &archiveSizePtr, &count)) archiveSizePtr = NULL; if (notify) { @@ -749,7 +747,7 @@ static int installSources(Header h, const char * rootdir, FD_t fd, } if (!headerGetEntry(h, RPMTAG_ARCHIVESIZE, NULL, - (void *) &archiveSizePtr, NULL)) + (void **) &archiveSizePtr, NULL)) archiveSizePtr = NULL; chdir(realSourceDir); diff --git a/lib/query.c b/lib/query.c index 25f0674..39a745e 100644 --- a/lib/query.c +++ b/lib/query.c @@ -448,7 +448,7 @@ printNewSpecfile(Spec spec) if (t->t_msgid == NULL) { char *n; headerGetEntry(spec->packages->header, RPMTAG_NAME, NULL, - (void *) &n, NULL); + (void **) &n, NULL); sprintf(buf, "%s(%s)", n, tagName(t->t_tag)); t->t_msgid = strdup(buf); } diff --git a/lib/transaction.c b/lib/transaction.c index ee227fe..c01f37d 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -285,7 +285,7 @@ int rpmRunTransactions(rpmTransactionSet ts, rpmCallbackFunction notify, alp = ts->addedPackages.list + ts->order[oc].u.addedIndex; if (!headerGetEntryMinMemory(alp->h, RPMTAG_FILENAMES, NULL, - (void *) NULL, &fi->fc)) { + NULL, &fi->fc)) { fi->h = headerLink(alp->h); hdrs[i] = headerLink(fi->h); continue; @@ -308,7 +308,7 @@ int rpmRunTransactions(rpmTransactionSet ts, rpmCallbackFunction notify, } if (!headerGetEntry(fi->h, RPMTAG_FILENAMES, NULL, - (void *) &fi->fl, &fi->fc)) { + (void **) &fi->fl, &fi->fc)) { /* This catches removed packages w/ no file lists */ fi->fc = 0; continue; @@ -319,19 +319,19 @@ int rpmRunTransactions(rpmTransactionSet ts, rpmCallbackFunction notify, fi->actions = calloc(sizeof(*fi->actions), fi->fc); headerGetEntry(fi->h, RPMTAG_FILEMODES, NULL, - (void *) &fi->fmodes, NULL); + (void **) &fi->fmodes, NULL); headerGetEntry(fi->h, RPMTAG_FILEFLAGS, NULL, - (void *) &fi->fflags, NULL); + (void **) &fi->fflags, NULL); headerGetEntry(fi->h, RPMTAG_FILESIZES, NULL, - (void *) &fi->fsizes, NULL); + (void **) &fi->fsizes, NULL); headerGetEntry(fi->h, RPMTAG_FILESTATES, NULL, - (void *) &fi->fstates, NULL); + (void **) &fi->fstates, NULL); if (ts->order[oc].type == TR_REMOVED) { headerGetEntry(fi->h, RPMTAG_FILEMD5S, NULL, - (void *) &fi->fmd5s, NULL); + (void **) &fi->fmd5s, NULL); headerGetEntry(fi->h, RPMTAG_FILELINKTOS, NULL, - (void *) &fi->flinks, NULL); + (void **) &fi->flinks, NULL); fi->fsizes = memcpy(malloc(fi->fc * sizeof(*fi->fsizes)), fi->fsizes, fi->fc * sizeof(*fi->fsizes)); fi->fflags = memcpy(malloc(fi->fc * sizeof(*fi->fflags)), @@ -346,9 +346,9 @@ int rpmRunTransactions(rpmTransactionSet ts, rpmCallbackFunction notify, /* ADDED package */ headerGetEntryMinMemory(fi->h, RPMTAG_FILEMD5S, NULL, - (void *) &fi->fmd5s, NULL); + (void **) &fi->fmd5s, NULL); headerGetEntryMinMemory(fi->h, RPMTAG_FILELINKTOS, NULL, - (void *) &fi->flinks, NULL); + (void **) &fi->flinks, NULL); /* 0 makes for noops */ fi->replacedSizes = calloc(fi->fc, sizeof(*fi->replacedSizes)); diff --git a/lib/uninstall.c b/lib/uninstall.c index 53518d4..be8e749 100644 --- a/lib/uninstall.c +++ b/lib/uninstall.c @@ -172,7 +172,7 @@ static int runScript(Header h, const char * root, int progArgc, const char ** pr argc = progArgc; } - if (headerGetEntry(h, RPMTAG_INSTPREFIXES, NULL, (void *) &prefixes, + if (headerGetEntry(h, RPMTAG_INSTPREFIXES, NULL, (void **) &prefixes, &numPrefixes)) { freePrefixes = 1; } else if (headerGetEntry(h, RPMTAG_INSTALLPREFIX, NULL, diff --git a/po/rpm.pot b/po/rpm.pot index f6ee59c..fa2bbbd 100644 --- a/po/rpm.pot +++ b/po/rpm.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 1999-04-14 06:46-0400\n" +"POT-Creation-Date: 1999-04-14 08:28-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -130,7 +130,7 @@ msgstr "" msgid "Couldn't write header/archive to temp file" msgstr "" -#: ../build/pack.c:349 ../checksig.c:91 +#: ../build/pack.c:347 ../checksig.c:91 #, c-format msgid "Generating signature: %d\n" msgstr "" @@ -1550,7 +1550,7 @@ msgstr "" msgid "error looking for package %s\n" msgstr "" -#: ../build/build.c:81 ../build/pack.c:267 +#: ../build/build.c:81 ../build/pack.c:265 msgid "Unable to open temp file" msgstr "" @@ -1721,7 +1721,7 @@ msgstr "" msgid "Could not open %%files file: %s" msgstr "" -#: ../build/files.c:1097 ../build/pack.c:452 +#: ../build/files.c:1097 ../build/pack.c:450 #, c-format msgid "line: %s" msgstr "" @@ -1797,96 +1797,96 @@ msgstr "" msgid "Could not canonicalize hostname: %s\n" msgstr "" -#: ../build/pack.c:153 +#: ../build/pack.c:151 #, c-format msgid "Could not generate output filename for package %s: %s\n" msgstr "" -#: ../build/pack.c:186 +#: ../build/pack.c:184 #, c-format msgid "readRPM: open %s: %s\n" msgstr "" -#: ../build/pack.c:196 +#: ../build/pack.c:194 #, c-format msgid "readRPM: read %s: %s\n" msgstr "" -#: ../build/pack.c:216 +#: ../build/pack.c:214 #, c-format msgid "readRPM: %s is not an RPM package\n" msgstr "" -#: ../build/pack.c:222 +#: ../build/pack.c:220 #, c-format msgid "readRPM: reading header from %s\n" msgstr "" -#: ../build/pack.c:278 +#: ../build/pack.c:276 msgid "Bad CSA data" msgstr "" -#: ../build/pack.c:301 +#: ../build/pack.c:299 #, c-format msgid "Could not open %s\n" msgstr "" -#: ../build/pack.c:333 ../build/pack.c:376 +#: ../build/pack.c:331 ../build/pack.c:374 #, c-format msgid "Unable to write package: %s" msgstr "" -#: ../build/pack.c:366 +#: ../build/pack.c:364 #, c-format msgid "Unable to read sigtarget: %s" msgstr "" -#: ../build/pack.c:391 +#: ../build/pack.c:389 #, c-format msgid "Wrote: %s\n" msgstr "" -#: ../build/pack.c:406 +#: ../build/pack.c:404 #, c-format msgid "create archive failed on file %s: %s" msgstr "" -#: ../build/pack.c:422 +#: ../build/pack.c:420 #, c-format msgid "cpio_copy write failed: %s" msgstr "" -#: ../build/pack.c:429 +#: ../build/pack.c:427 #, c-format msgid "cpio_copy read failed: %s" msgstr "" -#: ../build/pack.c:508 +#: ../build/pack.c:506 #, c-format msgid "Could not open PreIn file: %s" msgstr "" -#: ../build/pack.c:515 +#: ../build/pack.c:513 #, c-format msgid "Could not open PreUn file: %s" msgstr "" -#: ../build/pack.c:522 +#: ../build/pack.c:520 #, c-format msgid "Could not open PostIn file: %s" msgstr "" -#: ../build/pack.c:529 +#: ../build/pack.c:527 #, c-format msgid "Could not open PostUn file: %s" msgstr "" -#: ../build/pack.c:537 +#: ../build/pack.c:535 #, c-format msgid "Could not open VerifyScript file: %s" msgstr "" -#: ../build/pack.c:553 +#: ../build/pack.c:551 #, c-format msgid "Could not open Trigger script file: %s" msgstr "" @@ -2441,101 +2441,101 @@ msgstr "" msgid "(unknown type)" msgstr "" -#: ../lib/install.c:95 +#: ../lib/install.c:93 msgid "source package expected, binary found" msgstr "" -#: ../lib/install.c:171 ../lib/uninstall.c:111 +#: ../lib/install.c:169 ../lib/uninstall.c:111 #, c-format msgid " file: %s action: %s\n" msgstr "" -#: ../lib/install.c:188 +#: ../lib/install.c:186 #, c-format msgid "user %s does not exist - using root" msgstr "" -#: ../lib/install.c:196 +#: ../lib/install.c:194 #, c-format msgid "group %s does not exist - using root" msgstr "" -#: ../lib/install.c:223 +#: ../lib/install.c:221 msgid "%%instchangelog value in macro file should be a number, but isn't" msgstr "" -#: ../lib/install.c:291 +#: ../lib/install.c:289 #, c-format msgid "package: %s-%s-%s files test = %d\n" msgstr "" -#: ../lib/install.c:354 +#: ../lib/install.c:352 msgid "stopping install as we're running --test\n" msgstr "" -#: ../lib/install.c:359 +#: ../lib/install.c:357 msgid "running preinstall script (if any)\n" msgstr "" -#: ../lib/install.c:389 +#: ../lib/install.c:387 #, c-format msgid "warning: %s created as %s" msgstr "" -#: ../lib/install.c:425 +#: ../lib/install.c:423 #, c-format msgid "warning: %s saved as %s" msgstr "" -#: ../lib/install.c:429 ../lib/install.c:792 ../lib/uninstall.c:337 +#: ../lib/install.c:427 ../lib/install.c:790 ../lib/uninstall.c:337 #, c-format msgid "rename of %s to %s failed: %s" msgstr "" -#: ../lib/install.c:509 +#: ../lib/install.c:507 msgid "running postinstall script (if any)\n" msgstr "" #. this would probably be a good place to check if disk space #. was used up - if so, we should return a different error -#: ../lib/install.c:615 +#: ../lib/install.c:613 #, c-format msgid "unpacking of archive failed%s%s: %s" msgstr "" -#: ../lib/install.c:616 +#: ../lib/install.c:614 msgid " on file " msgstr "" -#: ../lib/install.c:656 +#: ../lib/install.c:654 msgid "installing a source package\n" msgstr "" -#: ../lib/install.c:667 ../lib/install.c:689 +#: ../lib/install.c:665 ../lib/install.c:687 #, c-format msgid "cannot create %s" msgstr "" -#: ../lib/install.c:674 ../lib/install.c:696 +#: ../lib/install.c:672 ../lib/install.c:694 #, c-format msgid "cannot write to %s" msgstr "" -#: ../lib/install.c:678 +#: ../lib/install.c:676 #, c-format msgid "sources in: %s\n" msgstr "" -#: ../lib/install.c:700 +#: ../lib/install.c:698 #, c-format msgid "spec file in: %s\n" msgstr "" -#: ../lib/install.c:733 ../lib/install.c:769 +#: ../lib/install.c:731 ../lib/install.c:767 msgid "source package contains no .spec file" msgstr "" -#: ../lib/install.c:790 +#: ../lib/install.c:788 #, c-format msgid "renaming %s to %s\n" msgstr "" -- 2.7.4