From 8bc8f024e61fc218fe8285e33e645a2bb8df7ed6 Mon Sep 17 00:00:00 2001 From: jbj Date: Wed, 23 Jun 1999 21:01:38 +0000 Subject: [PATCH] Finesse tagName dependency loop. CVS patchset: 3108 CVS date: 1999/06/23 21:01:38 --- CHANGES | 2 +- build/parsePreamble.c | 21 -------------- build/rpmbuild.h | 2 -- lib/Makefile.am | 2 +- lib/query.c | 2 -- lib/rpmlib.h | 1 + lib/tagName.c | 20 +++++++++++++ po/rpm.pot | 78 +++++++++++++++++++++++++-------------------------- rpm.spec | 2 +- 9 files changed, 63 insertions(+), 67 deletions(-) create mode 100644 lib/tagName.c diff --git a/CHANGES b/CHANGES index 3c9a199..cd0b8a6 100644 --- a/CHANGES +++ b/CHANGES @@ -16,7 +16,7 @@ - add new-fangled requires on "libc.so.6(GLIBC_2.1)" (sparc-linux only). - MiNT port (Guido Flohr ). - fix: --rebuilddb with --root dinna remove directory (Michael Andres). - - fix: false fingerprint stat cache hit -- "the tetex problem". + - fix: false fingerprint stat cache hit -- "the tetex problem" (#2727). 3.0 -> 3.0.1 - fix: %verifyscript resurrected (Shing-Gene Yung). diff --git a/build/parsePreamble.c b/build/parsePreamble.c index 929be02..fe00f30 100644 --- a/build/parsePreamble.c +++ b/build/parsePreamble.c @@ -162,27 +162,6 @@ static int checkForValidArchitectures(Spec spec) return 0; } -const char *tagName(int tag) -{ - int i = 0; - static char nameBuf[1024]; - char *s; - - strcpy(nameBuf, "(unknown)"); - while (i < rpmTagTableSize) { - if (tag == rpmTagTable[i].val) { - strcpy(nameBuf, rpmTagTable[i].name + 7); - s = nameBuf+1; - while (*s) { - *s = tolower(*s); - s++; - } - } - i++; - } - return nameBuf; -} - static int checkForRequired(Header h, char *name) { int res = 0; diff --git a/build/rpmbuild.h b/build/rpmbuild.h index 2277bed..f6317da 100644 --- a/build/rpmbuild.h +++ b/build/rpmbuild.h @@ -99,8 +99,6 @@ char *cleanFileName(const char *name); /* from build/parse.h */ -const char *tagName(int tag); - int parseChangelog(Spec spec); int parseDescription(Spec spec); int parseFiles(Spec spec); diff --git a/lib/Makefile.am b/lib/Makefile.am index 3a37faa..9772102 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -23,7 +23,7 @@ librpm_la_SOURCES = \ lookup.c macro.c md5.c md5sum.c \ messages.c misc.c oldheader.c package.c query.c \ rebuilddb.c rpmdb.c rpmerr.c rpmio.c rpmbzio.c rpmlead.c \ - rpmrc.c signature.c stringbuf.c tagtable.c \ + rpmrc.c signature.c stringbuf.c tagName.c tagtable.c \ tread.c uninstall.c verify.c transaction.c problems.c hash.c fprint.c tagtable.c: rpmlib.h diff --git a/lib/query.c b/lib/query.c index 9c18823..5c15d83 100644 --- a/lib/query.c +++ b/lib/query.c @@ -421,8 +421,6 @@ static void printFileInfo(char * name, unsigned int size, unsigned short mode, sizefield, timefield, namefield); } -extern char * specedit; - static void printNewSpecfile(Spec spec) { diff --git a/lib/rpmlib.h b/lib/rpmlib.h index 86b11f4..a5d1c29 100644 --- a/lib/rpmlib.h +++ b/lib/rpmlib.h @@ -628,6 +628,7 @@ int showMatches(QVA_t *qva, rpmdb db, dbiIndexSet matches, QVF_t showPackage); #define QUERY_FOR_CONFIG (1 << 4) #define QUERY_FOR_DUMPFILES (1 << 8) +const char *tagName(int tag); extern char *specedit; extern struct poptOption rpmQueryPoptTable[]; diff --git a/lib/tagName.c b/lib/tagName.c new file mode 100644 index 0000000..f5424ac --- /dev/null +++ b/lib/tagName.c @@ -0,0 +1,20 @@ +#include "system.h" +#include "rpmlib.h" + +const char *tagName(int tag) +{ + int i; + static char nameBuf[128]; /* XXX yuk */ + char *s; + + strcpy(nameBuf, "(unknown)"); + for (i = 0; i < rpmTagTableSize; i++) { + if (tag != rpmTagTable[i].val) + continue; + strcpy(nameBuf, rpmTagTable[i].name + 7); + for (s = nameBuf+1; *s; s++) + *s = tolower(*s); + break; + } + return nameBuf; +} diff --git a/po/rpm.pot b/po/rpm.pot index 30e507a..0aaea20 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-06-19 14:08-0400\n" +"POT-Creation-Date: 1999-06-23 16:54-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -325,7 +325,7 @@ msgstr "" msgid "cannot open file %s\n" msgstr "" -#: ../install.c:202 ../lib/query.c:569 +#: ../install.c:202 ../lib/query.c:567 #, c-format msgid "%s does not appear to be a RPM package\n" msgstr "" @@ -363,7 +363,7 @@ msgstr "" msgid "installing binary packages\n" msgstr "" -#: ../install.c:383 ../lib/query.c:717 +#: ../install.c:383 ../lib/query.c:715 #, c-format msgid "package %s is not installed\n" msgstr "" @@ -1954,93 +1954,93 @@ msgstr "" msgid "OS is not included: %s" msgstr "" -#: ../build/parsePreamble.c:193 +#: ../build/parsePreamble.c:172 #, c-format msgid "%s field must be present in package: %s" msgstr "" -#: ../build/parsePreamble.c:215 +#: ../build/parsePreamble.c:194 #, c-format msgid "Duplicate %s entries in package: %s" msgstr "" -#: ../build/parsePreamble.c:262 +#: ../build/parsePreamble.c:241 #, c-format msgid "Unable to stat icon: %s" msgstr "" -#: ../build/parsePreamble.c:273 +#: ../build/parsePreamble.c:252 #, c-format msgid "Unable to read icon: %s" msgstr "" -#: ../build/parsePreamble.c:283 +#: ../build/parsePreamble.c:262 #, c-format msgid "Unknown icon type: %s" msgstr "" -#: ../build/parsePreamble.c:346 +#: ../build/parsePreamble.c:325 #, c-format msgid "line %d: Malformed tag: %s" msgstr "" #. Empty field -#: ../build/parsePreamble.c:354 +#: ../build/parsePreamble.c:333 #, c-format msgid "line %d: Empty tag: %s" msgstr "" -#: ../build/parsePreamble.c:377 ../build/parsePreamble.c:384 +#: ../build/parsePreamble.c:356 ../build/parsePreamble.c:363 #, c-format msgid "line %d: Illegal char '-' in %s: %s" msgstr "" -#: ../build/parsePreamble.c:422 +#: ../build/parsePreamble.c:401 #, c-format msgid "line %d: BuildRoot can not be \"/\": %s" msgstr "" -#: ../build/parsePreamble.c:435 +#: ../build/parsePreamble.c:414 #, c-format msgid "line %d: Prefixes must not end with \"/\": %s" msgstr "" -#: ../build/parsePreamble.c:447 +#: ../build/parsePreamble.c:426 #, c-format msgid "line %d: Docdir must begin with '/': %s" msgstr "" -#: ../build/parsePreamble.c:459 +#: ../build/parsePreamble.c:438 #, c-format msgid "line %d: Epoch/Serial field must be a number: %s" msgstr "" -#: ../build/parsePreamble.c:522 +#: ../build/parsePreamble.c:501 #, c-format msgid "line %d: Bad BuildArchitecture format: %s" msgstr "" -#: ../build/parsePreamble.c:532 +#: ../build/parsePreamble.c:511 #, c-format msgid "Internal error: Bogus tag %d" msgstr "" -#: ../build/parsePreamble.c:679 +#: ../build/parsePreamble.c:658 #, c-format msgid "Bad package specification: %s" msgstr "" -#: ../build/parsePreamble.c:685 +#: ../build/parsePreamble.c:664 #, c-format msgid "Package already exists: %s" msgstr "" -#: ../build/parsePreamble.c:712 +#: ../build/parsePreamble.c:691 #, c-format msgid "line %d: Unknown tag: %s" msgstr "" -#: ../build/parsePreamble.c:737 +#: ../build/parsePreamble.c:716 msgid "Spec file can't use BuildRoot" msgstr "" @@ -2807,89 +2807,89 @@ msgstr "" msgid "package has neither file owner or id lists" msgstr "" -#: ../lib/query.c:514 +#: ../lib/query.c:512 #, c-format msgid "record number %u\n" msgstr "" -#: ../lib/query.c:518 +#: ../lib/query.c:516 msgid "error: could not read database record\n" msgstr "" -#: ../lib/query.c:547 +#: ../lib/query.c:545 #, c-format msgid "open of %s failed\n" msgstr "" -#: ../lib/query.c:560 +#: ../lib/query.c:558 msgid "old format source packages cannot be queried\n" msgstr "" -#: ../lib/query.c:572 +#: ../lib/query.c:570 #, c-format msgid "query of %s failed\n" msgstr "" -#: ../lib/query.c:593 +#: ../lib/query.c:591 #, c-format msgid "query of specfile %s failed, can't parse\n" msgstr "" -#: ../lib/query.c:627 +#: ../lib/query.c:625 msgid "could not read database record!\n" msgstr "" -#: ../lib/query.c:638 +#: ../lib/query.c:636 #, c-format msgid "group %s does not contain any packages\n" msgstr "" -#: ../lib/query.c:648 +#: ../lib/query.c:646 #, c-format msgid "no package provides %s\n" msgstr "" -#: ../lib/query.c:658 +#: ../lib/query.c:656 #, c-format msgid "no package triggers %s\n" msgstr "" -#: ../lib/query.c:668 +#: ../lib/query.c:666 #, c-format msgid "no package requires %s\n" msgstr "" -#: ../lib/query.c:683 +#: ../lib/query.c:681 #, c-format msgid "file %s: %s\n" msgstr "" -#: ../lib/query.c:686 +#: ../lib/query.c:684 #, c-format msgid "file %s is not owned by any package\n" msgstr "" -#: ../lib/query.c:699 +#: ../lib/query.c:697 #, c-format msgid "invalid package number: %s\n" msgstr "" -#: ../lib/query.c:702 +#: ../lib/query.c:700 #, c-format msgid "package record number: %d\n" msgstr "" -#: ../lib/query.c:705 +#: ../lib/query.c:703 #, c-format msgid "record %d could not be read\n" msgstr "" -#: ../lib/query.c:720 +#: ../lib/query.c:718 #, c-format msgid "error looking for package %s\n" msgstr "" -#: ../lib/query.c:742 +#: ../lib/query.c:740 msgid "rpmQuery: rpmdbOpen() failed\n" msgstr "" diff --git a/rpm.spec b/rpm.spec index f46af0b..7a99271 100644 --- a/rpm.spec +++ b/rpm.spec @@ -2,7 +2,7 @@ Summary: The Red Hat package management system. Name: rpm %define version 3.0.2 Version: %{version} -Release: 0.6 +Release: 0.7 Group: System Environment/Base Source: ftp://ftp.rpm.org/pub/rpm/dist/rpm-3.0.x/rpm-%{version}.tar.gz Copyright: GPL -- 2.7.4