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

Split usage strings to make it easier for translators when those change.
Closes: #323957

Guillem Jover лет назад: 20
Родитель
Сommit
8dabb3837f
7 измененных файлов с 158 добавлено и 99 удалено
  1. 9 0
      ChangeLog
  2. 2 0
      debian/changelog
  3. 33 23
      dpkg-deb/main.c
  4. 24 18
      dpkg-split/main.c
  5. 11 4
      dselect/main.cc
  6. 58 40
      src/main.c
  7. 21 14
      src/query.c

+ 9 - 0
ChangeLog

@@ -1,3 +1,12 @@
+2006-05-02  Guillem Jover  <guillem@debian.org>
+
+	* dselect/main.cc (usage): Split string and align so duped strings get
+	merged.
+	* dpkg-deb/main.c (usage): Likewise.
+	* dpkg-split/main.c (usage): Likewise.
+	* src/query.c (usage): Likewise.
+	* src/main.c (usage): Likewise.
+
 2006-05-02  Guillem Jover  <guillem@debian.org>
 2006-05-02  Guillem Jover  <guillem@debian.org>
 
 
 	* scripts/dpkg-genchanges.pl: Rename dpkg:UpstreamVersion to
 	* scripts/dpkg-genchanges.pl: Rename dpkg:UpstreamVersion to

+ 2 - 0
debian/changelog

@@ -38,6 +38,8 @@ dpkg (1.13.19~) UNRELEASED; urgency=low
   * Rename dpkg:UpstreamVersion to dpkg:Upstream-Version. Make dpkg:Version
   * Rename dpkg:UpstreamVersion to dpkg:Upstream-Version. Make dpkg:Version
     and dpkg:Upstream-Version get the current dpkg versions instead of the
     and dpkg:Upstream-Version get the current dpkg versions instead of the
     ones from the package being built.
     ones from the package being built.
+  * Split usage strings to make it easier for translators when those change.
+    Closes: #323957
 
 
  -- Christian Perrier <bubulle@debian.org>  Sat, 29 Apr 2006 14:28:55 +0200
  -- Christian Perrier <bubulle@debian.org>  Sat, 29 Apr 2006 14:28:55 +0200
 
 

+ 33 - 23
dpkg-deb/main.c

