From 41d48bb4a2628f71f3958d0bf7b31ea3ed5e4052 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Mon, 6 Feb 2006 21:28:52 +0000 Subject: [PATCH] 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 --- ChangeLog | 32 +++ debian/changelog | 3 + dpkg-deb/main.c | 69 +++--- dpkg-split/main.c | 56 +++-- dselect/main.cc | 62 +++-- po/ChangeLog | 4 + po/bs.po | 448 ++++++++++++++++++------------------ po/ca.po | 559 ++++++++++++++++++++++++--------------------- po/cs.po | 551 ++++++++++++++++++++++++-------------------- po/da.po | 550 ++++++++++++++++++++++++-------------------- po/de.po | 557 +++++++++++++++++++++++--------------------- po/dpkg.pot | 418 ++++++++++++++++----------------- po/el.po | 555 +++++++++++++++++++++++--------------------- po/es.po | 561 ++++++++++++++++++++++++--------------------- po/eu.po | 553 ++++++++++++++++++++++++-------------------- po/fr.po | 571 +++++++++++++++++++++++++--------------------- po/gl.po | 554 ++++++++++++++++++++++++-------------------- po/id.po | 562 ++++++++++++++++++++++++--------------------- po/it.po | 546 ++++++++++++++++++++++++-------------------- po/ja.po | 549 ++++++++++++++++++++++++-------------------- po/ko.po | 548 ++++++++++++++++++++++++-------------------- po/nb.po | 552 ++++++++++++++++++++++++-------------------- po/nl.po | 543 +++++++++++++++++++++++-------------------- po/nn.po | 552 ++++++++++++++++++++++++-------------------- po/pl.po | 554 +++++++++++++++++++++++--------------------- po/pt.po | 550 ++++++++++++++++++++++++-------------------- po/pt_BR.po | 545 +++++++++++++++++++++++-------------------- po/ro.po | 551 ++++++++++++++++++++++++-------------------- po/ru.po | 558 +++++++++++++++++++++++--------------------- po/sk.po | 558 +++++++++++++++++++++++--------------------- po/sv.po | 548 ++++++++++++++++++++++++-------------------- po/tl.po | 563 ++++++++++++++++++++++++--------------------- po/zh_CN.po | 541 +++++++++++++++++++++++-------------------- po/zh_TW.po | 543 +++++++++++++++++++++++-------------------- src/main.c | 134 +++++------ src/query.c | 68 +++--- 36 files changed, 8473 insertions(+), 7195 deletions(-) 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 [