summaryrefslogtreecommitdiffstats
path: root/gurpmi2
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2013-03-23 10:54:16 +0000
committerThierry Vignaud <tv@mageia.org>2013-03-23 10:54:16 +0000
commit8b43b4db7b04ea053ad86ac5f825395e31d320ec (patch)
tree7c1c00f0b565cd4ea38354a5d5efda353689ef98 /gurpmi2
parent460a640678b5b2ab12c6a5b50650434d3cadd0f8 (diff)
downloadurpmi-8b43b4db7b04ea053ad86ac5f825395e31d320ec.tar
urpmi-8b43b4db7b04ea053ad86ac5f825395e31d320ec.tar.gz
urpmi-8b43b4db7b04ea053ad86ac5f825395e31d320ec.tar.bz2
urpmi-8b43b4db7b04ea053ad86ac5f825395e31d320ec.tar.xz
urpmi-8b43b4db7b04ea053ad86ac5f825395e31d320ec.zip
display the addionnal space that will be used and the amount of
downloaded packages instead of the total size of the packages (like urpmi)
Diffstat (limited to 'gurpmi2')
-rwxr-xr-xgurpmi219
1 files changed, 10 insertions, 9 deletions
diff --git a/gurpmi2 b/gurpmi2
index 47bc0225..904df619 100755
--- a/gurpmi2
+++ b/gurpmi2
@@ -232,22 +232,23 @@ sub do_install {
}
sub do_install_2 () {
- my @to_install;
- my $sum;
- foreach my $pkg (sort { $a->name cmp $b->name } @{$urpm->{depslist}}[keys %{$state->{selected}}]) {
- if ($pkg->arch ne 'src') {
- push @to_install, scalar $pkg->fullname;
- $sum += $pkg->size;
- }
- }
+ my @to_install = map { scalar $_->fullname } @{$urpm->{depslist}}[sort { $a <=> $b } keys %{$state->{selected}}]; # sorted by medium for format_selected_packages
$urpm->{nb_install} = @to_install;
+ my ($size, $filesize) = $urpm->selected_size_filesize($state);
+ my $msg2 = $size >= 0 ?
+ N("%s of additional disk space will be used.", formatXiB($size)) :
+ N("%s of disk space will be freed.", formatXiB(-$size));
+ my $msg2_ = $filesize ? "\n" . N("%s of packages will be retrieved.", formatXiB($filesize)) . "\n" : '';
+ my $msg3 = P("Proceed with the installation of one package?",
+ "Proceed with the installation of the %d packages?",
+ $urpm->{nb_install}, $urpm->{nb_install});
@to_install > 1
? ask_continue_if_no_auto(
(scalar(@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:"))
. join("\n", '', @to_install, '')
- . P("(%d package, %d MB)", "(%d packages, %d MB)", scalar(@to_install), scalar(@to_install), toMb($sum)),
+ . "\n" . $msg2 . $msg2_ . $msg3,
, \&do_install_3)
: goto \&do_install_3;
}