diff options
author | Thierry Vignaud <tv@mageia.org> | 2013-03-23 10:54:16 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2013-03-23 10:54:16 +0000 |
commit | 8b43b4db7b04ea053ad86ac5f825395e31d320ec (patch) | |
tree | 7c1c00f0b565cd4ea38354a5d5efda353689ef98 | |
parent | 460a640678b5b2ab12c6a5b50650434d3cadd0f8 (diff) | |
download | urpmi-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)
-rw-r--r-- | NEWS | 4 | ||||
-rwxr-xr-x | gurpmi2 | 19 |
2 files changed, 14 insertions, 9 deletions
@@ -1,3 +1,7 @@ +- gurpmi2: + o display the addionnal space that will be used and the amount of downloaded + packages instead of the total size of the packages (like urpmi) + Version 7.22 - 21 March 2013, by Thierry Vignaud - library: @@ -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; } |