From 4d26dfa475765173ecb06bf17bda66ddb179acad Mon Sep 17 00:00:00 2001 From: jbj Date: Fri, 26 Nov 1999 22:31:19 +0000 Subject: [PATCH] Minimal python compile. CVS patchset: 3439 CVS date: 1999/11/26 22:31:19 --- build/parsePreamble.c | 34 +++++++++++++--------------------- po/rpm.pot | 16 ++++++++-------- python/rpmmodule.c | 2 ++ python/upgrade.c | 17 ++++++++++------- 4 files changed, 33 insertions(+), 36 deletions(-) diff --git a/build/parsePreamble.c b/build/parsePreamble.c index e40d29c..d8bd379 100644 --- a/build/parsePreamble.c +++ b/build/parsePreamble.c @@ -94,7 +94,7 @@ static int parseYesNo(char *s) return 1; } -static char *findLastChar(char *s) +static inline char * findLastChar(char * s) { char *res = s; @@ -332,9 +332,8 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, const char *macro, int num, rc, len; /* Find the start of the "field" and strip trailing space */ - while ((*field) && (*field != ':')) { + while ((*field) && (*field != ':')) field++; - } if (*field != ':') { rpmError(RPMERR_BADSPEC, _("line %d: Malformed tag: %s"), spec->lineNum, spec->line); @@ -422,7 +421,8 @@ fprintf(stderr, "*** PPA BuildRoot %s set from macro\n", buildRootURL); (void) urlPath(specURL, (const char **)&field); if (*field == '\0') field = "/"; buildRootURL = rpmGenPath(spec->rootURL, field, NULL); - field = spec->buildRootURL = buildRootURL; + spec->buildRootURL = buildRootURL; + field = (char *) buildRootURL; if (_debug) fprintf(stderr, "*** PPA BuildRoot %s set from field\n", buildRootURL); } @@ -572,7 +572,6 @@ static struct PreambleRec { {RPMTAG_RELEASE, 0, 0, "release"}, {RPMTAG_EPOCH, 0, 0, "epoch"}, {RPMTAG_EPOCH, 0, 0, "serial"}, -/* {RPMTAG_DESCRIPTION, 0, 0, "description"}, */ {RPMTAG_SUMMARY, 0, 1, "summary"}, {RPMTAG_LICENSE, 0, 0, "copyright"}, {RPMTAG_LICENSE, 0, 0, "license"}, @@ -581,7 +580,6 @@ static struct PreambleRec { {RPMTAG_GROUP, 0, 1, "group"}, {RPMTAG_PACKAGER, 0, 0, "packager"}, {RPMTAG_URL, 0, 0, "url"}, -/* {RPMTAG_ROOT, 0, 0, "root"}, */ {RPMTAG_SOURCE, 0, 0, "source"}, {RPMTAG_PATCH, 0, 0, "patch"}, {RPMTAG_NOSOURCE, 0, 0, "nosource"}, @@ -590,8 +588,6 @@ static struct PreambleRec { {RPMTAG_EXCLUSIVEARCH, 0, 0, "exclusivearch"}, {RPMTAG_EXCLUDEOS, 0, 0, "excludeos"}, {RPMTAG_EXCLUSIVEOS, 0, 0, "exclusiveos"}, -/* {RPMTAG_EXCLUDE, 0, 0, "exclude"}, */ -/* {RPMTAG_EXCLUSIVE, 0, 0, "exclusive"}, */ {RPMTAG_ICON, 0, 0, "icon"}, {RPMTAG_PROVIDEFLAGS, 0, 0, "provides"}, {RPMTAG_REQUIREFLAGS, 0, 0, "requires"}, @@ -613,32 +609,28 @@ static struct PreambleRec { {0, 0, 0, 0} }; -static void initPreambleList(void) +static inline void initPreambleList(void) { - struct PreambleRec *p = preambleList; - - while (p->token) { + struct PreambleRec *p; + for (p = preambleList; p->token; p++) p->len = strlen(p->token); - p++; - } } static int findPreambleTag(Spec spec, /*@out@*/int *tag, /*@out@*/char **macro, char *lang) { char *s; - struct PreambleRec *p = preambleList; + struct PreambleRec *p; - if (! p->len) { + if (preambleList[0].len == 0) initPreambleList(); - } - while (p->token && strncasecmp(spec->line, p->token, p->len)) { - p++; + for (p = preambleList; p->token; p++) { + if (!strncasecmp(spec->line, p->token, p->len)) + break; } - if (!p->token) { + if (p->token == NULL) return 1; - } s = spec->line + p->len; SKIPSPACE(s); diff --git a/po/rpm.pot b/po/rpm.pot index 0ad6645..11efa28 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-11-26 16:52-0500\n" +"POT-Creation-Date: 1999-11-26 17:29-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1695,18 +1695,18 @@ msgstr "" msgid "Unknown icon type: %s" msgstr "" -#: build/parsePreamble.c:339 +#: build/parsePreamble.c:338 #, c-format msgid "line %d: Malformed tag: %s" msgstr "" #. Empty field -#: build/parsePreamble.c:347 +#: build/parsePreamble.c:346 #, c-format msgid "line %d: Empty tag: %s" msgstr "" -#: build/parsePreamble.c:370 build/parsePreamble.c:377 +#: build/parsePreamble.c:369 build/parsePreamble.c:376 #, c-format msgid "line %d: Illegal char '-' in %s: %s" msgstr "" @@ -1741,22 +1741,22 @@ msgstr "" msgid "Internal error: Bogus tag %d" msgstr "" -#: build/parsePreamble.c:696 +#: build/parsePreamble.c:688 #, c-format msgid "Bad package specification: %s" msgstr "" -#: build/parsePreamble.c:702 +#: build/parsePreamble.c:694 #, c-format msgid "Package already exists: %s" msgstr "" -#: build/parsePreamble.c:729 +#: build/parsePreamble.c:721 #, c-format msgid "line %d: Unknown tag: %s" msgstr "" -#: build/parsePreamble.c:754 +#: build/parsePreamble.c:746 msgid "Spec file can't use BuildRoot" msgstr "" diff --git a/python/rpmmodule.c b/python/rpmmodule.c index 6b6faf9..4265b8a 100644 --- a/python/rpmmodule.c +++ b/python/rpmmodule.c @@ -4,6 +4,8 @@ #include #include #include +#include /* XXX rpmio.h */ +#include /* XXX rpmio.h */ #include "Python.h" #include "rpmlib.h" diff --git a/python/upgrade.c b/python/upgrade.c index 1bf863c..9916108 100644 --- a/python/upgrade.c +++ b/python/upgrade.c @@ -2,10 +2,13 @@ #include #include #include -#include -#include #include +#include /* XXX rpmio.h */ +#include /* XXX rpmio.h */ + +#include + #include "hash.h" #include "upgrade.h" @@ -102,7 +105,7 @@ static void addLostFiles(rpmdb db, struct pkgSet *psp, struct hash_table *ht) pack = bsearch(&keyaddr, psp->packages, psp->numPackages, sizeof(*psp->packages), (void *)pkgCompare); if (!pack) { - if (headerGetEntry(h, RPMTAG_FILENAMES, NULL, + if (headerGetEntry(h, RPMTAG_OLDFILENAMES, NULL, (void **) &installedFiles, &installedFileCount)) { compareFileList(0, NULL, installedFileCount, installedFiles, ht); @@ -217,7 +220,7 @@ static int findUpgradePackages(rpmdb db, struct pkgSet *psp, DEBUG (("UPGRADE\n")) (*pip)->selected = 1; - if (!headerGetEntry(h, RPMTAG_FILENAMES, NULL, + if (!headerGetEntry(h, RPMTAG_OLDFILENAMES, NULL, (void **) &availFiles, &availFileCount)) { availFiles = NULL; availFileCount = 0; @@ -227,7 +230,7 @@ static int findUpgradePackages(rpmdb db, struct pkgSet *psp, /* Compare the file lists */ installedHeader = rpmdbGetRecord(db, matches.recs[i].recOffset); - if (!headerGetEntry(installedHeader, RPMTAG_FILENAMES, NULL, + if (!headerGetEntry(installedHeader, RPMTAG_OLDFILENAMES, NULL, (void **) &installedFiles, &installedFileCount)) { installedFiles = NULL; @@ -279,7 +282,7 @@ static int removeMovedFilesAlreadyHandled(struct pkgSet *psp, name = NULL; headerGetEntry(h, RPMTAG_NAME, NULL, (void **) &name, NULL); - if (!headerGetEntry(h, RPMTAG_FILENAMES, NULL, + if (!headerGetEntry(h, RPMTAG_OLDFILENAMES, NULL, (void **) &availFiles, &availFileCount)) { availFiles = NULL; availFileCount = 0; @@ -324,7 +327,7 @@ static int findPackagesWithRelocatedFiles(struct pkgSet *psp, availFiles = NULL; availFileCount = 0; - if (headerGetEntry(h, RPMTAG_FILENAMES, NULL, + if (headerGetEntry(h, RPMTAG_OLDFILENAMES, NULL, (void **) &availFiles, &availFileCount)) { for (i = 0; i < availFileCount; i++) { if ((file = htInTable(ht, availFiles[i]))) { -- 2.7.4