summaryrefslogtreecommitdiffstats
path: root/urpmi
diff options
context:
space:
mode:
authorPablo Saratxaga <pablo@mandriva.com>2007-02-21 11:12:47 +0000
committerPablo Saratxaga <pablo@mandriva.com>2007-02-21 11:12:47 +0000
commit1da4d3d0f59f23c26e24c5e282c7cb869675a6fe (patch)
tree1e649605d64152836106e23fdf0ba888b936cfa5 /urpmi
parent5593db89b498f57ecef817e5eeb66e002a7d6aba (diff)
downloadurpmi-1da4d3d0f59f23c26e24c5e282c7cb869675a6fe.tar
urpmi-1da4d3d0f59f23c26e24c5e282c7cb869675a6fe.tar.gz
urpmi-1da4d3d0f59f23c26e24c5e282c7cb869675a6fe.tar.bz2
urpmi-1da4d3d0f59f23c26e24c5e282c7cb869675a6fe.tar.xz
urpmi-1da4d3d0f59f23c26e24c5e282c7cb869675a6fe.zip
fixed some ngettext use
Diffstat (limited to 'urpmi')
-rwxr-xr-xurpmi60
1 files changed, 36 insertions, 24 deletions
diff --git a/urpmi b/urpmi
index d118044d..a883b858 100755
--- a/urpmi
+++ b/urpmi
@@ -287,6 +287,7 @@ if ($logfile && !$INC{"Devel/Trace.pm"}) {
unless ($pid_out = open STDOUT, "|-") {
select $SAVEOUT; $| = 1;
$/ = \1;
+ binmode STDIN, ':raw'; #- since we read character by character, perl must not try to recognise utf8 strings since it really can't
while (my $s = <STDIN>) {
open my $fh, ">>$logfile";
print $SAVEOUT $s;
@@ -297,6 +298,7 @@ if ($logfile && !$INC{"Devel/Trace.pm"}) {
unless ($pid_err = open STDERR, "|-") {
select $SAVEERR; $| = 1;
$/ = \1;
+ binmode STDIN, ':raw'; #- since we read character by character, perl must not try to recognise utf8 strings since it really can't
while (my $s = <STDIN>) {
open my $fh, ">>$logfile";
print $SAVEERR $s;
@@ -475,10 +477,11 @@ my $restart_itself = urpm::select::resolve_dependencies($urpm,
my @unselected_uninstalled = @{$state->{unselected_uninstalled} || []};
if (@unselected_uninstalled) {
my $list = join "\n", map { $_->name . '-' . $_->version . '-' . $_->release } @unselected_uninstalled;
- my $msg = P("The following package cannot be installed because it depends on packages
-that are older than the installed ones:\n%s",
- "The following packages can't be installed because they depend on packages
-that are older than the installed ones:\n%s", $#unselected_uninstalled, $list);
+ my $msg = ($#unselected_uninstalled == 1) ?
+ N("The following package cannot be installed because it depends on packages
+that are older than the installed ones:\n%s",$list)
+ : N("The following packages can't be installed because they depend on packages
+that are older than the installed ones:\n%s", $list);
if ($urpm->{options}{auto}) {
print "$msg\n";
} else {
@@ -496,8 +499,9 @@ that are older than the installed ones:\n%s", $#unselected_uninstalled, $list);
my @ask_unselect = urpm::select::unselected_packages($urpm, $state);
if (@ask_unselect) {
my $list = urpm::select::translate_why_unselected($urpm, $state, @ask_unselect);
- my $msg = P("A requested package cannot be installed:\n%s",
- "Some requested packages cannot be installed:\n%s", $#ask_unselect, $list);
+ my $msg = ($#ask_unselect == 1) ?
+ N("A requested package cannot be installed:\n%s",$list)
+ : N("Some requested packages cannot be installed:\n%s", $list);
if ($urpm->{options}{auto}) {
print "$msg\n";
} else {
@@ -527,15 +531,18 @@ if (@ask_remove) {
my $list = urpm::select::translate_why_removed($urpm, $state, @ask_remove);
if ($no_remove && !$force) {
- print P("The installation cannot continue because the following package
-has to be removed for others to be upgraded:\n%s\n",
- "The installation cannot continue because the following packages
-have to be removed for others to be upgraded:\n%s\n", $#ask_remove, $list), "\n";
+ my $msg = ($#ask_remove == 1) ?
+ N("The installation cannot continue because the following package
+has to be removed for others to be upgraded:\n%s\n", $list)
+ : N("The installation cannot continue because the following packages
+have to be removed for others to be upgraded:\n%s\n", $list);
+ print $msg . "\n";
exit 0;
}
- my $msg = P("The following package has to be removed for others to be upgraded:\n%s",
- "The following packages have to be removed for others to be upgraded:\n%s", $#ask_remove, $list);
+ my $msg = ($#ask_remove == 1) ?
+ N("The following package has to be removed for others to be upgraded:\n%s", $list)
+ : N("The following packages have to be removed for others to be upgraded:\n%s", $list);
if ($test) {
$msg = "$msg\n" . N("(test only, removal will not be actually done)");
}
@@ -571,9 +578,9 @@ foreach my $pkg (sort { $a->name cmp $b->name } @{$urpm->{depslist}}[keys %{$sta
}
$urpm->{nb_install} = @to_install;
if ($env) {
- my $msg = P("To satisfy dependencies, the following package is going to be installed:",
- "To satisfy dependencies, the following packages are going to be installed:", $#to_install);
- my $msg2 = N("(%d packages, %d MB)", $urpm->{nb_install}, toMb($sum));
+ my $msg = ($#to_install == 1) ? N("To satisfy dependencies, the following package is going to be installed:")
+ : N("To satisfy dependencies, the following packages are going to be installed:");
+ my $msg2 = P("(%d package, %d MB)", "(%d packages, %d MB)", $urpm->{nb_install}, toMb($sum));
my $p = join "\n", @to_install;
print "$msg\n$p\n$msg2\n";
exit 0; #- exit now for specific environment.
@@ -582,12 +589,14 @@ if (@root_only) {
print N("You need to be root to install the following dependencies:\n%s\n", join ' ', @root_only);
exit 1;
} elsif (!$urpm->{options}{auto} && $ask_user && @to_install) {
- my $msg = P("To satisfy dependencies, the following package is going to be installed:",
- "To satisfy dependencies, the following packages are going to be installed:", $#to_install);
+ my $msg = ($#to_install == 1) ? N("To satisfy dependencies, the following package is going to be installed:")
+ : N("To satisfy dependencies, the following packages are going to be installed:");
if ($test) {
$msg = "$msg\n" . N("(test only, installation will not be actually done)");
}
- my $msg2 = P("Proceed with the installation of 1 package? (%2\$d MB)",
+ my $msg2 = ($urpm->{nb_install} == 1) ?
+ N("Proceed with the installation of 1 package? (%2\$d MB)",toMb($sum))
+ : P("Proceed with the installation of the %d package? (%d MB)",
"Proceed with the installation of the %d packages? (%d MB)", $urpm->{nb_install}, $urpm->{nb_install}, toMb($sum));
my $p = join "\n", @to_install;
my $noexpr = N("Nn");
@@ -659,8 +668,9 @@ foreach my $set (@{$state->{transaction} || []}) {
my @bad_signatures = urpm::signature::check($urpm, \%transaction_sources_install, \%transaction_sources);
if (@bad_signatures) {
- my $msg = P("The following package has bad signature",
- "The following packages have bad signatures", $#bad_signatures);
+ my $msg = ($#bad_signatures == 1) ?
+ N("The following package has bad signature")
+ : N("The following packages have bad signatures");
my $msg2 = N("Do you want to continue installation ?");
my $p = join "\n", @bad_signatures;
#- rurpmi always abort here
@@ -833,11 +843,13 @@ if ($nok) {
my @installed = map { scalar $_->fullname } @$installed;
my @error = map { scalar $_->fullname } @$error;
my @msg1 = @installed == 0 ? () :
- P("Package %s is already installed",
- "Packages %s are already installed", @installed > 1, join(', ', @installed));
+ (@installed == 1) ?
+ N("Package %s is already installed",join(', ', @installed))
+ : N("Packages %s are already installed", join(', ', @installed));
my @msg2 = @error == 0 ? () :
- P("Package %s can not be installed",
- "Packages %s can not be installed", @errors > 1, join(', ', @error));
+ (@errors == 1) ?
+ N("Package %s can not be installed", join(', ', @error))
+ : N("Packages %s can not be installed", join(', ', @error));
print join("\n", @msg1, @msg2, '');
}
}