summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--urpm.pm13
-rwxr-xr-xurpmi6
-rwxr-xr-xurpmi.addmedia25
-rwxr-xr-xurpmi.removemedia17
-rw-r--r--urpmi.spec5
-rwxr-xr-xurpmi.update17
6 files changed, 34 insertions, 49 deletions
diff --git a/urpm.pm b/urpm.pm
index 65442cc4..dd19cf76 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -51,15 +51,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
=cut
use rpmtools;
+use POSIX;
+use Locale::GetText;
#- I18N.
-BEGIN {
- use POSIX;
- use Locale::GetText;
+setlocale (LC_ALL, "");
+Locale::GetText::textdomain ("urpmi");
- setlocale (LC_ALL, "");
- Locale::GetText::textdomain ("urpmi");
-}
sub _ {
my ($format, @params) = @_;
sprintf(Locale::GetText::I_($format), @params);
@@ -819,10 +817,11 @@ sub register_local_packages {
-r $_ or $error = 1, $urpm->{error}(_("unable to access rpm file [%s]", $_)), next;
my ($name) = $urpm->{params}->read_rpms($_);
- if ($name =~ /(.*)-([^-]*)-([^-]*)/) {
+ if ($name =~ /(.*)-([^-]*)-([^-]*)\.([^-\.]*)/) {
my $pkg = $urpm->{params}{info}{$1};
$pkg->{version} eq $2 or $urpm->{error}(_("mismatch version for registering rpm file")), next;
$pkg->{release} eq $3 or $urpm->{error}(_("mismatch release for registering rpm file")), next;
+ $pkg->{arch} eq $4 or $urpm->{error}(_("mismatch arch for registering rpm file")), next;
$pkg->{source} = $1 ? $_ : "./$_";
push @names, $name;
} else {
diff --git a/urpmi b/urpmi
index ea7293da..8b19bcab 100755
--- a/urpmi
+++ b/urpmi
@@ -32,6 +32,7 @@ my $all = 0;
my $complete = 0;
my $minimal = 1;
my $rpm_opt = "-Uvh";
+my $use_provides = 0;
my $verbose = 0;
my $uid;
@@ -59,6 +60,7 @@ usage:
-m - choose minimum closure of requires (default).
-M - choose maximun closure of requires.
-c - choose complete method for resolving requires closure.
+ -p - allow search in provides to find package.
-q - quiet mode.
-v - verbose mode.
@@ -86,6 +88,7 @@ for (@ARGV) {
/m/ and do { $minimal = 1; next };
/M/ and do { $minimal = 0; next };
/q/ and do { $rpm_opt = "-U"; next };
+ /p/ and do { $use_provides = 1; next };
/v/ and do { $verbose = 1; next };
die "urpmi: unknown option \"-%1\", check usage with --help\n"; } next };
@nextargv and do { my $r = shift @nextargv; $r and $$r = $_; next };
@@ -132,6 +135,7 @@ my $urpm = new urpm;
$verbose or $urpm->{log} = sub {};
$urpm->read_depslist;
+$use_provides and $urpm->read_provides;
if (@files) {
$uid == 0 or $urpm->fatal(1, _("Only superuser is allowed to install local packages"));
@@ -141,7 +145,7 @@ if (@files) {
#- read provides file which is needed only to compute incremental
#- dependancies, of files provided.
- $urpm->read_provides;
+ $use_provides or $urpm->read_provides;
#- build closure with local package and return list of names.
push @names, $urpm->register_local_packages(@files);
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);
diff --git a/urpmi.removemedia b/urpmi.removemedia
index 72346e21..a173f248 100755
--- a/urpmi.removemedia
+++ b/urpmi.removemedia
@@ -20,26 +20,19 @@
#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 (@toremoves, %options);
foreach (@_) {
/^--?a/ and $options{all} = 1, next;
- /^-/ and die sprintf(
-_("usage: urpmi.removemedia [-a] <name> ...
+ /^-/ and die _("usage: urpmi.removemedia [-a] <name> ...
where <name> is a medium name to remove.
-a select all media.
-\nunknown options '%s'\n"), $_);
+\nunknown options '%s'\n", $_);
push @toremoves, $_;
}
@@ -50,7 +43,7 @@ where <name> is a medium name to remove.
@toremoves = @entries;
@toremoves == 0 and die _("nothing to remove (use urpmi.addmedia to add a media)\n");
}
- @toremoves == 0 and die sprintf(_("the entry to remove is missing\n(one of %s)\n"), join(", ", @entries));
+ @toremoves == 0 and die _("the entry to remove is missing\n(one of %s)\n", join(", ", @entries));
$urpm->remove_media(@toremoves);
$urpm->update_media(noclean => !$options{all});
diff --git a/urpmi.spec b/urpmi.spec
index b2600d71..5e1d6760 100644
--- a/urpmi.spec
+++ b/urpmi.spec
@@ -2,7 +2,7 @@
Name: urpmi
Version: 1.6
-Release: 1mdk
+Release: 2mdk
License: GPL
Source0: %{name}.tar.bz2
Summary: User mode rpm install
@@ -106,6 +106,9 @@ rm -f /var/lib/urpmi/depslist
%changelog
+* Thu Jun 21 2001 François Pons <fpons@mandrakesoft.com> 1.6-2mdk
+- finished i18n support for urpmi.*media.
+
* Wed Jun 20 2001 François Pons <fpons@mandrakesoft.com> 1.6-1mdk
- simplified urpmf.
- fixed typo in %%post.
diff --git a/urpmi.update b/urpmi.update
index db035fff..0342d96f 100755
--- a/urpmi.update
+++ b/urpmi.update
@@ -20,15 +20,9 @@
#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 (@toupdates, %options);
@@ -39,13 +33,12 @@ sub main {
/^--?c/ and $options{noclean} = 0, next;
/^--?f/ and $options{force} = 1, next;
/^--?noa/ and next; #- default, keeped for compability.
- /^-/ and die sprintf(
-_("usage: urpmi.update [-a] <name> ...
+ /^-/ and die _("usage: urpmi.update [-a] <name> ...
where <name> is a medium name to update.
-a select all non-removable media.
-c clean headers cache directory.
-f force generation of hdlist or base files.
-\nunknown options '%s'\n"), $_);
+\nunknown options '%s'\n", $_);
push @toupdates, $_;
}
@@ -55,7 +48,7 @@ where <name> is a medium name to update.
if ($options{all}) {
@entries == 0 and die _("nothing to update (use urpmi.addmedia to add a media)\n");
} else {
- @toupdates == 0 and die sprintf(_("the entry to update is missing\n(one of %s)\n"), join(", ", @entries));
+ @toupdates == 0 and die _("the entry to update is missing\n(one of %s)\n", join(", ", @entries));
$urpm->select_media(@toupdates);
#- force ignored media to be returned alive.