summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-09-06 09:06:46 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-09-06 09:06:46 +0000
commit7ba761dec0070ad2ae1aa7849a4d7d6cf1d9e2dc (patch)
treef28f5accce8dd3409cc095a2029cb73b88bfd0eb
parent58c9411b535302166226b8700c21fd740d44befb (diff)
downloadurpmi-7ba761dec0070ad2ae1aa7849a4d7d6cf1d9e2dc.tar
urpmi-7ba761dec0070ad2ae1aa7849a4d7d6cf1d9e2dc.tar.gz
urpmi-7ba761dec0070ad2ae1aa7849a4d7d6cf1d9e2dc.tar.bz2
urpmi-7ba761dec0070ad2ae1aa7849a4d7d6cf1d9e2dc.tar.xz
urpmi-7ba761dec0070ad2ae1aa7849a4d7d6cf1d9e2dc.zip
remove duplicated $env code
-rwxr-xr-xurpmi16
1 files changed, 6 insertions, 10 deletions
diff --git a/urpmi b/urpmi
index 478fa932..8b6b6105 100755
--- a/urpmi
+++ b/urpmi
@@ -595,18 +595,10 @@ foreach my $pkg (sort { $a->name cmp $b->name } @{$urpm->{depslist}}[keys %{$sta
}
}
$urpm->{nb_install} = @to_install;
-if ($env && !$options{debug__do_not_install}) {
- my $msg = $urpm->{nb_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}, $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.
-}
-if (@root_only) {
+if (@root_only && !$env) {
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 && $urpm->{nb_install}) {
+} elsif (!$urpm->{options}{auto} && $ask_user && $urpm->{nb_install} || $env) {
my $msg = $urpm->{nb_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) {
@@ -617,6 +609,10 @@ if (@root_only) {
$urpm->{nb_install}, $urpm->{nb_install})
. N(" (%d MB)", toMb($sum));
my $p = join "\n", @to_install;
+ if ($env && !$options{debug__do_not_install}) {
+ print "$msg\n$p\n$msg2\n";
+ exit 0; #- exit now for specific environment.
+ }
my $noexpr = N("Nn");
my $yesexpr = N("Yy");
message_input("$msg\n$p\n$msg2" . N(" (Y/n) "), $force && $yesexpr, boolean => 1) =~ /[$noexpr]/ and exit 0;