Browse Source

Standarize scripts usage output format and at the same time make
the strings easier for the translators. Add '--help' and '--version'
for most of the scripts. Print the usage and version to stdout.

Guillem Jover 18 years ago
parent
commit
5ed5d7e068
60 changed files with 41317 additions and 6542 deletions
  1. 56 0
      ChangeLog
  2. 5 0
      debian/changelog
  3. 7 1
      man/C/dpkg-architecture.1
  4. 4 1
      man/C/dpkg-checkbuilddeps.1
  5. 4 4
      man/C/dpkg-divert.8
  6. 10 5
      man/C/dpkg-source.1
  7. 5 2
      man/C/dpkg-statoverride.8
  8. 3 5
      man/C/update-alternatives.8
  9. 9 0
      man/ChangeLog
  10. 6 0
      po/ChangeLog
  11. 1260 142
      po/bs.po
  12. 1280 142
      po/ca.po
  13. 1287 154
      po/cs.po
  14. 1570 379
      po/da.po
  15. 1276 142
      po/de.po
  16. 1252 142
      po/dpkg.pot
  17. 1279 142
      po/el.po
  18. 1279 142
      po/es.po
  19. 1280 142
      po/eu.po
  20. 1285 144
      po/fr.po
  21. 1281 142
      po/gl.po
  22. 1494 321
      po/hu.po
  23. 1276 142
      po/id.po
  24. 1280 142
      po/it.po
  25. 1277 142
      po/ja.po
  26. 1278 142
      po/ko.po
  27. 1275 142
      po/nb.po
  28. 1822 528
      po/nl.po
  29. 1275 142
      po/nn.po
  30. 1331 176
      po/pl.po
  31. 1338 188
      po/pt.po
  32. 1277 142
      po/pt_BR.po
  33. 1291 159
      po/ro.po
  34. 1416 213
      po/ru.po
  35. 1277 142
      po/sk.po
  36. 1287 160
      po/sv.po
  37. 1278 142
      po/tl.po
  38. 1649 409
      po/vi.po
  39. 1283 182
      po/zh_CN.po
  40. 1274 142
      po/zh_TW.po
  41. 24 10
      scripts/changelog/debian.pl
  42. 20 9
      scripts/cleanup-info.pl
  43. 1 1
      scripts/controllib.pl
  44. 36 21
      scripts/dpkg-architecture.pl
  45. 53 42
      scripts/dpkg-buildpackage.sh
  46. 10 9
      scripts/dpkg-checkbuilddeps.pl
  47. 24 12
      scripts/dpkg-distaddfile.pl
  48. 31 28
      scripts/dpkg-divert.pl
  49. 44 33
      scripts/dpkg-genchanges.pl
  50. 37 26
      scripts/dpkg-gencontrol.pl
  51. 15 10
      scripts/dpkg-name.sh
  52. 26 15
      scripts/dpkg-parsechangelog.pl
  53. 22 12
      scripts/dpkg-scanpackages.pl
  54. 25 21
      scripts/dpkg-scansources.pl
  55. 36 22
      scripts/dpkg-shlibdeps.pl
  56. 58 37
      scripts/dpkg-source.pl
  57. 30 17
      scripts/dpkg-statoverride.pl
  58. 36 16
      scripts/install-info.pl
  59. 627 590
      scripts/po/dpkg-dev.pot
  60. 46 24
      scripts/update-alternatives.pl

+ 56 - 0
ChangeLog

@@ -1,3 +1,59 @@
+2006-05-23  Guillem Jover  <guillem@debian.org>
+
+	* scripts/controllib.pl (usageerr): Use usage instead of
+	usageversion.
+	* scripts/dpkg-statoverride.pl (UsageVersion): Rename to ...
+	(usageversion): ... this.
+	* scripts/dpkg-parsechangelog.pl (usageversion): Split into usage
+	and version functions. Print to stdout. Standarize output format.
+	Add '--help' and '--version'.
+	* scripts/dpkg-shlibdeps.pl: Likewise.
+	* scripts/dpkg-distaddfile.pl: Likewise.
+	* scripts/dpkg-gencontrol.pl: Likewise.
+	* scripts/dpkg-genchanges.pl: Likewise.
+	* scripts/dpkg-source.pl: Likewise.
+	* scripts/changelog/debian.pl: Likewise.
+	* scripts/dpkg-statoverride.pl: Likewise. Basename $0.
+	* scripts/dpkg-architecture.pl: Likewise. Do not basename $0,
+	use $progname instead.
+	* scripts/dpkg-checkbuilddeps.pl: Use $progname instead of $me.
+	(me): Remove variable.
+	(usage): Standarize output format. Print to stdout. Add '-h' option.
+	* scripts/dpkg-buildpackage.sh (usageversion): Split into
+	showversion and usage functions. Print to stdout. Standarize output
+	format. Add '--help' and '--version'.
+	(version): Rename variable to ...
+	(changesversion): ... this, otherwise there was no program version
+	shown on output.
+	* scripts/dpkg-scanpackages.pl: Basename $0.
+	(options): Pass a sub to the help option calling usage and exit.
+	Add '--version'.
+	(usage): Switch variable to a function. Print to stdout. Standarize
+	output.
+	(version): New function.
+	* scripts/dpkg-scansources.pl (Version): Rename variable to ...
+	(version): ... this (so it will be automaitcally updated by the
+	Makefile).
+	(Option_spec): Pass \&usage to help option and \&version to version.
+	(Usage): Remove variable.
+	(version): New function.
+	(usage): Move xwarn call to where the actual check is made. Replace
+	the die call with a printf and an exit.
+	* scripts/dpkg-name.sh: Standarize output format.
+	* scripts/dpkg-divert.pl: Basename $0.
+	(showversion): Rename to ...
+	(version): ... this. Print to stdout. Standarize output format.
+	* scripts/update-alternatives.pl: Basename $0.
+	(usageversion): Split into usage and version functions. Print to
+	stdout. Standarize output format.
+	* scripts/cleanup-info.pl: Basename $0.
+	(version): Print to stdout. Standarize output format.
+	(usage): Likewise. Print option descriptions.
+	* scripts/install-info.pl: Basename $0. Add '--version'. On
+	argument error print only usage.
+	(version): Print to stdout. Standarize output format.
+	(usage): Likewise. Print option descriptions.
+
 2006-05-19  David Lopez Moreno  <david.lopez.moreno@hispalinux.es>
 
 	* dpkg-deb/build.c (do_build): If failing to stat a

+ 5 - 0
debian/changelog

@@ -56,6 +56,11 @@ dpkg (1.13.20~) UNRELEASED; urgency=low
     configuration file. Closes: #316551
   * Fix the --force-depends-version option. Closes: #57104
 
+  [ Guillem Jover ]
+  * Standarize scripts usage output format and at the same time make
+    the strings easier for the translators. Add '--help' and '--version'
+    for most of the scripts. Print the usage and version to stdout.
+
   [ Updated dpkg Translations ]
   * Portuguese (Miguel Figueiredo).
   * Polish (Robert Luberda).

+ 7 - 1
man/C/dpkg-architecture.1

@@ -1,4 +1,4 @@
-.TH dpkg\-architecture 1 "2006-05-04" "Debian Project" "dpkg utilities"
+.TH dpkg\-architecture 1 "2006-05-23" "Debian Project" "dpkg utilities"
 .SH "NAME"
 dpkg\-architecture \- set and determine the architecture for package building
 .
@@ -67,6 +67,12 @@ the determined value.
 .TP
 .B \-L
 Print a list of valid architecture names.
+.TP
+.BR \-\-help
+Print a usage message.
+.TP
+.B \-\-version
+Print program version.
 .
 .SH "TERMS"
 .IP "build machine" 4

+ 4 - 1
man/C/dpkg-checkbuilddeps.1

@@ -1,4 +1,4 @@
-.TH dpkg\-checkbuilddeps 1 "2006-02-28" "Debian Project" "dpkg utilities"
+.TH dpkg\-checkbuilddeps 1 "2006-05-23" "Debian Project" "dpkg utilities"
 .SH NAME
 dpkg\-checkbuilddeps - check build dependencies and conflicts
 .
@@ -18,6 +18,9 @@ may be specified on the command line.
 .B \-B
 Ignore \fIBuild\-Depends\-Indep\fR lines. Use when no arch-indep packages will
 be built.
+.TP
+.B \-h
+Print a usage message.
 .
 .SH AUTHOR
 Copyright 2001 Joey Hess

+ 4 - 4
man/C/dpkg-divert.8

