From: Guillem Jover Date: Mon, 6 Feb 2006 21:28:52 +0000 (+0000) Subject: Cleanup and unify program usage and version output, make it more i18n X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=41d48bb4a2628f71f3958d0bf7b31ea3ed5e4052;p=dpkg Cleanup and unify program usage and version output, make it more i18n friendly. Fix wrong gettext usage with interparsed macros. Thanks to Changwoo Ryu for noticing. Closes: #23791 --- diff --git a/ChangeLog b/ChangeLog index 59a801e1..3eb174c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,35 @@ +2006-02-06 Guillem Jover + + * src/main.c (printversion): Do not split strings with a macro in + the middle, use C format arguments. Use printf instead of fputs. + * src/query.c (printversion): Likewise. + * dpkg-deb/main.c (printversion): Likewise. + * dpkg-split/main.c (printversion): Likewise. + + * src/main.c (usage): Use printf instead of fprintf. Uppercase initial + letter for commands descriptions. Quote strings per line. Standarize + indentation. Split globally common strings. Remove program name prefix + from command descriptions. Standarize 'Usage:' and 'Commands:' + headings. Split independent commands into different lines. + * src/query.c (usage): Likewise. + * dpkg-deb/main.c (usage): Likewise. + * dpkg-split/main.c (usage): Likewise. + + * src/main.c (printforhelp): Use 'license' instead of 'licence'. + * src/query.c (printforhelp): Likewise. + + * dselect/main.cc (programdesc): Add version string from ... + (copyrightstring): ... here. Move GPL license notice to ... + (licensestring): ... here. New variable. + (printversion): Use printf instead of fprintf. Give proper arguments + to the new formated strings. Print 'licensestring'. + (usage): Use printf instead of fprintf. Standarize indentation. Add + options descriptions. Add a new line after each section. + (curseson): Do not split strings with a macro in the middle, use + C format arguments. + (refreshmenu): Fix arguments given to 'programdesc' and + 'copyrightstring' variables. Print 'licensestring' variable. + 2006-02-06 Guillem Jover * utils/start-stop-daemon.c (main): When using --chuid set the HOME diff --git a/debian/changelog b/debian/changelog index 04089302..a5d94ca6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,9 @@ dpkg (1.13.14~) UNRELEASED; urgency=low * Make start-stop-daemon print the proper version instead of 'VERSION'. * Set the HOME environment variable when using the --chuid switch in start-stop-daemon. Closes: #295169, #267784 + * Cleanup and unify program usage and version output, make it more i18n + friendly. Fix wrong gettext usage with interparsed macros. + Thanks to Changwoo Ryu for noticing. Closes: #23791 [ Frank Lichtenheld ] * Let dpkg-source ignore comments in the hunk header as used by diff --git a/dpkg-deb/main.c b/dpkg-deb/main.c index 5c1773e6..ecd50390 100644 --- a/dpkg-deb/main.c +++ b/dpkg-deb/main.c @@ -43,56 +43,61 @@ const char* showformat = "${Package}\t${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.\n"), + BACKEND, DPKG_VERSION_ARCH) < 0) werr("stdout"); + if (printf(_("This is free software; see the GNU General Public License version 2 or\n" + "later for copying conditions. There is NO warranty.\n" + "See %s --license for copyright and license details.\n"), + BACKEND) < 0) werr("stdout"); } static void usage(void) { - if (fputs(_( -"Command:\n" -" -b|--build [] build an archive.\n" -" -c|--contents list contents.\n" -" -I|--info [...] show info to stdout.\n" -" -W|--show show information on package(s)\n" -" -f|--field [...] show field(s) to stdout.\n" -" -e|--control [] extract control info.\n" -" -x|--extract extract files.\n" -" -X|--vextract extract & list files.\n" -" --fsys-tarfile output filesystem tarfile.\n" -" -h|--help display this message.\n" -" --version | --licence show version/licence.\n" + if (printf(_( +"Usage: %s [