summaryrefslogtreecommitdiffstats
path: root/urpmi.addmedia
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2001-06-21 16:30:03 +0000
committerFrancois Pons <fpons@mandriva.com>2001-06-21 16:30:03 +0000
commit6209217b87298a88b2d183a8e3c877772f09b99c (patch)
tree9534cd1e7a5a876371e4b70a6e6b800a28c047c7 /urpmi.addmedia
parentc9c5ea9a5fd441cf32f3ca072b4f226816aaa8d5 (diff)
downloadurpmi-6209217b87298a88b2d183a8e3c877772f09b99c.tar
urpmi-6209217b87298a88b2d183a8e3c877772f09b99c.tar.gz
urpmi-6209217b87298a88b2d183a8e3c877772f09b99c.tar.bz2
urpmi-6209217b87298a88b2d183a8e3c877772f09b99c.tar.xz
urpmi-6209217b87298a88b2d183a8e3c877772f09b99c.zip
*** empty log message ***
Diffstat (limited to 'urpmi.addmedia')
-rwxr-xr-xurpmi.addmedia25
1 files changed, 9 insertions, 16 deletions
diff --git a/urpmi.addmedia b/urpmi.addmedia
index a00a7b6e..9e5a9e7a 100755
--- a/urpmi.addmedia
+++ b/urpmi.addmedia
@@ -20,36 +20,29 @@
#use strict qw(subs vars refs);
use urpm;
-# for i18n
-use POSIX;
-use Locale::GetText;
-setlocale (LC_ALL, "");
-Locale::GetText::textdomain ("urpmi");
-
-import Locale::GetText I_;
-*_ = *I_;
+#- get I18N translation method.
+import urpm _;
sub main {
my ($name, $url, $with, $relative_hdlist) = @_;
- my $usage = sprintf(
-_("usage: urpmi.addmedia <name> <url>
+ my $usage = _("usage: urpmi.addmedia <name> <url>
where <url> is one of
file://<path>
ftp://<login>:<password>@<host>/<path> with <relative filename of hdlist>
ftp://<host>/<path> with <relative filename of hdlist>
http://<host>/<path> with <relative filename of hdlist>
removable_<device>://<path>
-"));
+");
$name or die $usage;
my ($type, $dev) = $url =~ m,^(file|ftp|http|removable_(\w+)(?:_\d+)?)://, or die $usage;
if ($type eq "removable") {
- $dev && -e "/dev/$dev" or die(sprintf _("%s\ndevice `%s' do not exist\n"), $usage, $dev);
+ $dev && -e "/dev/$dev" or die _("%s\ndevice `%s' do not exist\n", $usage, $dev);
} elsif ($with eq "with") {
- $relative_hdlist or die(sprintf _("%s\n<relative path of hdlist> missing\n"), $usage);
+ $relative_hdlist or die _("%s\n<relative path of hdlist> missing\n", $usage);
} elsif ($ftp) {
- $with eq "with" or die(sprintf _("%s\n`with' missing for ftp media\n"), $usage);
+ $with eq "with" or die _("%s\n`with' missing for ftp media\n", $usage);
}
my $urpm = new urpm;
@@ -60,8 +53,8 @@ where <url> is one of
#- check creation of media (during update has been successfull)
my ($medium) = grep { $_->{name} eq $name } @{$urpm->{media}};
- $medium or die(sprintf _("unable to create medium \"%s\"\n"), $name);
- $medium->{modified} and die(sprintf _("unable to update medium \"%s\"\n"), $name);
+ $medium or die _("unable to create medium \"%s\"\n", $name);
+ $medium->{modified} and die _("unable to update medium \"%s\"\n", $name);
}
main(@ARGV);