@@ -1,4 +1,4 @@
-.TH dpkg\-divert 8 "2006-05-04" "Debian Project" "dpkg utilities"
+.TH dpkg\-divert 8 "2006-05-23" "Debian Project" "dpkg utilities"
 .SH NAME
 dpkg\-divert - override a package's version of a file
 .
@@ -47,9 +47,6 @@ Set the dpkg data directory to \fI<directory>\fP (default: \fI/var/lib/dpkg\fP).
 .BI \-\-divert " <divert-to>"
 \fI<divert-to>\fP is the name used by other packages' versions.
 .TP
-.B \-\-help
-Output the version and the short usage instructions, and exit successfully.
-.TP
 .B \-\-local
 Specifies that all packages' versions are diverted.
 .TP
@@ -67,6 +64,9 @@ in case the destination file already exists.
 .B \-\-test
 Test mode, i.e. don't actually perform any changes, just demonstrate.
 .TP
+.B \-\-help
+Output short usage instructions, and exit successfully.
+.TP
 .B \-\-version
 Output program name and version and exit successfully.
 .

+ 10 - 5
man/C/dpkg-source.1

@@ -1,5 +1,5 @@
 .\" Authors: Ian Jackson
-.TH dpkg\-source 1 "2006-02-28" "Debian Project" "dpkg utilities"
+.TH dpkg\-source 1 "2006-05-23" "Debian Project" "dpkg utilities"
 .SH NAME
 dpkg\-source, dpkg\-gencontrol, dpkg\-shlibdeps, dpkg\-genchanges,
 dpkg\-buildpackage, dpkg\-distaddfile, dpkg\-parsechangelog
@@ -94,10 +94,15 @@ separate argument.
 Many of these programs share options; these are described here,
 together with the programs that accept them.
 .TP
-.BI \-h
-Display the particular program's version and usage message, including
-a synopsis of the options it understands. This option is understood
-by all the source package tools.
+.BR \-h , \-\-help
+Display the particular program's usage message, including a synopsis of
+the options it understands.
+This option is understood by all the source package tools.
+.TP
+.BR \-\-version
+Display the particular program's version, including copyright and license
+information.
+This option is understood by all the source package tools.
 .TP
 .BI \-v version
 In

+ 5 - 2
man/C/dpkg-statoverride.8

@@ -1,4 +1,4 @@
-.TH dpkg\-statoverride 8 "2006-05-04" "Debian project" "dpkg utilities"
+.TH dpkg\-statoverride 8 "2006-05-23" "Debian project" "dpkg utilities"
 .SH NAME
 dpkg\-statoverride - override ownership and mode of files
 .
@@ -61,7 +61,10 @@ exists.
 Be less verbose about what we do.
 .TP
 .B \-\-help
-Show version, copyright and usage information.
+Show usage information.
+.TP
+.B \-\-version
+Show program version and copyright.
 .TP
 .B \-\-admindir
 Change the directory of the dpkg database where the statoverride file is

+ 3 - 5
man/C/update-alternatives.8

@@ -5,7 +5,7 @@
 .\" by the Free Software Foundation; either version 2 of the License, or
 .\" (at your option) any later version.  There is NO WARRANTY.  You can
 .\" find the GNU GPL in /usr/share/common-licenses/GPL on any Debian system.
-.TH update\-alternatives 8 "2006-02-28" "Debian Project" "dpkg utilities"
+.TH update\-alternatives 8 "2006-05-23" "Debian Project" "dpkg utilities"
 .SH NAME
 update\-alternatives - maintain symbolic links determining default commands
 .
@@ -293,14 +293,12 @@ Don't actually do anything, just say what would be done.
 This option is not yet implemented.
 .TP
 .B \-\-help
-Give some usage information (and say which version of
-.B update\-alternatives
-this is).
+Give some usage information.
 .TP
 .B \-\-version
 Tell which version of
 .B update\-alternatives
-this is (and give some usage information).
+this is.
 .TP
 \fB\-\-altdir\fR \fIdirectory\fR
 Specifies the alternatives directory, when this is to be

+ 9 - 0
man/ChangeLog

