summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-04-28 08:57:58 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-04-28 08:57:58 +0000
commit6e0908fc5918ffd8b1a5b00e1c31e5056fb99af1 (patch)
tree59091464f349e55c6b5b88c73ac904e64519598d /urpm
parentc18fd26df23f8cfc8cf0fada3af5d85ef4c33732 (diff)
downloadurpmi-6e0908fc5918ffd8b1a5b00e1c31e5056fb99af1.tar
urpmi-6e0908fc5918ffd8b1a5b00e1c31e5056fb99af1.tar.gz
urpmi-6e0908fc5918ffd8b1a5b00e1c31e5056fb99af1.tar.bz2
urpmi-6e0908fc5918ffd8b1a5b00e1c31e5056fb99af1.tar.xz
urpmi-6e0908fc5918ffd8b1a5b00e1c31e5056fb99af1.zip
Fix locale handling and the --no-locales command-line argument
Diffstat (limited to 'urpm')
-rw-r--r--urpm/args.pm10
-rw-r--r--urpm/msg.pm7
2 files changed, 12 insertions, 5 deletions
diff --git a/urpm/args.pm b/urpm/args.pm
index 947f7193..d5de4bdc 100644
--- a/urpm/args.pm
+++ b/urpm/args.pm
@@ -37,9 +37,13 @@ my %options_spec = (
if (defined &::usage) { ::usage() } else { die "No help defined\n" }
},
"no-locales" => sub {
- require urpm; # make sure it has been loaded
- undef *::N; undef *urpm::N;
- *::N = *urpm::N = sub { sprintf(@_) };
+ require urpm::msg; # make sure it has been loaded
+ undef *::N;
+ undef *urpm::N;
+ undef *urpm::msg::N;
+ undef *urpm::args::N;
+ *::N = *urpm::N = *urpm::msg::N = *urpm::args::N
+ = sub { my ($f, @p) = @_; sprintf($f, @p) };
},
update => \$::update,
'media|mediums=s' => \$::media,
diff --git a/urpm/msg.pm b/urpm/msg.pm
index fb5264c7..d913b233 100644
--- a/urpm/msg.pm
+++ b/urpm/msg.pm
@@ -12,13 +12,16 @@ my $yesexpr = N("Yy");
eval {
require Locale::gettext;
use POSIX qw(LC_ALL);
- setlocale(LC_ALL, "");
+ POSIX::setlocale(LC_ALL, "");
Locale::gettext::textdomain("urpmi");
};
sub N {
my ($format, @params) = @_;
- sprintf(eval { Locale::gettext::gettext($format || '') } || $format, @params);
+ sprintf(
+ eval { Locale::gettext::gettext($format || '') } || $format,
+ @params,
+ );
}
sub log_it {