From 14c94292388f2d1d61165e6fe999a7e508859e5a Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Sat, 1 Sep 2012 17:08:07 +0000 Subject: (copyright) factorize a translated string --- gurpmi.pm | 9 ++------- urpm/args.pm | 12 ++++++++++++ urpme | 11 ++--------- urpmf | 10 +--------- urpmi | 11 ++--------- urpmi.recover | 10 ++-------- urpmq | 11 ++--------- 7 files changed, 23 insertions(+), 51 deletions(-) diff --git a/gurpmi.pm b/gurpmi.pm index 554988f1..0992fa9d 100644 --- a/gurpmi.pm +++ b/gurpmi.pm @@ -36,13 +36,8 @@ our @EXPORT = qw(create_scrolled_window fatal but cancel_n_quit quit add_button_ urpm::select::add_packages_to_priority_upgrade_list('gurpmi', 'perl-Glib', 'perl-Gtk2'); sub usage () { - print N("gurpmi version %s -%s -This is free software and may be redistributed under the terms of the GNU GPL. - -usage: -", $urpm::VERSION, N("Copyright (C) %s by %s", "1999-2010", "Mandriva") - ) . " gurpmi [ ... ] + print urpm::args::copyright('gurpmi', [ '1999-2010', 'Mandriva' ]) + . " gurpmi [ ... ] " . N("Options:") . "\n" . N(" --help - print this help message. ") . N(" --auto - non-interactive mode, assume default answers to questions. diff --git a/urpm/args.pm b/urpm/args.pm index 5bca88d0..eade3974 100644 --- a/urpm/args.pm +++ b/urpm/args.pm @@ -518,6 +518,18 @@ sub parse_cmdline { $ret; } +sub copyright { + my ($prog_name, @copyrights) = @_; + N("%s version %s +%s +This is free software and may be redistributed under the terms of the GNU GPL. + +usage: +", $prog_name, $urpm::VERSION, + join("\n", map { N("Copyright (C) %s by %s", @$_) } @copyrights) + ); +} + 1; __END__ diff --git a/urpme b/urpme index a806921c..1612af7d 100755 --- a/urpme +++ b/urpme @@ -38,15 +38,8 @@ my $yesexpr = N("Yy"); sub usage() { - print N("urpme version %s -%s -This is free software and may be redistributed under the terms of the GNU GPL. - -usage: -", $urpm::VERSION, - N("Copyright (C) %s by %s", "1999-2010", "Mandriva") . - N("Copyright (C) %s by %s", "2012", "Mageia") - ) . N(" --help - print this help message. + print urpm::args::copyright('urpme', [ '1999-2010', 'Mandriva' ], [ '2012', 'Mageia' ]) + . N(" --help - print this help message. ") . N(" --auto - automatically select a package in choices. ") . N(" --auto-orphans - remove orphans ") . N(" --test - verify if the removal can be achieved correctly. diff --git a/urpmf b/urpmf index a6b6ab37..24261b0e 100755 --- a/urpmf +++ b/urpmf @@ -26,15 +26,7 @@ use urpm::msg; use urpm::media; sub usage() { - print N("urpmf version %s -%s -This is free software and may be redistributed under the terms of the GNU GPL. - -usage: urpmf [options] pattern-expression -", $urpm::VERSION, - N("Copyright (C) %s by %s", "2002-2010", "Mandriva") . - N("Copyright (C) %s by %s", "2012", "Mageia") - ) + print urpm::args::copyright('urpmf', [ '2002-2010', 'Mandriva' ], [ '2011-2012', 'Mageia' ]) . N(" --help - print this help message. ") . N(" --version - print this tool's version number. ") . N(" --env - use specific environment (typically a bug report). diff --git a/urpmi b/urpmi index 9fbbb013..26312f38 100755 --- a/urpmi +++ b/urpmi @@ -63,15 +63,8 @@ $ENV{HOME} ||= "/root"; $ENV{USER} ||= "root"; sub usage () { - print N("urpmi version %s -%s -This is free software and may be redistributed under the terms of the GNU GPL. - -usage: -", $urpm::VERSION, - N("Copyright (C) %s by %s", "1999-2010", "Mandriva") . - N("Copyright (C) %s by %s", "2011-2012", "Mageia") - ) . N(" --help - print this help message. + print urpm::args::copyright('urpmi', [ '1999-2010', 'Mandriva' ], [ '2011-2012', 'Mageia' ]) + . N(" --help - print this help message. ") . N(" --media - use only the given media, separated by comma. ") . N(" --excludemedia - do not use the given media, separated by comma. ") . N(" --update - use only update media. diff --git a/urpmi.recover b/urpmi.recover index dc7e4dae..756754a0 100644 --- a/urpmi.recover +++ b/urpmi.recover @@ -25,14 +25,8 @@ our $rollback; our $disable; sub usage () { - print N("urpmi.recover version %s -%s -This is free software and may be redistributed under the terms of the GNU GPL. - -usage: -", $urpm::VERSION, - N("Copyright (C) %s by %s", "2006-2010", "Mandriva") - ) . N(" --help - print this help message. + print urpm::args::copyright('urpmi.recover', [ '2006-2010', 'Mandriva' ]) + . N(" --help - print this help message. ") . N(" --checkpoint - set repackaging start now ") . N(" --noclean - don't clean repackage directory on checkpoint ") . N(" --urpmi-root - use another root for urpmi db & rpm installation. diff --git a/urpmq b/urpmq index e6bb1083..12364bb5 100755 --- a/urpmq +++ b/urpmq @@ -37,15 +37,8 @@ our @names; our @src_names; sub usage() { - print N("urpmq version %s -%s -This is free software and may be redistributed under the terms of the GNU GPL. - -usage: -", $urpm::VERSION, - N("Copyright (C) %s by %s", '2000-2010', 'Mandriva') . - N("Copyright (C) %s by %s", '2012', 'Mandriva') - ) . N(" --help - print this help message. + print urpm::args::copyright('urpmq', $urpm::VERSION, [ '2000-2010', 'Mandriva' ], [ '2012', 'Mageia' ]) + . N(" --help - print this help message. ") . N(" --update - use only update media. ") . N(" --media - use only the given media, separated by comma. ") . N(" --searchmedia - use only the given media to search requested (or updated) packages. -- cgit v1.2.1