@@ -1,3 +1,12 @@
+2006-05-23  Guillem Jover  <guillem@debian.org>
+
+	* C/dpkg-source.1: Add '--help' and '--version' options.
+	* C/dpkg-architecture.1: Likewise.
+	* C/dpkg-checkbuilddeps.1: Add '-h' option.
+	* C/dpkg-divert.8: Option '--help' does not print the version anymore.
+	* C/update-alternatives.8: Likewise.
+	* C/dpkg-statoverride.8: Likewise. Add '--version' option.
+
 2006-05-21  Nicolas Francois  <nicolas.francois@centraliens.net>
 
 	* man/*/*.po, man/C/po/*.pot, po4a/: Ease the work of i18n robots: make a

+ 6 - 0
po/ChangeLog

@@ -1,3 +1,9 @@
+2006-05-23  Guillem Jover  <guillem@debian.org>
+
+	* dpkg.pot: Regenerated.
+	* *.po: Merged with dpkg.pot. Formerly complete translations
+	become 742t76f121u.
+
 2006-05-15  Eddy Petrişor  <eddy.petrisor@gmail.com>
 
 	* ro.po: Fixed some consitency issues;

File diff suppressed because it is too large
+ 1260 - 142
po/bs.po


File diff suppressed because it is too large
+ 1280 - 142
po/ca.po


File diff suppressed because it is too large
+ 1287 - 154
po/cs.po


File diff suppressed because it is too large
+ 1570 - 379
po/da.po


File diff suppressed because it is too large
+ 1276 - 142
po/de.po


File diff suppressed because it is too large
+ 1252 - 142
po/dpkg.pot


File diff suppressed because it is too large
+ 1279 - 142
po/el.po


File diff suppressed because it is too large
+ 1279 - 142
po/es.po


File diff suppressed because it is too large
+ 1280 - 142
po/eu.po


File diff suppressed because it is too large
+ 1285 - 144
po/fr.po


File diff suppressed because it is too large
+ 1281 - 142
po/gl.po


File diff suppressed because it is too large
+ 1494 - 321
po/hu.po


File diff suppressed because it is too large
+ 1276 - 142
po/id.po


File diff suppressed because it is too large
+ 1280 - 142
po/it.po


File diff suppressed because it is too large
+ 1277 - 142
po/ja.po


File diff suppressed because it is too large
+ 1278 - 142
po/ko.po


File diff suppressed because it is too large
+ 1275 - 142
po/nb.po


File diff suppressed because it is too large
+ 1822 - 528
po/nl.po


File diff suppressed because it is too large
+ 1275 - 142
po/nn.po


File diff suppressed because it is too large
+ 1331 - 176
po/pl.po


File diff suppressed because it is too large
+ 1338 - 188
po/pt.po


File diff suppressed because it is too large
+ 1277 - 142
po/pt_BR.po


File diff suppressed because it is too large
+ 1291 - 159
po/ro.po


File diff suppressed because it is too large
+ 1416 - 213
po/ru.po


File diff suppressed because it is too large
+ 1277 - 142
po/sk.po


File diff suppressed because it is too large
+ 1287 - 160
po/sv.po


File diff suppressed because it is too large
+ 1278 - 142
po/tl.po


File diff suppressed because it is too large
+ 1649 - 409
po/vi.po


File diff suppressed because it is too large
+ 1283 - 182
po/zh_CN.po


File diff suppressed because it is too large
+ 1274 - 142
po/zh_TW.po


+ 24 - 10
scripts/changelog/debian.pl

@@ -22,22 +22,36 @@ $progname= "parsechangelog/$progname";
 
 $since='';
 
-sub usageversion {
-    print STDERR _g(
-"Debian %s %s.  Copyright (C) 1996
-Ian Jackson.  This is free software; see the GNU General Public Licence
-version 2 or later for copying conditions.  There is NO warranty.
-
-Usage: %s [-v<versionsince>] | -h
-"), $progname, $version, $progname;
+sub version {
+    printf _g("Debian %s version %s.\n"), $progname, $version;
+
+    printf _g("
+Copyright (C) 1996 Ian Jackson.");
+    printf _g("
+This is free software; see the GNU General Public Licence version 2 or
+later for copying conditions. There is NO warranty.
+");
+}
+
+sub usage {
+    printf _g(
+"Usage: %s [<option>]
+
+Options:
+  -v<versionsince>    print changes since <versionsince>.
+  -h, --help          print this help message.
+      --version       print program version.
+"), $progname;
 }
 
 while (@ARGV) {
     $_=shift(@ARGV);
     if (m/^-v(.+)$/) {
         $since= $1;
-    } elsif (m/^-h$/) {
-        &usageversion; exit(0);
+    } elsif (m/^-(h|-help)$/) {
+        &usage; exit(0);
+    } elsif (m/^--version$/) {
+        &version; exit(0);
     } else {
         &usageerr(sprintf(_g("unknown option or argument \`%s'"), $_));
     }

+ 20 - 9
scripts/cleanup-info.pl

@@ -29,20 +29,31 @@ push(@INC,$dpkglibdir);
 require 'dpkg-gettext.pl';
 textdomain("dpkg");
 
+($0) = $0 =~ m:.*/(.+):;
+
 my $version = '1.1.6'; # This line modified by Makefile
 sub version {
-    printf STDERR _g(<<END), $version;
-Debian cleanup-info %s.  Copyright (C)1996 Kim-Minh Kaplan.
-This is free software; see the GNU General Public Licence
-version 2 or later for copying conditions.  There is NO warranty.
-END
+    printf _g("Debian %s version %s.\n"), $0, $version;
+
+    printf _g("
+Copyright (C) 1996 Kim-Minh Kaplan.");
+
+    printf _g("
+This is free software; see the GNU General Public Licence version 2 or
+later for copying conditions. There is NO warranty.
+");
 }
 
 sub usage {
-    print STDERR _g(<<'EOF');
-usage: cleanup-info [--version] [--help] [--unsafe] [--] [<dirname>]
-Warning: the ``--unsafe'' option may garble an otherwise correct file
-EOF
+    printf _g(
+"Usage: %s [<option> ...] [--] [<dirname>]
+
+Options:
+  --unsafe     set some additional possibly useful options.
+               warning: this option may garble an otherwise correct file.
+  --help       show this help message.
+  --version    show the version.
+"), $0;
 }
 
 my $infodir = '/usr/info';

+ 1 - 1
scripts/controllib.pl

@@ -413,7 +413,7 @@ sub syserr { die sprintf(_g("%s: failure: %s: %s"), $progname, $_[0], $!)."\n";
 sub error { die sprintf(_g("%s: error: %s"), $progname, $_[0])."\n"; }
 sub internerr { die sprintf(_g("%s: internal error: %s"), $progname, $_[0])."\n"; }
 sub warn { if (!$quiet_warnings) { warn sprintf(_g("%s: warning: %s"), $progname, $_[0])."\n"; } }
-sub usageerr { printf(STDERR _g("%s: %s")."\n\n", $progname, "@_"); &usageversion; exit(2); }
+sub usageerr { printf(STDERR _g("%s: %s")."\n\n", $progname, "@_"); &usage; exit(2); }
 sub warnerror { if ($warnable_error) { &warn( @_ ); } else { &error( @_ ); } }
 
 sub subprocerr {

+ 36 - 21
scripts/dpkg-architecture.pl

@@ -20,7 +20,6 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 
 $version="1.0.0"; # This line modified by Makefile
-$0 = `basename $0`; chomp $0;
 
 $dpkglibdir="/usr/lib/dpkg";
 push(@INC,$dpkglibdir);
@@ -31,30 +30,40 @@ textdomain("dpkg-dev");
 
 $pkgdatadir=".";
 
-sub usageversion {
-    printf STDERR _g(
-"Debian %s %s.
-Copyright (C) 2004-2005 Scott James Remnant <scott\@netsplit.com>,
+sub version {
+    printf _g("Debian %s version %s.\n"), $progname, $version;
+
+    printf _g("
 Copyright (C) 1999-2001 Marcus Brinkmann <brinkmd\@debian.org>.
-This is free software; see the GNU General Public Licence
-version 2 or later for copying conditions.  There is NO warranty.
+Copyright (C) 2004-2005 Scott James Remnant <scott\@netsplit.com>.");
+
+    printf _g("
+This is free software; see the GNU General Public Licence version 2 or
+later for copying conditions. There is NO warranty.
+");
+}
+
+sub usage {
+    printf _g(
+"Usage: %s [<option> ...] [<action>]
 
-Usage:
-  %s [<option> ...] [<action>]
 Options:
-       -a<debian-arch>    set current Debian architecture
-       -t<gnu-system>     set current GNU system type
-       -L                 list valid architectures
-       -f                 force flag (override variables set in environment)
+  -a<debian-arch>    set current Debian architecture.
+  -t<gnu-system>     set current GNU system type.
+  -L                 list valid architectures.
+  -f                 force flag (override variables set in environment).
+
 Actions:
-       -l                 list variables (default)
-       -e<debian-arch>    compare with current Debian architecture
-       -i<arch-alias>     check if current Debian architecture is <arch-alias>
-       -q<variable>       prints only the value of <variable>.
-       -s                 print command to set environment variables
-       -u                 print command to unset environment variables
-       -c <command>       set environment and run the command in it.
-"), $0, $version, $0;
+  -l                 list variables (default).
+  -e<debian-arch>    compare with current Debian architecture.
+  -i<arch-alias>     check if current Debian architecture is <arch-alias>.
+  -q<variable>       prints only the value of <variable>.
+  -s                 print command to set environment variables.
+  -u                 print command to unset environment variables.
+  -c <command>       set environment and run the command in it.
+  --help             show this help message.
+  --version          show the version.
+"), $progname;
 }
 
 sub read_cputable {
@@ -209,6 +218,12 @@ while (@ARGV) {
        last;
     } elsif (m/^-L$/) {
        # Handled already
+    } elsif (m/^-(h|-help)$/) {
+       &usage;
+       exit 0;
+    } elsif (m/^--version$/) {
+       &version;
+       exit 0;
     } else {
 	usageerr(sprintf(_g("unknown option \`%s'"), $_));
     }

+ 53 - 42
scripts/dpkg-buildpackage.sh

@@ -5,46 +5,54 @@ set -e
 version="1.10.10"; # This line modified by Makefile
 
 progname="`basename \"$0\"`"
-usageversion () {
-	cat >&2 <<END
-Debian dpkg-buildpackage $version.  
+
+showversion () {
+	echo "Debian $progname version $version."
+
+	echo "
 Copyright (C) 1996 Ian Jackson.
 Copyright (C) 2000 Wichert Akkerman
-This is free software; see the GNU General Public Licence version 2
-or later for copying conditions.  There is NO warranty.
+This is free software; see the GNU General Public Licence version 2 or
+later for copying conditions. There is NO warranty."
+}
+
+usage () {
+	cat <<END
+Usage: $progname [<options> ...]
 
-Usage: dpkg-buildpackage [options]
-Options: -r<gain-root-command>
-         -p<sign-command>
-	 -d            do not check build dependencies and conflicts
-	 -D            check build dependencies and conflicts
-	 -k<keyid>     the key to use for signing
-         -sgpg         the sign-command is called like GPG
-         -spgp         the sign-command is called like PGP 
-         -us           unsigned source
-         -uc           unsigned changes
-         -a<arch>      Debian architecture we build for (implies -d)
-         -b            binary-only, do not build source } also passed to
-         -B            binary-only, no arch-indep files } dpkg-genchanges
-         -S            source only, no binary files     } 
-         -t<system>    set GNU system type  } passed to dpkg-architecture
-         -v<version>   changes since version <version>      }
-         -m<maint>     maintainer for package is <maint>    } 
-         -e<maint>     maintainer for release is <maint>    } only passed
-         -C<descfile>  changes are described in <descfile>  }  to dpkg-
-         -si (default) src includes orig for rev. 0 or 1    } genchanges
-         -sa           uploaded src always includes orig    }
-         -sd           uploaded src is diff and .dsc only   }
-         -sn           force Debian native source format } only passed
-         -s[sAkurKUR]  see dpkg-source for explanation   } to dpkg-source
-         -nc           do not clean source tree (implies -b)
-         -tc           clean source tree when finished
-         -ap           add pause before starting signature process
-         -h            print this message
-         -W            Turn certain errors into warnings.      } passed to
-         -E            When -W is turned on, -E turned it off. } dpkg-source
-         -i[<regex>]   ignore diffs of files matching regex    } only passed
-         -I<filename>  filter out files when building tarballs } to dpkg-source
+Options:
+  -r<gain-root-command>
+  -p<sign-command>
+  -d             do not check build dependencies and conflicts.
+  -D             check build dependencies and conflicts.
+  -k<keyid>      the key to use for signing.
+  -sgpg          the sign-command is called like GPG.
+  -spgp          the sign-command is called like PGP.
+  -us            unsigned source.
+  -uc            unsigned changes.
+  -a<arch>       Debian architecture we build for (implies -d).
+  -b             binary-only, do not build source. } also passed to
+  -B             binary-only, no arch-indep files. } dpkg-genchanges
+  -S             source only, no binary files.     }
+  -t<system>     set GNU system type.           } passed to dpkg-architecture
+  -v<version>    changes since version <version>.      }
+  -m<maint>      maintainer for package is <maint>.    }
+  -e<maint>      maintainer for release is <maint>.    } only passed
+  -C<descfile>   changes are described in <descfile>.  } to dpkg-genchangs
+  -si (default)  src includes orig for rev. 0 or 1.    }
+  -sa            uploaded src always includes orig.    }
+  -sd            uploaded src is diff and .dsc only.   }
+  -sn            force Debian native source format.      } only passed
+  -s[sAkurKUR]   see dpkg-source for explanation.        } to dpkg-source
+  -nc            do not clean source tree (implies -b).
+  -tc            clean source tree when finished.
+  -ap            add pause before starting signature process.
+  -W             turn certain errors into warnings.       } passed to
+  -E             when -W is turned on, -E turned it off.  } dpkg-source
+  -i[<regex>]    ignore diffs of files matching regex.    } only passed
+  -I<filename>   filter out files when building tarballs. } to dpkg-source
+  -h, --help     show this help message.
+      --version  show the version.
 END
 }
 