@@ -54,34 +54,44 @@ static void printversion(void) {
 static void usage(void) {
 static void usage(void) {
   if (printf(_(
   if (printf(_(
 "Usage: %s [<option> ...] <command>\n"
 "Usage: %s [<option> ...] <command>\n"
-"\n"
+"\n"), BACKEND) < 0) werr("stdout");
+
+  if (printf(_(
 "Commands:\n"
 "Commands:\n"
-"  -b|--build <directory> [<deb>]    Build an archive.\n"
-"  -c|--contents <deb>               List contents.\n"
-"  -I|--info <deb> [<cfile>...]      Show info to stdout.\n"
-"  -W|--show <deb>                   Show information on package(s)\n"
-"  -f|--field <deb> [<cfield>...]    Show field(s) to stdout.\n"
-"  -e|--control <deb> [<directory>]  Extract control info.\n"
-"  -x|--extract <deb> <directory>    Extract files.\n"
-"  -X|--vextract <deb> <directory>   Extract & list files.\n"
-"  --fsys-tarfile <deb>              Output filesystem tarfile.\n"
-"  -h|--help                         Display this message.\n"
-"  --version                         Show version.\n"
-"  --license | --licence             Show license.\n"
-"\n"
+"  -b|--build <directory> [<deb>]   Build an archive.\n"
+"  -c|--contents <deb>              List contents.\n"
+"  -I|--info <deb> [<cfile> ...]    Show info to stdout.\n"
+"  -W|--show <deb>                  Show information on package(s)\n"
+"  -f|--field <deb> [<cfield> ...]  Show field(s) to stdout.\n"
+"  -e|--control <deb> [<directory>] Extract control info.\n"
+"  -x|--extract <deb> <directory>   Extract files.\n"
+"  -X|--vextract <deb> <directory>  Extract & list files.\n"
+"  --fsys-tarfile <deb>             Output filesystem tarfile.\n"
+"\n")) < 0) werr("stdout");
+
+  if (printf(_(
+"  -h|--help                        Show this help message.\n"
+"  --version                        Show the version.\n"
+"  --license|--licence              Show the copyright licensing terms.\n"
+"\n")) < 0) werr("stdout");
+
+  if (printf(_(
 "<deb> is the filename of a Debian format archive.\n"
 "<deb> is the filename of a Debian format archive.\n"
 "<cfile> is the name of an administrative file component.\n"
 "<cfile> is the name of an administrative file component.\n"
 "<cfield> is the name of a field in the main `control' file.\n"
 "<cfield> is the name of a field in the main `control' file.\n"
-"\n"
+"\n")) < 0) werr("stdout");
+
+  if (printf(_(
 "Options:\n"
 "Options:\n"
-"  --showformat=<format>      Use alternative format for --show.\n"
-"  -D                         Enable debugging output.\n"
-"  --old, --new               Select archive format.\n"
-"  --nocheck                  Suppress control file check (build bad package).\n"
-"  -z#                        Set the compression level when building.\n"
-"  -Z<type>                   Set the compression type to use when building.\n"
-"                             Allowed values: gzip, bzip2, none.\n"
-"\n"), BACKEND) < 0) werr("stdout");
+"  --showformat=<format>            Use alternative format for --show.\n"
+"  -D                               Enable debugging output.\n"
+"  --old, --new                     Select archive format.\n"
+"  --nocheck                        Suppress control file check (build bad\n"
+"                                     packages).\n"
+"  -z#                              Set the compression level when building.\n"
+"  -Z<type>                         Set the compression type used when building.\n"
+"                                     Allowed values: gzip, bzip2, none.\n"
+"\n")) < 0) werr("stdout");
 
 
   if (printf(_(
   if (printf(_(
 "Format syntax:\n"
 "Format syntax:\n"

+ 24 - 18
dpkg-split/main.c

@@ -47,28 +47,34 @@ static void printversion(void) {
 static void usage(void) {
 static void usage(void) {
   if (printf(_(
   if (printf(_(
 "Usage: %s [<option> ...] <command>\n"
 "Usage: %s [<option> ...] <command>\n"
-"\n"
+"\n"), SPLITTER) < 0) werr("stdout");
+
+  if (printf(_(
 "Commands:\n"
 "Commands:\n"
-"  -s|--split <file> [<prefix>]    Split an archive.\n"
-"  -j|--join <part> <part> ...     Join parts together.\n"
-"  -I|--info <part> ...            Display info about a part.\n"
-"  -h|--help                       Show this help message.\n"
-"  --version                       Show the version.\n"
-"  --license                       Show the license.\n"
-"\n"
-"  -a|--auto -o <complete> <part>  Auto-accumulate parts.\n"
-"  -l|--listq                      List unmatched pieces.\n"
-"  -d|--discard [<filename> ...]   Discard unmatched pieces.\n"
-"\n"
+"  -s|--split <file> [<prefix>]     Split an archive.\n"
+"  -j|--join <part> <part> ...      Join parts together.\n"
+"  -I|--info <part> ...             Display info about a part.\n"
+"  -a|--auto -o <complete> <part>   Auto-accumulate parts.\n"
+"  -l|--listq                       List unmatched pieces.\n"
+"  -d|--discard [<filename> ...]    Discard unmatched pieces.\n"
+"\n")) < 0) werr("stdout");
+
+  if (printf(_(
+"  -h|--help                        Show this help message.\n"
+"  --version                        Show the version.\n"
+"  --license|--licence              Show the copyright licensing terms.\n"
+"\n")) < 0) werr("stdout");
+
+  if (printf(_(
 "Options:\n"
 "Options:\n"
-"  --depotdir <directory>          Use <directory> instead of %s/%s.\n"
-"  -S|--partsize <size>            In KiB, for -s (default is 450).\n"
-"  -o|--output <file>              For -j (default is <package>-<version>.deb).\n"
-"  -Q|--npquiet                    Be quiet when -a is not a part.\n"
-"  --msdos                         Generate 8.3 filenames.\n"
+"  --depotdir <directory>           Use <directory> instead of %s/%s.\n"
+"  -S|--partsize <size>             In KiB, for -s (default is 450).\n"
+"  -o|--output <file>               For -j (default is <package>-<version>.deb).\n"
+"  -Q|--npquiet                     Be quiet when -a is not a part.\n"
+"  --msdos                          Generate 8.3 filenames.\n"
 "\n"
 "\n"
 "Exit status: 0 = OK;  1 = -a is not a part;  2 = trouble!\n"),
 "Exit status: 0 = OK;  1 = -a is not a part;  2 = trouble!\n"),
-	     SPLITTER, ADMINDIR, PARTSDIR) < 0) werr("stdout");
+	     ADMINDIR, PARTSDIR) < 0) werr("stdout");
 }
 }
 
 
 const char thisname[]= SPLITTER;
 const char thisname[]= SPLITTER;

+ 11 - 4
dselect/main.cc

@@ -169,20 +169,27 @@ static void usage(void) {
   int i;
   int i;
   if (printf(_(
   if (printf(_(
 "Usage: %s [<option> ...] [<action> ...]\n"
 "Usage: %s [<option> ...] [<action> ...]\n"
-"\n"
+"\n"), DSELECT) < 0) werr("stdout");
+
+  if (printf(_(
 "Options:\n"
 "Options:\n"
 "  --admindir <directory>     Use <directory> instead of %s.\n"
 "  --admindir <directory>     Use <directory> instead of %s.\n"
 "  --expert                   Turn on expert mode.\n"
 "  --expert                   Turn on expert mode.\n"
 "  --debug <file> | -D<file>  Turn on debugging, sending output to <file>.\n"
 "  --debug <file> | -D<file>  Turn on debugging, sending output to <file>.\n"
 "  --colour | --color screenpart:[foreground],[background][:attr[+attr+..]]\n"
 "  --colour | --color screenpart:[foreground],[background][:attr[+attr+..]]\n"
 "                             Configure screen colours.\n"
 "                             Configure screen colours.\n"
+"\n"), ADMINDIR) < 0) werr("stdout");
+
+  if (printf(_(
 "  --help                     Show this help message.\n"
 "  --help                     Show this help message.\n"
 "  --version                  Show the version.\n"
 "  --version                  Show the version.\n"
-"  --license                  Show the license.\n"
-"\n"
+"  --license | --licence      Show the license.\n"
+"\n")) < 0) werr("stdout");
+
+  if (printf(_(
 "Actions:\n"
 "Actions:\n"
 "  access update select install config remove quit\n"
 "  access update select install config remove quit\n"
-"\n"), DSELECT, ADMINDIR) < 0) werr("stdout");
+"\n")) < 0) werr("stdout");
 
 
   printf(_("Screenparts:\n"));
   printf(_("Screenparts:\n"));
   for (i=0; screenparttable[i].name; i++)
   for (i=0; screenparttable[i].name; i++)

+ 58 - 40
src/main.c

@@ -55,44 +55,56 @@ static void printversion(void) {
 static void usage(void) {
 static void usage(void) {
   if (fprintf (stdout, _(
   if (fprintf (stdout, _(
 "Usage: %s [<option> ...] <command>\n"
 "Usage: %s [<option> ...] <command>\n"
-"\n"
+"\n"), DPKG) < 0) werr ("stdout");
+
+  if (fprintf (stdout, _(
 "Commands:\n"
 "Commands:\n"
-"  -i|--install       <.deb file name> ... | -R|--recursive <dir> ...\n"
-"  --unpack           <.deb file name> ... | -R|--recursive <dir> ...\n"
-"  -A|--record-avail  <.deb file name> ... | -R|--recursive <dir> ...\n"
-"  --configure        <package-name> ... | -a|--pending\n"
-"  -r|--remove        <package-name> ... | -a|--pending\n"
-"  -P|--purge         <package-name> ... | -a|--pending\n"
-"  --get-selections [<pattern> ...]     Get list of selections to stdout.\n"
-"  --set-selections                     Set package selections from stdin.\n"
-"  --clear-selections                   Deselect every non-essential package.\n"
-"  --update-avail <Packages-file>       Replace available packages info.\n"
-"  --merge-avail <Packages-file>        Merge with info from file.\n"
-"  --clear-avail                        Erase existing available info.\n"
-"  --forget-old-unavail                 Forget uninstalled unavailable pkgs.\n"
-"  -s|--status <package-name> ...       Display package status details.\n"
-"  -p|--print-avail <package-name> ...  Display available version details.\n"
-"  -L|--listfiles <package-name> ...    List files `owned' by package(s).\n"
-"  -l|--list [<pattern> ...]            List packages concisely.\n"
-"  -S|--search <pattern> ...            Find package(s) owning file(s).\n"
-"  -C|--audit                           Check for broken package(s).\n"
-"  --print-architecture                 Print dpkg architecture.\n"
-"  --compare-versions <a> <rel> <b>     Compare version numbers - see below.\n"
-"  --help                               Show this help message.\n"
-"  --version                            Show the version.\n"
-"  --force-help | -Dh|--debug=help      Help on forcing resp. debugging.\n"
-"  --license | --licence                Print copyright licensing terms.\n"
-"\n"
+"  -i|--install       <.deb file name> ... | -R|--recursive <directory> ...\n"
+"  --unpack           <.deb file name> ... | -R|--recursive <directory> ...\n"
+"  -A|--record-avail  <.deb file name> ... | -R|--recursive <directory> ...\n"
+"  --configure        <package> ... | -a|--pending\n"
+"  -r|--remove        <package> ... | -a|--pending\n"
+"  -P|--purge         <package> ... | -a|--pending\n"
+"  --get-selections [<pattern> ...] Get list of selections to stdout.\n"
+"  --set-selections                 Set package selections from stdin.\n"
+"  --clear-selections               Deselect every non-essential package.\n"
+"  --update-avail <Packages-file>   Replace available packages info.\n"
+"  --merge-avail <Packages-file>    Merge with info from file.\n"
+"  --clear-avail                    Erase existing available info.\n"
+"  --forget-old-unavail             Forget uninstalled unavailable pkgs.\n"
+"  -s|--status <package> ...        Display package status details.\n"
+"  -p|--print-avail <package> ...   Display available version details.\n"
+"  -L|--listfiles <package> ...     List files `owned' by package(s).\n"
+"  -l|--list [<pattern> ...]        List packages concisely.\n"
+"  -S|--search <pattern> ...        Find package(s) owning file(s).\n"
+"  -C|--audit                       Check for broken package(s).\n"
+"  --print-architecture             Print dpkg architecture.\n"
+"  --compare-versions <a> <op> <b>  Compare version numbers - see below.\n"
+"  --force-help                     Show help on forcing.\n"
+"  -Dh|--debug=help                 Show help on debugging.\n"
+"\n")) < 0) werr ("stdout");
+
+  if (fprintf (stdout, _(
+"  -h|--help                        Show this help message.\n"
+"  --version                        Show the version.\n"
+"  --license|--licence              Show the copyright licensing terms.\n"
+"\n")) < 0) werr ("stdout");
+
+  if (fprintf (stdout, _(
 "Use dpkg -b|--build|-c|--contents|-e|--control|-I|--info|-f|--field|\n"
 "Use dpkg -b|--build|-c|--contents|-e|--control|-I|--info|-f|--field|\n"
 " -x|--extract|-X|--vextract|--fsys-tarfile  on archives (type %s --help).\n"
 " -x|--extract|-X|--vextract|--fsys-tarfile  on archives (type %s --help).\n"
-"\n"
+"\n"), BACKEND) < 0) werr ("stdout");
+
+  if (fprintf (stdout, _(
 "For internal use: dpkg --assert-support-predepends | --predep-package |\n"
 "For internal use: dpkg --assert-support-predepends | --predep-package |\n"
 "  --assert-working-epoch | --assert-long-filenames | --assert-multi-conrep.\n"
 "  --assert-working-epoch | --assert-long-filenames | --assert-multi-conrep.\n"
-"\n"
+"\n")) < 0) werr ("stdout");
+
+  if (fprintf (stdout, _(
 "Options:\n"
 "Options:\n"
 "  --admindir=<directory>     Use <directory> instead of %s.\n"
 "  --admindir=<directory>     Use <directory> instead of %s.\n"
-"  --root=<directory>         Install on alternative system rooted elsewhere.\n"
-"  --instdir=<directory>      Change inst'n root without changing admin dir.\n"
+"  --root=<directory>         Install on a different root directory.\n"
+"  --instdir=<directory>      Change installation dir without changing admin dir.\n"
 "  -O|--selected-only         Skip packages not selected for install/upgrade.\n"
 "  -O|--selected-only         Skip packages not selected for install/upgrade.\n"
 "  -E|--skip-same-version     Skip packages whose same version is installed.\n"
 "  -E|--skip-same-version     Skip packages whose same version is installed.\n"
 "  -G|--refuse-downgrade      Skip packages with earlier version than installed.\n"
 "  -G|--refuse-downgrade      Skip packages with earlier version than installed.\n"
@@ -100,21 +112,27 @@ static void usage(void) {
 "  --no-debsig                Do not try to verify package signatures.\n"
 "  --no-debsig                Do not try to verify package signatures.\n"
 "  --no-act|--dry-run|--simulate\n"
 "  --no-act|--dry-run|--simulate\n"
 "                             Just say what we would do - don't do it.\n"
 "                             Just say what we would do - don't do it.\n"
-"  -D|--debug=<octal>         Enable debugging - see -Dhelp or --debug=help.\n"
+"  -D|--debug=<octal>         Enable debugging (see -Dhelp or --debug=help).\n"
 "  --status-fd <n>            Send status change updates to file descriptor <n>.\n"
 "  --status-fd <n>            Send status change updates to file descriptor <n>.\n"
 "  --log=<filename>           Log status changes and actions to <filename>.\n"
 "  --log=<filename>           Log status changes and actions to <filename>.\n"
-"  --ignore-depends=<package>,... Ignore dependencies involving <package>.\n"
-"  --force-...                    Override problems - see --force-help.\n"
-"  --no-force-...|--refuse-...    Stop when problems encountered.\n"
-"  --abort-after <n>              Abort after encountering <n> errors.\n"
-"\n"
+"  --ignore-depends=<package>,...\n"
+"                             Ignore dependencies involving <package>.\n"
+"  --force-...                Override problems (see --force-help).\n"
+"  --no-force-...|--refuse-...\n"
+"                             Stop when problems encountered.\n"
+"  --abort-after <n>          Abort after encountering <n> errors.\n"
+"\n"), ADMINDIR) < 0) werr ("stdout");
+
+  if (fprintf (stdout, _(
 "Comparison operators for --compare-versions are:\n"
 "Comparison operators for --compare-versions are:\n"
 "  lt le eq ne ge gt       (treat empty version as earlier than any version);\n"
 "  lt le eq ne ge gt       (treat empty version as earlier than any version);\n"
 "  lt-nl le-nl ge-nl gt-nl (treat empty version as later than any version);\n"
 "  lt-nl le-nl ge-nl gt-nl (treat empty version as later than any version);\n"
 "  < << <= = >= >> >       (only for compatibility with control file syntax).\n"
 "  < << <= = >= >> >       (only for compatibility with control file syntax).\n"
-"\n"
-"Use `dselect' or `aptitude' for user-friendly package management.\n"),
-	    DPKG, BACKEND, ADMINDIR) < 0) werr ("stdout");
+"\n")) < 0) werr ("stdout");
+
+  if (fprintf (stdout, _(
+"Use `dselect' or `aptitude' for user-friendly package management.\n")) < 0)
+  werr ("stdout");
 }
 }
 
 
 const char thisname[]= "dpkg";
 const char thisname[]= "dpkg";

+ 21 - 14
src/query.c

@@ -476,22 +476,29 @@ static void printversion(void) {
 static void usage(void) {
 static void usage(void) {
   if (printf(_(
   if (printf(_(
 "Usage: %s [<option> ...] <command>\n"
 "Usage: %s [<option> ...] <command>\n"
-"\n"
+"\n"), DPKGQUERY) < 0) werr ("stdout");
+
+  if (printf(_(
 "Commands:\n"
 "Commands:\n"
-"  -s|--status <package-name> ...      Display package status details.\n"
-"  -p|--print-avail <package-name> ... Display available version details.\n"
-"  -L|--listfiles <package-name> ...   List files `owned' by package(s).\n"
-"  -l|--list [<pattern> ...]           List packages concisely.\n"
-"  -W|--show <pattern> ...             Show information on package(s).\n"
-"  -S|--search <pattern> ...           Find package(s) owning file(s).\n"
-"  --help                              Show this help message.\n"
-"  --version                           Show the version.\n"
-"  --license | --licence               Show the copyright licensing terms.\n"
-"\n"
+"  -s|--status <package> ...        Display package status details.\n"
+"  -p|--print-avail <package> ...   Display available version details.\n"
+"  -L|--listfiles <package> ...     List files `owned' by package(s).\n"
+"  -l|--list [<pattern> ...]        List packages concisely.\n"
+"  -W|--show <pattern> ...          Show information on package(s).\n"
+"  -S|--search <pattern> ...        Find package(s) owning file(s).\n"
+"\n")) < 0) werr ("stdout");
+
+  if (printf(_(
+"  -h|--help                        Show this help message.\n"
+"  --version                        Show the version.\n"
+"  --license|--licence              Show the copyright licensing terms.\n"
+"\n")) < 0) werr ("stdout");
+
+  if (printf(_(
 "Options:\n"
 "Options:\n"
-"  --admindir=<directory>              Use <directory> instead of %s.\n"
-"  -f|--showformat=<format>            Use alternative format for --show.\n"
-"\n"), DPKGQUERY, ADMINDIR) < 0) werr ("stdout");
+"  --admindir=<directory>           Use <directory> instead of %s.\n"
+"  -f|--showformat=<format>         Use alternative format for --show.\n"
+"\n"), ADMINDIR) < 0) werr ("stdout");
 
 
   if (printf(_(
   if (printf(_(
 "Format syntax:\n"
 "Format syntax:\n"