Add argument to specedit to choose between specs and powertools packages.
authorjbj <devnull@localhost>
Thu, 6 May 1999 23:21:08 +0000 (23:21 +0000)
committerjbj <devnull@localhost>
Thu, 6 May 1999 23:21:08 +0000 (23:21 +0000)
CVS patchset: 3051
CVS date: 1999/05/06 23:21:08

build/spec.c
lib/query.c
po/rpm.pot
rpm.c
rpm.spec
tools/rpmgettext.c

index cbd2c9c..b6cc954 100644 (file)
@@ -3,7 +3,7 @@
 #include "rpmbuild.h"
 #include "buildio.h"
 
-extern int specedit;
+extern char *specedit;
 extern MacroContext globalMacroContext;
 
 static inline void freeTriggerFiles(/*@only@*/ struct TriggerFileEntry *p)
@@ -330,7 +330,7 @@ int addSource(Spec spec, Package pkg, char *field, int tag)
 static inline struct speclines * newSl(void)
 {
     struct speclines *sl;
-    if (!specedit)
+    if (specedit == NULL)
        return NULL;
     sl = malloc(sizeof(struct speclines));
     sl->sl_lines = NULL;
@@ -353,7 +353,7 @@ static inline void freeSl(struct speclines *sl)
 static inline struct spectags * newSt(void)
 {
     struct spectags *st;
-    if (!specedit)
+    if (specedit == NULL)
        return NULL;
     st = malloc(sizeof(struct spectags));
     st->st_t = NULL;
index 39a745e..a5cab38 100644 (file)
@@ -424,7 +424,7 @@ static void showMatches(rpmdb db, dbiIndexSet matches, int queryFlags,
     }
 }
 
-extern int specedit;
+extern char *  specedit;
 
 static void
 printNewSpecfile(Spec spec)
@@ -437,8 +437,6 @@ printNewSpecfile(Spec spec)
     if (sl == NULL || st == NULL)
        return;
 
-#define        SPECSPACKAGE    "specs"
-
     for (i = 0; i < st->st_ntags; i++) {
        char *msgstr;
        struct spectag *t;
@@ -452,7 +450,7 @@ printNewSpecfile(Spec spec)
            sprintf(buf, "%s(%s)", n, tagName(t->t_tag));
            t->t_msgid = strdup(buf);
        }
-       msgstr = strdup(dgettext(SPECSPACKAGE, t->t_msgid));
+       msgstr = strdup(dgettext(specedit, t->t_msgid));
 
        switch(t->t_tag) {
        case RPMTAG_SUMMARY:
@@ -565,7 +563,7 @@ int rpmQuery(const char * prefix, enum rpmQuerySources source, int queryFlags,
            break;
        }
 
-       if (specedit) {
+       if (specedit != NULL) {
            printNewSpecfile(spec);
            freeSpec(spec);
            retcode = 0;
index 7502c5b..033fb97 100644 (file)
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 1999-04-30 12:00-0400\n"
+"POT-Creation-Date: 1999-05-06 18:35-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"
@@ -325,7 +325,7 @@ msgstr ""
 msgid "cannot open file %s\n"
 msgstr ""
 
-#: ../install.c:202 ../lib/query.c:540
+#: ../install.c:202 ../lib/query.c:538
 #, 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:388 ../lib/query.c:685 ../verify.c:243
+#: ../install.c:388 ../lib/query.c:683 ../verify.c:243
 #, c-format
 msgid "package %s is not installed\n"
 msgstr ""
@@ -1544,11 +1544,11 @@ msgstr ""
 msgid "error: could not read database record\n"
 msgstr ""
 
-#: ../lib/query.c:595 ../verify.c:179
+#: ../lib/query.c:593 ../verify.c:179
 msgid "could not read database record!\n"
 msgstr ""
 
-#: ../lib/query.c:519 ../verify.c:198
+#: ../lib/query.c:517 ../verify.c:198
 #, c-format
 msgid "open of %s failed\n"
 msgstr ""
@@ -1558,17 +1558,17 @@ msgstr ""
 msgid "%s is not an RPM\n"
 msgstr ""
 
-#: ../lib/query.c:606 ../verify.c:222
+#: ../lib/query.c:604 ../verify.c:222
 #, c-format
 msgid "group %s does not contain any packages\n"
 msgstr ""
 
-#: ../lib/query.c:654 ../verify.c:232
+#: ../lib/query.c:652 ../verify.c:232
 #, c-format
 msgid "file %s is not owned by any package\n"
 msgstr ""
 
-#: ../lib/query.c:688 ../verify.c:245
+#: ../lib/query.c:686 ../verify.c:245
 #, c-format
 msgid "error looking for package %s\n"
 msgstr ""
@@ -2842,55 +2842,55 @@ msgstr ""
 msgid "querying record number %d\n"
 msgstr ""
 
-#: ../lib/query.c:504
+#: ../lib/query.c:502
 msgid "rpmQuery: rpmdbOpen() failed\n"
 msgstr ""
 
-#: ../lib/query.c:532
+#: ../lib/query.c:530
 msgid "old format source packages cannot be queried\n"
 msgstr ""
 
-#: ../lib/query.c:543
+#: ../lib/query.c:541
 #, c-format
 msgid "query of %s failed\n"
 msgstr ""
 
-#: ../lib/query.c:562
+#: ../lib/query.c:560
 #, c-format
 msgid "query of specfile %s failed, can't parse\n"
 msgstr ""
 
-#: ../lib/query.c:616
+#: ../lib/query.c:614
 #, c-format
 msgid "no package provides %s\n"
 msgstr ""
 
-#: ../lib/query.c:626
+#: ../lib/query.c:624
 #, c-format
 msgid "no package triggers %s\n"
 msgstr ""
 
-#: ../lib/query.c:636
+#: ../lib/query.c:634
 #, c-format
 msgid "no package requires %s\n"
 msgstr ""
 
-#: ../lib/query.c:651
+#: ../lib/query.c:649
 #, c-format
 msgid "file %s: %s\n"
 msgstr ""
 
-#: ../lib/query.c:667
+#: ../lib/query.c:665
 #, c-format
 msgid "invalid package number: %s\n"
 msgstr ""
 
-#: ../lib/query.c:670
+#: ../lib/query.c:668
 #, c-format
 msgid "showing package: %d\n"
 msgstr ""
 
-#: ../lib/query.c:673
+#: ../lib/query.c:671
 #, c-format
 msgid "record %d could not be read\n"
 msgstr ""
diff --git a/rpm.c b/rpm.c
index 4b719d5..cfe3c79 100755 (executable)
--- a/rpm.c
+++ b/rpm.c
@@ -68,7 +68,7 @@ static int replacePackages;
 static char * rootdir;
 static int showrc;
 static int signIt;
-       int specedit = 0;
+       char *specedit = NULL;
 static int test;
 
 static int rpm_version;
@@ -133,7 +133,7 @@ static struct poptOption optionsTable[] = {
  { "root", 'r', POPT_ARG_STRING, &rootdir, 0,  NULL, NULL},
  { "showrc", '\0', 0, &showrc, GETOPT_SHOWRC,  NULL, NULL},
  { "sign", '\0', 0, &signIt, 0,                        NULL, NULL},
- { "specedit", '\0', 0, &specedit, 0,          NULL, NULL},
+ { "specedit", '\0', POPT_ARG_STRING, &specedit, 0,    NULL, NULL},
  { "tarball", 't', POPT_ARG_STRING, 0, 't',    NULL, NULL},
  { "test", '\0', 0, &test, 0,                  NULL, NULL},
  { "timecheck", '\0', POPT_ARG_STRING, 0, GETOPT_TIMECHECK,    NULL, NULL},
index b10401a..919eff9 100644 (file)
--- a/rpm.spec
+++ b/rpm.spec
@@ -2,7 +2,7 @@ Summary: The Red Hat package management system.
 Name: rpm
 %define version 3.0.1
 Version: %{version}
-Release: 5
+Release: 6
 Group: System Environment/Base
 Source: ftp://ftp.rpm.org/pub/rpm/dist/rpm-3.0.x/rpm-%{version}.tar.gz
 Copyright: GPL
index 061c16f..af2d653 100644 (file)
@@ -46,7 +46,7 @@ char *mastercatalogue = NULL;
 
 int gentran = 0;
 
-int specedit = 0;
+char *specedit = NULL;
 
 static const char *
 getTagString(int tval)