@@ -64,7 +72,7 @@ checkbuilddep=true
 checkbuilddep_args=''
 binarytarget=binary
 sourcestyle=''
-version=''
+changesversion=''
 since=''
 maint=''
 desc=''
@@ -77,7 +85,10 @@ while [ $# != 0 ]
 do
 	value="`echo x\"$1\" | sed -e 's/^x-.//'`"
 	case "$1" in
-	-h)	usageversion; exit 0 ;;
+	-h|--help)
+		usage; exit 0 ;;
+	--version)
+		showversion; exit 0 ;;
 	-r*)	rootcommand="$value" ;;
 	-p*)	signcommand="$value" ;;
 	-k*)	signkey="$value" ;;
@@ -111,7 +122,7 @@ do
 	-W)	warnable_error=1; passopts="$passopts -W";;
 	-E)	warnable_error=0; passopts="$passopts -E";;
 	*)	echo >&2 "$progname: unknown option or argument $1"
-		usageversion; exit 2 ;;
+		usage; exit 2 ;;
 	esac
 	shift
 done
@@ -145,7 +156,7 @@ mustsetvar () {
 curd="`pwd`"
 dirn="`basename \"$curd\"`"
 mustsetvar package "`dpkg-parsechangelog | sed -n 's/^Source: //p'`" "source package is"
-mustsetvar version "`dpkg-parsechangelog | sed -n 's/^Version: //p'`" "source version is"
+mustsetvar changesversion "`dpkg-parsechangelog | sed -n 's/^Version: //p'`" "source version is"
 if [ -n "$changedby" ]; then maintainer="$changedby";
 elif [ -n "$maint" ]; then maintainer="$maint";
 else mustsetvar maintainer "`dpkg-parsechangelog | sed -n 's/^Maintainer: //p'`" "source changed by"; fi
@@ -156,7 +167,7 @@ if [ x$sourceonly = x ]; then
 else
 	arch=source
 fi
-mustsetvar sversion "`echo \"$version\" | perl -pe 's/^\d+://'`" "source version without epoch"
+mustsetvar sversion "`echo \"$changesversion\" | perl -pe 's/^\d+://'`" "source version without epoch"
 pv="${package}_${sversion}"
 pva="${package}_${sversion}_${arch}"
 

+ 10 - 9
scripts/dpkg-checkbuilddeps.pl

@@ -13,15 +13,16 @@ require 'dpkg-gettext.pl';
 textdomain("dpkg-dev");
 
 sub usage {
-	print STDERR _g(<<EOF);
-Usage: dpkg-checkbuilddeps [-B] [control-file]
-	-B		binary-only, ignore -Indep
-	control-file	control file to process [Default: debian/control]
-EOF
+	printf _g(
+"Usage: %s [<option> ...] [<control-file>]
+
+Options:
+  control-file   control file to process (default: debian/control).
+  -B             binary-only, ignore -Indep.
+  -h             show this help message.
+"), $progname;
 }
 
-my ($me)=$0=~m:.*/(.+):;
-
 my $binary_only=0;
 my $want_help=0;
 if (! GetOptions('-B' => \$binary_only,
@@ -65,11 +66,11 @@ if (! $binary_only && defined($fi{"C Build-Conflicts-Indep"})) {
 }
 
 if (@unmet) {
-	printf STDERR _g("%s: Unmet build dependencies: "), $me;
+	printf STDERR _g("%s: Unmet build dependencies: "), $progname;
 	print STDERR join(" ", @unmet), "\n";
 }
 if (@conflicts) {
-	printf STDERR _g("%s: Build conflicts: "), $me;
+	printf STDERR _g("%s: Build conflicts: "), $progname;
 	print STDERR join(" ", @conflicts), "\n";
 }
 exit 1 if @unmet || @conflicts;

+ 24 - 12
scripts/dpkg-distaddfile.pl

@@ -14,25 +14,37 @@ require 'controllib.pl';
 require 'dpkg-gettext.pl';
 textdomain("dpkg-dev");
 
-sub usageversion {
-    printf STDERR _g(
-"Debian dpkg-distaddfile %s.  Copyright (C) 1996
-Ian Jackson.  This is free software; see the GNU General Public Licence
-version 2 or later for copying conditions.  There is NO warranty.
+sub version {
+    printf _g("Debian %s version %s.\n"), $progname, $version;
 
-Usage:
-  dpkg-distaddfile <filename> <section> <priority>
-Options:  -f<fileslistfile>      write files here instead of debian/files
-          -h                     print this message
-"), $version;
+    printf _g("
+Copyright (C) 1996 Ian Jackson.");
+
+    printf _g("
+This is free software; see the GNU General Public Licence version 2 or
+later for copying conditions. There is NO warranty.
+");
+}
+
+sub usage {
+    printf _g(
+"Usage: %s [<option>...] <filename> <section> <priority>
+
+Options:
+  -f<fileslistfile>        write files here instead of debian/files.
+  -h, --help               show this help message.
+      --version            show the version.
+"), $progname;
 }
 
 while (@ARGV && $ARGV[0] =~ m/^-/) {
     $_=shift(@ARGV);
     if (m/^-f/) {
         $fileslistfile= $';
-    } elsif (m/^-h$/) {
-        &usageversion; exit(0);
+    } elsif (m/^-(h|-help)$/) {
+        &usage; exit(0);
+    } elsif (m/^--version$/) {
+        &version; exit(0);
     } elsif (m/^--$/) {
         last;
     } else {

+ 31 - 28
scripts/dpkg-divert.pl

@@ -3,6 +3,7 @@
 $version= '1.0.11'; # This line modified by Makefile
 $admindir= "/var/lib/dpkg"; # This line modified by Makefile
 $dpkglibdir= "../utils"; # This line modified by Makefile
+($0) = $0 =~ m:.*/(.+):;
 
 push (@INC, $dpkglibdir);
 require 'dpkg-gettext.pl';
@@ -11,43 +12,45 @@ textdomain("dpkg");
 $enoent=`$dpkglibdir/enoent` || die sprintf(_g("Cannot get ENOENT value from %s: %s"), "$dpkglibdir/enoent", $!);
 sub ENOENT { $enoent; }
 
-sub showversion {
-    printf(_g("Debian dpkg-divert %s")."\n", $version) || &quit(sprintf(_g("failed to write version: %s"), $!));
-}
+sub version {
+    printf _g("Debian %s version %s.\n"), $0, $version;
 
-sub usage {
-    &showversion;
-    print STDERR _g(<<EOF)
+    printf _g("
 Copyright (C) 1995 Ian Jackson.
-Copyright (C) 2000,2001 Wichert Akkerman.
+Copyright (C) 2000,2001 Wichert Akkerman.");
 
-This is free software; see the GNU General Public Licence version 2 or later
-for copying conditions. There is NO warranty.
+    printf _g("
+This is free software; see the GNU General Public Licence version 2 or
+later for copying conditions. There is NO warranty.
+");
+}
 
-Usage:
+sub usage {
+    printf(_g(
+"Usage: %s [<option> ...] <command>
 
- dpkg-divert [options] [--add] <file>               - add a diversion
- dpkg-divert [options] --remove <file>              - remove the diversion
- dpkg-divert [options] --list [<glob-pattern>]      - show file diversions
- dpkg-divert [options] --truename <file>            - return the diverted file
+Commands:
+  [--add] <file>           add a diversion.
+  --remove <file>          remove the diversion.
+  --list [<glob-pattern>]  show file diversions.
+  --truename <file>        return the diverted file.
 
-Options: 
-    --package <package>        name of the package whose copy of <file>
-                               will not be diverted.
-    --local                    all packages' versions are diverted.
-    --divert <divert-to>       the name used by other packages' versions.
-    --rename                   actually move the file aside (or back).
-    --quiet                    quiet operation, minimal output
-    --test                     don't do anything, just demonstrate
-    --help                     print this help screen and exit
-    --version                  output version and exit
-    --admindir <directory>     set the directory with the diversions file
+Options:
+  --package <package>      name of the package whose copy of <file> will not
+                             be diverted.
+  --local                  all packages' versions are diverted.
+  --divert <divert-to>     the name used by other packages' versions.
+  --rename                 actually move the file aside (or back).
+  --admindir <directory>   set the directory with the diversions file.
+  --test                   don't do anything, just demonstrate.
+  --quiet                  quiet operation, minimal output.
+  --help                   show this help message.
+  --version                show the version.
 
 When adding, default is --local and --divert <original>.distrib.
 When removing, --package or --local and --divert must match if specified.
 Package preinst/postrm scripts should always specify --package and --divert.
-EOF
-        || &quit(sprintf(_g("failed to write usage: %s"), $!));
+"), $0);
 }
 
 $testmode= 0;
@@ -69,7 +72,7 @@ while (@ARGV) {
     } elsif (m/^--help$/) {
         &usage; exit(0);
     } elsif (m/^--version$/) {
-        &showversion; exit(0);
+        &version; exit(0);
     } elsif (m/^--test$/) {
         $testmode= 1;
     } elsif (m/^--rename$/) {

+ 44 - 33
scripts/dpkg-genchanges.pl

@@ -31,38 +31,47 @@ require 'controllib.pl';
 require 'dpkg-gettext.pl';
 textdomain("dpkg-dev");
 
-sub usageversion {
-    printf STDERR _g(
-"Debian dpkg-genchanges %s. 
+sub version {
+    printf _g("Debian %s version %s.\n"), $progname, $version;
+
+    printf _g("
 Copyright (C) 1996 Ian Jackson.
-Copyright (C) 2000,2001 Wichert Akkerman.
-This is free software; see the GNU General Public Licence version 2 or later
-for copying conditions.  There is NO warranty.
-
-Usage: dpkg-genchanges [options ...]
-
-Options:  -b                     binary-only build - no source files
-          -B                     arch-specific - no source or arch-indep files
-          -S                     source-only upload
-          -c<controlfile>        get control info from this file
-          -l<changelogfile>      get per-version info from this file
-          -f<fileslistfile>      get .deb files list from this file
-          -v<sinceversion>       include all changes later than version
-          -C<changesdescription> use change description from this file
-          -m<maintainer>         override control's maintainer value
-          -e<maintainer>         override changelog's maintainer value
-          -u<uploadfilesdir>     directory with files (default is \`..')
-          -si (default)          src includes orig for debian-revision 0 or 1
-          -sa                    source includes orig src
-          -sd                    source is diff and .dsc only
-          -q                     quiet - no informational messages on stderr
-          -F<changelogformat>    force change log format
-          -V<name>=<value>       set a substitution variable
-          -T<varlistfile>        read variables here, not debian/substvars
-          -D<field>=<value>      override or add a field and value
-          -U<field>              remove a field
-          -h                     print this message
-"), $version;
+Copyright (C) 2000,2001 Wichert Akkerman.");
+
+    printf _g("
+This is free software; see the GNU General Public Licence version 2 or
+later for copying conditions. There is NO warranty.
+");
+}
+
+sub usage {
+    printf _g(
+"Usage: %s [<option> ...]
+
+Options:
+  -b                       binary-only build - no source files.
+  -B                       arch-specific - no source or arch-indep files.
+  -S                       source-only upload.
+  -c<controlfile>          get control info from this file.
+  -l<changelogfile>        get per-version info from this file.
+  -f<fileslistfile>        get .deb files list from this file.
+  -v<sinceversion>         include all changes later than version.
+  -C<changesdescription>   use change description from this file.
+  -m<maintainer>           override control's maintainer value.
+  -e<maintainer>           override changelog's maintainer value.
+  -u<uploadfilesdir>       directory with files (default is \`..').
+  -si (default)            src includes orig for debian-revision 0 or 1.
+  -sa                      source includes orig src.
+  -sd                      source is diff and .dsc only.
+  -q                       quiet - no informational messages on stderr.
+  -F<changelogformat>      force change log format.
+  -V<name>=<value>         set a substitution variable.
+  -T<varlistfile>          read variables here, not debian/substvars.
+  -D<field>=<value>        override or add a field and value.
+  -U<field>                remove a field.
+  -h, --help               show this help message.
+      --version            show the version.
+"), $progname;
 }
 
 $i=100;grep($fieldimps{$_}=$i--,
@@ -113,8 +122,10 @@ while (@ARGV) {
         $remove{$1}= 1;
     } elsif (m/^-V(\w[-:0-9A-Za-z]*)[=:]/) {
         $substvar{$1}= $';
-    } elsif (m/^-h$/) {
-        &usageversion; exit(0);
+    } elsif (m/^-(h|-help)$/) {
+        &usage; exit(0);
+    } elsif (m/^--version$/) {
+        &version; exit(0);
     } else {
         &usageerr(sprintf(_g("unknown option \`%s'"), $_));
     }

+ 37 - 26
scripts/dpkg-gencontrol.pl

@@ -18,32 +18,41 @@ require 'controllib.pl';
 require 'dpkg-gettext.pl';
 textdomain("dpkg-dev");
 
-sub usageversion {
-    printf STDERR _g(
-"Debian dpkg-gencontrol %s. 
-Copyright 1996 Ian Jackson.
-Copyright 2000,2002 Wichert Akkerman.
-This is free software; see the GNU General Public Licence version 2 or later
-for copying conditions.  There is NO warranty.
+sub version {
+    printf _g("Debian %s version %s.\n"), $progname, $version;
 
-Usage: dpkg-gencontrol [options ...]
+    printf _g("
+Copyright (C) 1996 Ian Jackson.
+Copyright (C) 2000,2002 Wichert Akkerman.");
 
-Options:  -p<package>            print control file for package
-          -c<controlfile>        get control info from this file
-          -l<changelogfile>      get per-version info from this file
-          -F<changelogformat>    force change log format
-          -v<forceversion>       set version of binary package
-          -f<fileslistfile>      write files here instead of debian/files
-          -P<packagebuilddir>    temporary build dir instead of debian/tmp
-          -n<filename>           assume the package filename will be <filename>
-          -O                     write to stdout, not .../DEBIAN/control
-          -is, -ip, -isp, -ips   deprecated, ignored for compatibility
-          -D<field>=<value>      override or add a field and value
-          -U<field>              remove a field
-          -V<name>=<value>       set a substitution variable
-          -T<varlistfile>        read variables here, not debian/substvars
-          -h                     print this message
-"), $version;
+    printf _g("
+This is free software; see the GNU General Public Licence version 2 or
+later for copying conditions. There is NO warranty.
+");
+}
+
+sub usage {
+    printf _g(
+"Usage: %s [<option> ...]
+
+Options:
+  -p<package>              print control file for package.
+  -c<controlfile>          get control info from this file.
+  -l<changelogfile>        get per-version info from this file.
+  -F<changelogformat>      force change log format.
+  -v<forceversion>         set version of binary package.
+  -f<fileslistfile>        write files here instead of debian/files.
+  -P<packagebuilddir>      temporary build dir instead of debian/tmp.
+  -n<filename>             assume the package filename will be <filename>.
+  -O                       write to stdout, not .../DEBIAN/control.
+  -is, -ip, -isp, -ips     deprecated, ignored for compatibility.
+  -D<field>=<value>        override or add a field and value.
+  -U<field>                remove a field.
+  -V<name>=<value>         set a substitution variable.
+  -T<varlistfile>          read variables here, not debian/substvars.
+  -h, --help               show this help message.
+      --version            show the version.
+"), $progname;
 }
 
 $i=100;grep($fieldimps{$_}=$i--,
@@ -85,8 +94,10 @@ while (@ARGV) {
         $varlistfile= $';
     } elsif (m/^-n/) {
         $forcefilename= $';
-    } elsif (m/^-h$/) {
-        &usageversion; exit(0);
+    } elsif (m/^-(h|-help)$/) {
+        &usage; exit(0);
+    } elsif (m/^--version$/) {
+        &version; exit(0);
     } else {
         &usageerr(sprintf(_g("unknown option \`%s'"), $_));
     }

+ 15 - 10
scripts/dpkg-name.sh

@@ -31,16 +31,21 @@ show_version () {
 }
 
 usage () {
-	echo "Usage: ${prog} file[s]
-  ${purpose}
-  file.deb changes to <package>_<version>_<architecture>.deb 
-  according to the ``underscores convention''.
-  -a|--no-architecture  No architecture part in filename
-  -o|--overwrite        Overwrite if file exists
-  -k|--symlink          Don't create a new file, but a symlink
-  -s|--subdir [dir]     Move file into subdir (Use with care)
-  -c|--create-dir       Create target dir if not there (Use with care)
-  -h|--help|-v|--version|-l|--license  Show help/version/license"
+	echo "Usage: ${prog} <file>...
+
+${purpose}
+file.deb changes to <package>_<version>_<architecture>.deb
+according to the ``underscores convention''.
+
+Options:
+  -a, --no-architecture    no architecture part in filename.
+  -o, --overwrite          overwrite if file exists.
+  -k, --symlink            don't create a new file, but a symlink.
+  -s, --subdir [dir]       move file into subdir (Use with care).
+  -c, --create-dir         create target dir if not there (Use with care).
+  -h, --help               show this help message.
+  -v, --version            show the version.
+  -l, --license            show license."
 }
 
 fileexists () {

+ 26 - 15
scripts/dpkg-parsechangelog.pl

@@ -17,21 +17,31 @@ require 'controllib.pl';
 require 'dpkg-gettext.pl';
 textdomain("dpkg-dev");
 
-sub usageversion {
-    printf STDERR _g(
-"Debian dpkg-parsechangelog %s.
+sub version {
+    printf _g("Debian %s version %s.\n"), $progname, $version;
+
+    printf _g("
 Copyright (C) 1996 Ian Jackson.
-Copyright (C) 2001 Wichert Akkerman
-This is free software; see the GNU General Public Licence
-version 2 or later for copying conditions.  There is NO warranty.
-
-Usage: dpkg-parsechangelog [<option> ...]
-Options:  -l<changelogfile>      get per-version info from this file
-          -v<sinceversion>       include all changes later than version
-          -F<changelogformat>    force change log format
-          -L<libdir>             look for change log parsers in <libdir>
-          -h                     print this message
-"), $version;
+Copyright (C) 2001 Wichert Akkerman");
+
+    printf _g("
+This is free software; see the GNU General Public Licence version 2 or
+later for copying conditions. There is NO warranty.
+");
+}
+
+sub usage {
+    printf _g(
+"Usage: %s [<option> ...]
+
+Options:
+  -l<changelogfile>        get per-version info from this file.
+  -v<sinceversion>         include all changes later than version.
+  -F<changelogformat>      force change log format.
+  -L<libdir>               look for change log parsers in <libdir>.
+  -h, --help               show this help message.
+      --version            show the version.
+"), $progname;
 }
 
 @ap=();
@@ -44,7 +54,8 @@ while (@ARGV) {
     push(@ap,$_);
     m/^--$/ && last;
     m/^-v/ && next;
-    if (m/^-h$/) { &usageversion; exit(0); }
+    if (m/^-(h|-help)$/) { &usage; exit(0); }
+    if (m/^--version$/) { &version; exit(0); }
     &usageerr("unknown option \`$_'");
 }
 

+ 22 - 12
scripts/dpkg-scanpackages.pl

@@ -9,6 +9,8 @@ use IO::File;
 my $version= '1.2.6'; # This line modified by Makefile
 my $dpkglibdir= "."; # This line modified by Makefile
 
+($0) = $0 =~ m:.*/(.+):;
+
 push(@INC,$dpkglibdir);
 require 'dpkg-gettext.pl';
 textdomain("dpkg-dev");
@@ -50,26 +52,34 @@ my %field_case;
 
 use Getopt::Long qw(:config bundling);
 
-my %options = (help            => 0,
+my %options = (help            => sub { &usage; exit 0; },
+	       version         => \&version,
 	       udeb            => 0,
 	       arch            => undef,
 	       multiversion    => 0,
 	      );
 
-my $result = GetOptions(\%options,'help|h|?','udeb|u!','arch|a=s','multiversion|m!');
+my $result = GetOptions(\%options,'help|h|?','version','udeb|u!','arch|a=s','multiversion|m!');
+
+sub version {
+    printf _g("Debian %s version %s.\n"), $0, $version;
+    exit;
+}
 
-my $usage = _g(
-"dpkg-scanpackages [-u] [-a<arch>] [-m] binarypath overridefile [pathprefix] > Packages
+sub usage {
+    printf _g(
+"Usage: %s [<option> ...] <binarypath> <overridefile> [<pathprefix>] > Packages
 
- Options:
- --udeb, -u scan for udebs
- --arch, -a architecture to scan for
- --multiversion, -m allow multiple versions of a single package
- --help, -h show this help
+Options:
+  -u, --udeb               scan for udebs.
+  -a, --arch <arch>        architecture to scan for.
+  -m, --multiversion       allow multiple versions of a single package.
+  -h, --help               show this help message.
+      --version            show the version.
+"), $0;
+}
 
-");
-print( STDERR $usage ) and exit 1 if not $result or (@ARGV < 2);
-print($usage) and exit if $options{help};
+&usage and exit 1 if not $result and (@ARGV < 2);
 
 my $udeb = $options{udeb};
 my $arch = $options{arch};

+ 25 - 21
scripts/dpkg-scansources.pl

@@ -36,7 +36,7 @@ use Getopt::Long ();
 
 my $Exit = 0;
 (my $Me = $0) =~ s-.*/--;
-my $Version = q$Revision: 1.6.2.1 $ =~ /(\d\S+)/ ? $1 : '?';
+my $version= '1.6.2.1'; # This line modified by Makefile
 
 # %Override is a hash of lists.  The subs following describe what's in
 # the lists.
@@ -63,27 +63,12 @@ my $Src_override = undef;
 
 my @Option_spec = (
     'debug!'		=> \$Debug,
-    'help!'		=> sub { usage() },
+    'help!'		=> \&usage,
     'no-sort|n'		=> \$No_sort,
     'source-override|s=s' => \$Src_override,
-    'version'		=> sub { print "$Me version $Version\n"; exit },
+    'version'		=> \&version,
 );
 
-my $Usage = sprintf(_g(<<EOF), $Me, $Me);
-usage: %s [switch]... binary-dir [override-file [path-prefix]] > Sources
-
-switches:
-        --debug		turn debugging on
-        --help		show this and then die
-    -n, --no-sort	don\'t sort by package before outputting
-    -s, --source-override file
-			use file for additional source overrides, default
-			is regular override file with .src appended
-        --version	show the version and exit
-
-See the man page or \`perldoc %s\' for the full documentation.
-EOF
-
 sub debug {
     print @_, "\n" if $Debug;
 }
@@ -107,9 +92,28 @@ sub xwarn_noerror {
     warn xwarndie_mess @_;
 }
 
+sub version {
+    printf _g("Debian %s version %s.\n"), $Me, $version;
+    exit;
+}
+
 sub usage {
-    xwarn @_ if @_;
-    die $Usage;
+    printf _g(
+"Usage: %s [<option> ...] <binarypath> [<overridefile> [<pathprefix>]] > Sources
+
+Options:
+  -n, --no-sort            don't sort by package before outputting.
+  -s, --source-override <file>
+                           use file for additional source overrides, default
+                           is regular override file with .src appended.
+      --debug              turn debugging on.
+      --help               show this help message.
+      --version            show the version.
+
+See the man page for the full documentation.
+"), $Me;
+
+    exit;
 }
 
 # Getopt::Long has some really awful defaults.  This function loads it
@@ -500,7 +504,7 @@ sub main {
     my (@out);
 
     init;
-    @ARGV >= 1 && @ARGV <= 3 or usage _g("1 to 3 args expected")."\n";
+    @ARGV >= 1 && @ARGV <= 3 or xwarn _g("1 to 3 args expected\n") and usage;
 
     push @ARGV, undef		if @ARGV < 2;
     push @ARGV, ''		if @ARGV < 3;

+ 36 - 22
scripts/dpkg-shlibdeps.pl

@@ -32,29 +32,41 @@ textdomain("dpkg-dev");
 #use strict;
 #use warnings;
 
-sub usageversion {
-    printf STDERR _g(
-"Debian dpkg-shlibdeps %s.
+sub version {
+    printf _g("Debian %s version %s.\n"), $progname, $version;
+
+    printf _g("
 Copyright (C) 1996 Ian Jackson.
 Copyright (C) 2000 Wichert Akkerman.
-Copyright (C) 2006 Frank Lichtenheld.
+Copyright (C) 2006 Frank Lichtenheld.");
+
+    printf _g("
 This is free software; see the GNU General Public Licence version 2 or
-later for copying conditions.  There is NO warranty.
-
-Usage:
-  dpkg-shlibdeps [<option> ...] <executable>|-e<executable> [<option>] ...
-Positional arguments/options (order is significant):
-       <executable>           } include dependencies for <executable>
-       -e<executable>         }  (use -e if <executable> starts with \`-')
-       -d<dependencyfield>    next executable(s) set shlibs:<dependencyfield>
-Overall options (have global effect no matter where placed):
-       -p<varnameprefix>      set <varnameprefix>:* instead of shlibs:*.
-       -O                     print variable settings to stdout
-       -L<localshlibsfile>    shlibs override file, not debian/shlibs.local
-       -T<varlistfile>        update variables here, not debian/substvars
-       -t<type>               set package type (default is deb)
-Dependency fields recognised are %s
-"), $version, join("/",@depfields);
+later for copying conditions. There is NO warranty.
+");
+}
+
+sub usage {
+    printf _g(
+"Usage: %s [<option> ...] <executable>|-e<executable> [<option> ...]
+
+Positional options (order is significant):
+  <executable>             include dependencies for <executable>,
+  -e<executable>           (use -e if <executable> starts with \`-')
+  -d<dependencyfield>      next executable(s) set shlibs:<dependencyfield>.
+
+Options:
+  -p<varnameprefix>        set <varnameprefix>:* instead of shlibs:*.
+  -O                       print variable settings to stdout.
+  -L<localshlibsfile>      shlibs override file, not debian/shlibs.local.
+  -T<varlistfile>          update variables here, not debian/substvars.
+  -t<type>                 set package type (default is deb).
+  -h, --help               show this help message.
+      --version            show the version.
+
+Dependency fields recognised are:
+  %s
+"), $progname, join("/",@depfields);
 }
 
 my ($stdout, @exec, @execfield);
@@ -67,8 +79,10 @@ foreach (@ARGV) {
 	$shlibslocal= $POSTMATCH;
     } elsif (m/^-O$/) {
 	$stdout= 1;
-    } elsif (m/^-h$/) {
-	usageversion; exit(0);
+    } elsif (m/^-(h|-help)$/) {
+	usage; exit(0);
+    } elsif (m/^--version$/) {
+	version; exit(0);
     } elsif (m/^-d/) {
 	$dependencyfield= capit($POSTMATCH);
 	defined($depstrength{$dependencyfield}) ||

+ 58 - 37
scripts/dpkg-source.pl

@@ -57,41 +57,60 @@ $SIG{'INT'} = \&exit_handler;
 $SIG{'HUP'} = \&exit_handler;
 $SIG{'QUIT'} = \&exit_handler;
 
-sub usageversion {
-    printf STDERR _g(
-"Debian dpkg-source %s.  Copyright (C) 1996
-Ian Jackson and Klee Dienes.  This is free software; see the GNU
-General Public Licence version 2 or later for copying conditions.
-There is NO warranty.
-
-Usage:  dpkg-source -x <filename>.dsc [<output-directory>]
-        dpkg-source -b <directory> [<orig-directory>|<orig-targz>|\'\']
-Build options:   -c<controlfile>     get control info from this file
-                 -l<changelogfile>   get per-version info from this file
-                 -F<changelogformat> force change log format
-                 -V<name>=<value>    set a substitution variable
-                 -T<varlistfile>     read variables here, not debian/substvars
-                 -D<field>=<value>   override or add a .dsc field and value
-                 -U<field>           remove a field
-                 -W                  Turn certain errors into warnings. 
-                 -E                  When -W is enabled, -E disables it.
-                 -q                  quiet operation, do not print warnings.
-                 -sa                 auto select orig source (-sA is default)
-                 -i[<regexp>]        filter out files to ignore diffs of.
-                                     Defaults to: '%s'
-                 -I<filename>        filter out files when building tarballs.
-                 -sk                 use packed orig source (unpack & keep)
-                 -sp                 use packed orig source (unpack & remove)
-                 -su                 use unpacked orig source (pack & keep)
-                 -sr                 use unpacked orig source (pack & remove)
-                 -ss                 trust packed & unpacked orig src are same
-                 -sn                 there is no diff, do main tarfile only
-                 -sA,-sK,-sP,-sU,-sR like -sa,-sp,-sk,-su,-sr but may overwrite
-Extract options: -sp (default)       leave orig source packed in current dir
-                 -sn                 do not copy original source to current dir
-                 -su                 unpack original source tree too
-General options: -h                  print this message
-"), $version, $diff_ignore_default_regexp;
+sub version {
+    printf _g("Debian %s version %s.\n"), $progname, $version;
+
+    printf _g("
+Copyright (C) 1996 Ian Jackson and Klee Dienes.");
+
+    printf _g("
+This is free software; see the GNU General Public Licence version 2 or
+later for copying conditions. There is NO warranty.
+");
+}
+
+sub usage {
+    printf _g(
+"Usage: %s [<option> ...] <command>
+
+Commands:
+  -x <filename>.dsc [<output-dir>]
+                           extract source package.
+  -b <dir> [<orig-dir>|<orig-targz>|\'\']
+                           build source package.
+
+Build options:
+  -c<controlfile>          get control info from this file.
+  -l<changelogfile>        get per-version info from this file.
+  -F<changelogformat>      force change log format.
+  -V<name>=<value>         set a substitution variable.
+  -T<varlistfile>          read variables here, not debian/substvars.
+  -D<field>=<value>        override or add a .dsc field and value.
+  -U<field>                remove a field.
+  -W                       turn certain errors into warnings.
+  -E                       when -W is enabled, -E disables it.
+  -q                       quiet operation, do not print warnings.
+  -i[<regexp>]             filter out files to ignore diffs of
+                             (defaults to: '%s').
+  -I<filename>             filter out files when building tarballs.
+  -sa                      auto select orig source (-sA is default).
+  -sk                      use packed orig source (unpack & keep).
+  -sp                      use packed orig source (unpack & remove).
+  -su                      use unpacked orig source (pack & keep).
+  -sr                      use unpacked orig source (pack & remove).
+  -ss                      trust packed & unpacked orig src are same.
+  -sn                      there is no diff, do main tarfile only.
+  -sA,-sK,-sP,-sU,-sR      like -sa,-sk,-sp,-su,-sr but may overwrite.
+
+Extract options:
+  -sp (default)            leave orig source packed in current dir.
+  -sn                      do not copy original source to current dir.
+  -su                      unpack original source tree too.
+
+General options:
+  -h, --help               show this help message.
+      --version            show the version.
+"), $progname, $diff_ignore_default_regexp;
 }
 
 sub handleformat {
@@ -135,8 +154,10 @@ while (@ARGV && $ARGV[0] =~ m/^-/) {
         $substvar{$1}= "$'";
     } elsif (m/^-T/) {
         $varlistfile= "$'";
-    } elsif (m/^-h$/) {
-        &usageversion; exit(0);
+    } elsif (m/^-(h|-help)$/) {
+        &usage; exit(0);
+    } elsif (m/^--version$/) {
+        &version; exit(0);
     } elsif (m/^-W$/) {
         $warnable_error= 1;
     } elsif (m/^-E$/) {

+ 30 - 17
scripts/dpkg-statoverride.pl

@@ -6,6 +6,8 @@ use POSIX qw(:errno_h :signal_h);
 $admindir= "/var/lib/dpkg"; # This line modified by Makefile
 $version= '1.3.0'; # This line modified by Makefile
 
+($0) = $0 =~ m:.*/(.+):;
+
 my $dpkglibdir= "."; # This line modified by Makefile
 push (@INC, $dpkglibdir);
 require 'dpkg-gettext.pl';
@@ -16,27 +18,36 @@ $doforce= 0;
 $doupdate= 0;
 $mode= "";
 
-sub UsageVersion {
-	printf(STDERR _g(<<EOF), $version) || &quit(sprintf(_g("failed to write usage: %s"), $!));
-Debian dpkg-statoverride %s.
-Copyright (C) 2000 Wichert Akkerman.
+sub version {
+	printf _g("Debian %s version %s.\n"), $0, $version;
+
+	printf _g("
+Copyright (C) 2000 Wichert Akkerman.");
 
-This is free software; see the GNU General Public Licence version 2 or later
-for copying conditions.  There is NO warranty.
+	printf _g("
+This is free software; see the GNU General Public Licence version 2 or
+later for copying conditions. There is NO warranty.
+");
+}
 
-Usage:
+sub usage {
+	printf _g(
+"Usage: %s [<option> ...] <command>
 
-  dpkg-statoverride [options] --add <owner> <group> <mode> <file>
-  dpkg-statoverride [options] --remove <file>
-  dpkg-statoverride [options] --list [<glob-pattern>]
+Commands:
+  --add <owner> <group> <mode> <file>
+                           add a new entry into the database.
+  --remove <file>          remove file from the database.
+  --list [<glob-pattern>]  list current overrides in the database.
 
 Options:
-  --update                 immediately update file permissions
-  --force                  force an action even if a sanity check fails
-  --quiet                  quiet operation, minimal output
-  --help                   print this help screen and exit
-  --admindir <directory>   set the directory with the statoverride file
-EOF
+  --admindir <directory>   set the directory with the statoverride file.
+  --update                 immediately update file permissions.
+  --force                  force an action even if a sanity check fails.
+  --quiet                  quiet operation, minimal output.
+  --help                   show this help message.
+  --version                show the version.
+"), $0;
 }
 
 sub CheckModeConflict {
@@ -50,7 +61,9 @@ while (@ARGV) {
 	if (!m/^-/) {
 		unshift(@ARGV,$_); last;
 	} elsif (m/^--help$/) {
-		&UsageVersion; exit(0);
+		&usage; exit(0);
+	} elsif (m/^--version$/) {
+		&version; exit(0);
 	} elsif (m/^--update$/) {
 		$doupdate=1;
 	} elsif (m/^--quiet$/) {

+ 36 - 16
scripts/install-info.pl

@@ -8,30 +8,48 @@ push (@INC, $dpkglibdir);
 require 'dpkg-gettext.pl';
 textdomain("dpkg");
 
+($0) = $0 =~ m:.*/(.+):;
+
 # fixme: sort entries
 # fixme: send to FSF ?
 
 $version= '0.93.42.2'; # This line modified by Makefile
 sub version {
-        $file = $_[0];
-        printf $file _g(<<END), $version;
-Debian install-info %s.  Copyright (C) 1994,1995
-Ian Jackson.  This is free software; see the GNU General Public Licence
-version 2 or later for copying conditions.  There is NO warranty.
-END
+    printf _g("Debian %s version %s.\n"), $0, $version;
+
+    printf _g("
+Copyright (C) 1994,1995 Ian Jackson.");
+
+    printf _g("
+This is free software; see the GNU General Public Licence version 2 or
+later for copying conditions. There is NO warranty.
+");
 }
 
 sub usage {
     $file = $_[0];
-    print $file _g(<<END);
-usage: install-info [--version] [--help] [--debug] [--maxwidth=nnn]
-             [--section regexp title] [--infodir=xxx] [--align=nnn]
-             [--calign=nnn] [--quiet] [--menuentry=xxx] [--info-dir=xxx]
-             [--keep-old] [--description=xxx] [--test]
-             [--remove | --remove-exactly ] [--dir-file=xxx]
-             [--]
-             filename
-END
+    printf $file _g(
+"Usage: %s [<options> ...] [--] <filename>
+
+Options:
+  --section <regexp> <title>
+                           put the new entry in the <regex> matched section
+                           or create a new one with <title> if non-existent.
+  --menuentry=<text>       set the menu entry.
+  --description=<text>     set the description to be used in the menu entry.
+  --info-file=<path>       specify info file to install in the directory.
+  --dir-file=<path>        specify file name of info directory file.
+  --infodir=<directory>    same as '--dir-file=<directory>/dir'.
+  --info-dir=<directory>   likewise.
+  --keep-old               do not replace entries nor remove empty ones.
+  --remove                 remove the entry specified by <filename> basename.
+  --remove-exactly         remove the exact <filename> entry.
+  --test                   enables test mode (no actions taken).
+  --debug                  enables debug mode (show more information).
+  --quiet                  do not show output messages.
+  --help                   show this help message.
+  --version                show the version.
+"), $0;
 }
 
 $dirfile = '/usr/share/info/dir';
@@ -73,6 +91,8 @@ while ($ARGV[0] =~ m/^--/) {
         $remove_exactly=1;
     } elsif ($_ eq '--help') {
         &usage(STDOUT); exit 0;
+    } elsif ($_ eq '--version') {
+        &version; exit 0;
     } elsif ($_ eq '--debug') {
 	open(DEBUG,">&STDERR")
 	    || die sprintf(_g("Could not open stderr for output! %s"), $!)."\n";
@@ -102,7 +122,7 @@ while ($ARGV[0] =~ m/^--/) {
     }
 }
 
-if (!@ARGV) { &version(STDERR); print STDERR "\n"; &usage(STDERR); exit 1; }
+if (!@ARGV) { &usage(STDERR); exit 1; }
 
 if ( !$filename ) {
 	$filename= shift(@ARGV);

File diff suppressed because it is too large
+ 627 - 590
scripts/po/dpkg-dev.pot


+ 46 - 24
scripts/update-alternatives.pl

@@ -7,6 +7,8 @@ push (@INC, $dpkglibdir);
 require 'dpkg-gettext.pl';
 textdomain("dpkg");
 
+($0) = $0 =~ m:.*/(.+):;
+
 # Global variables:
 #  $alink            Alternative we are managing (ie the symlink we're making/removing) (install only)
 #  $name             Name of the alternative (the symlink) we are processing
@@ -31,36 +33,54 @@ textdomain("dpkg");
 $enoent=`$dpkglibdir/enoent` || die sprintf(_g("Cannot get ENOENT value from %s: %s"), "$dpkglibdir/enoent", $!);
 sub ENOENT { $enoent; }
 
-sub usageversion {
-    printf(STDERR _g(<<END), $version)
-Debian update-alternatives %s.
+sub version {
+    printf _g("Debian %s version %s.\n"), $0, $version;
+
+    printf _g("
 Copyright (C) 1995 Ian Jackson.
-Copyright (C) 2000-2002 Wichert Akkerman
-This is free software; see the GNU General Public Licence
-version 2 or later for copying conditions.  There is NO warranty.
-
-Usage: update-alternatives --install <link> <name> <path> <priority>
-                          [--slave <link> <name> <path>] ...
-       update-alternatives --remove <name> <path>
-       update-alternatives --remove-all <name>
-       update-alternatives --auto <name>
-       update-alternatives --display <name>
-       update-alternatives --list <name>
-       update-alternatives --config <name>
-       update-alternatives --set <name> <path>
-       update-alternatives --all
+Copyright (C) 2000-2002 Wichert Akkerman.");
+
+    printf _g("
+This is free software; see the GNU General Public Licence version 2 or
+later for copying conditions. There is NO warranty.
+");
+}
+
+sub usage {
+    printf _g(
+"Usage: %s [<option> ...] <command>
+
+Commands:
+  --install <link> <name> <path> <priority>
+    [--slave <link> <name> <path>] ...
+                           add a group of alternativse to the system.
+  --remove <name> <path>   remove <path> from the <name> group alternative.
+  --remove-all <name>      remove <name> group from the alternatives system.
+  --auto <name>            switch the master link <name> to automatic mode.
+  --display <name>         display information about the <name> group.
+  --list <name>            display all targets of the <name> group.
+  --config <name>          show alternatives for the <name> group and ask the
+                           user to select which one to use.
+  --set <name> <path>      set <path> as alternative for <name>.
+  --all                    call --config on all alternatives.
+
 <name> is the name in /etc/alternatives.
 <path> is the name referred to.
 <link> is the link pointing to /etc/alternatives/<name>.
 <priority> is an integer; options with higher numbers are chosen.
 
-Options:  --verbose|--quiet  --test  --help  --version
-          --altdir <directory>  --admindir <directory>
-END
-        || &quit(sprintf(_g("failed to write usage: %s"), $!));
+Options:
+  --altdir <directory>     change the alternatives directory.
+  --admindir <directory>   change the administrative directory.
+  --test                   don't do anything, just demonstrate.
+  --verbose                verbose operation, more output.
+  --quiet                  quiet operation, minimal output.
+  --help                   show this help message.
+  --version                show the version.
+"), $0;
 }
 sub quit {printf STDERR _g("update-alternatives: %s")."\n", "@_"; exit(2);}
-sub badusage { printf STDERR _g("update-alternatives: %s")."\n\n", "@_"; &usageversion; exit(2); }
+sub badusage { printf STDERR _g("update-alternatives: %s")."\n\n", "@_"; &usage; exit(2); }
 
 $altdir= '/etc/alternatives';
 $admindir= $admindir . '/alternatives';
@@ -80,8 +100,10 @@ while (@ARGV) {
     last if m/^--$/;
     if (!m/^--/) {
         &quit(sprintf(_g("unknown argument \`%s'"), $_));
-    } elsif (m/^--(help|version)$/) {
-        &usageversion; exit(0);
+    } elsif (m/^--help$/) {
+        &usage; exit(0);
+    } elsif (m/^--version$/) {
+        &version; exit(0);
     } elsif (m/^--test$/) {
         $testmode= 1;
     } elsif (m/^--verbose$/) {