Просмотр исходного кода

Fixed printversion(), to allow translations to be done better.

Adam Heath лет назад: 24
Родитель
Сommit
f9e519d4c7
6 измененных файлов с 33 добавлено и 33 удалено
  1. 6 0
      ChangeLog
  2. 6 8
      dpkg-deb/main.c
  3. 2 2
      dselect/main.cc
  4. 6 8
      main/main.c
  5. 7 8
      main/query.c
  6. 6 7
      split/main.c

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+Sat Jun  1 16:45:13 CDT 2002 Adam Heath <doogie@debian.org>
+
+  * dpkg-deb/main.c, main/main.c, main/query.c, dselect/main.cc,
+    split/main.c: Fixed printversion(), to allow translations to be done
+    better.
+
 Sat Jun  1 16:17:59 CDT 2002 Adam Heath <doogie@debian.org>
 
   * po/pt_BR.po: Updated.

+ 6 - 8
dpkg-deb/main.c

@@ -43,14 +43,12 @@
 const char* showformat	= "${pkg:Package}\t${pkg:Version}\n";
 
 static void printversion(void) {
-  if (fputs(_("Debian `"), stdout) < 0) werr("stdout");
-  if (fputs(BACKEND, stdout) < 0) werr("stdout");
-  if (fputs(_("' package archive backend version "), stdout) < 0) werr("stdout");
-  if (fputs(DPKG_VERSION_ARCH ".\n", stdout) < 0) werr("stdout");
-  if (fputs(_("This is free software; see the GNU General Public Licence version 2 or\n"
-	      "later for copying conditions. There is NO warranty.\n"
-	      "See dpkg-deb --licence for details.\n"),
-	    stdout) < 0) werr("stdout");
+  if (printf(_("Debian `%s' package archive backend version %s."), BACKEND, DPKG_VERSION_ARCH) < 0) werr("stdout");
+  if (printf(_("This is free software; see the GNU General Public Licence version 2 or\n"
+             "later for copying conditions. There is NO warranty.\n"
+             "See %s --licence for copyright and license details.\n"),
+           BACKEND) < 0) werr("stdout");
+  if (fflush(stdout) < 0) werr("stdout");
 }
 
 static void usage(void) {

+ 2 - 2
dselect/main.cc

@@ -154,12 +154,12 @@ static const char copyrightstring[]= N_(
       "Copyright (C) 2000,2001 Wichert Akkerman.\n"
       "This is free software; see the GNU General Public Licence version 2\n"
       "or later for copying conditions.  There is NO warranty.  See\n"
-      "dselect --licence for details.\n");
+      "%s --licence for copyright and license details.\n");
 
 static void printversion(void) {
   if (fprintf(stdout,gettext(programdesc),DSELECT) == EOF) werr("stdout");
   if (fprintf(stdout,"\n") == EOF) werr("stdout");
-  if (fprintf(stdout,gettext(copyrightstring), DPKG_VERSION_ARCH) == EOF) werr("stdout");
+  if (fprintf(stdout,gettext(copyrightstring), DPKG_VERSION_ARCH, DSELECT) == EOF) werr("stdout");
 }
 
 static void usage(void) {

+ 6 - 8
main/main.c

@@ -41,14 +41,12 @@
 #include "main.h"
 
 static void printversion(void) {
-  if (fputs(_("Debian GNU/Linux `"), stdout) < 0) werr("stdout");
-  if (fputs(DPKG, stdout) < 0) werr("stdout");
-  if (fputs(_("' package management program version "), stdout) < 0) werr("stdout");
-  if (fputs( DPKG_VERSION_ARCH ".\n", stdout) < 0) werr("stdout");
-  if (fputs(_( "This is free software; see the GNU General Public Licence version 2 or\n"
-		"later for copying conditions.  There is NO warranty.\n"
-		"See " DPKG " --licence for copyright and license details.\n"),
-		 stdout) < 0) werr("stdout");
+  if (printf(_("Debian `%s' package management program version %s."), DPKG, DPKG_VERSION_ARCH) < 0) werr("stdout");
+  if (printf(_("This is free software; see the GNU General Public Licence version 2 or\n"
+             "later for copying conditions. There is NO warranty.\n"
+             "See %s --licence for copyright and license details.\n"),
+           DPKG) < 0) werr("stdout");
+  if (fflush(stdout) < 0) werr("stdout");
 }
 /*
    options that need fixing:

+ 7 - 8
main/query.c

@@ -38,6 +38,7 @@
 #include <config.h>
 #include <dpkg.h>
 #include <dpkg-db.h>
+#include <version.h>
 #include <myopt.h>
 
 #include "filesdb.h"
@@ -427,14 +428,12 @@ void showpackages(const char *const *argv) {
 }
 
 static void printversion(void) {
-  if (fputs(_("Debian `"), stdout) < 0) werr("stdout");
-  if (fputs(DPKGQUERY, stdout) < 0) werr("stdout");
-  if (fputs(_("' package management program query tool\n"), stdout) < 0)
-    werr("stdout");
-  if (fputs(_( "This is free software; see the GNU General Public Licence version 2 or\n"
-		"later for copying conditions.  There is NO warranty.\n"
-		"See " DPKGQUERY " --licence for copyright and license details.\n"),
-		 stdout) < 0) werr("stdout");
+  if (printf(_("Debian `%s' package  management program query tool version %s."), DPKGQUERY, DPKG_VERSION_ARCH) < 0) werr("stdout");
+  if (printf(_("This is free software; see the GNU General Public Licence version 2 or\n"
+             "later for copying conditions. There is NO warranty.\n"
+             "See %s --licence for copyright and license details.\n"),
+           DPKGQUERY) < 0) werr("stdout");
+  if (fflush(stdout) < 0) werr("stdout");
 }
 /*
    options that need fixing:

+ 6 - 7
split/main.c

@@ -34,13 +34,12 @@
 #include "dpkg-split.h"
 
 static void printversion(void) {
-  if (fputs
-      (_("Debian GNU/Linux `dpkg-split' package split/join tool; version "), stdout) < 0) werr ("stdout");
-  if (fputs (DPKG_VERSION_ARCH ".\n", stdout) < 0) werr ("stdout");
-  if (fputs (_("Copyright (C) 1994-1996 Ian Jackson.  This is free software; see the\n"
-       "GNU General Public Licence version 2 or later for copying conditions.\n"
-       "There is NO warranty.  See dpkg-split --licence for details.\n"),
-       stdout) < 0) werr("stdout");
+  if (printf(_("Debian `%s' package split/join tool; version %s."), SPLITTER, DPKG_VERSION_ARCH) < 0) werr("stdout");
+  if (printf(_("This is free software; see the GNU General Public Licence version 2 or\n"
+             "later for copying conditions. There is NO warranty.\n"
+             "See %s --licence for copyright and license details.\n"),
+           SPLITTER) < 0) werr("stdout");
+  if (fflush(stdout) < 0) werr("stdout");
 }
 
 static void usage(void) {