summaryrefslogtreecommitdiffstats
path: root/perl-install/install_steps_interactive.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-04-11 22:45:33 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-04-11 22:45:33 +0000
commit4b21d97d91e33d00490c099cbd48841bc0ef65f1 (patch)
tree9472aae68022f14d68d1b1c1eeddea4b21c54d6e /perl-install/install_steps_interactive.pm
parent0cef03a15032d00545ffde023a6230b8cbb95c52 (diff)
downloaddrakx-backup-do-not-use-4b21d97d91e33d00490c099cbd48841bc0ef65f1.tar
drakx-backup-do-not-use-4b21d97d91e33d00490c099cbd48841bc0ef65f1.tar.gz
drakx-backup-do-not-use-4b21d97d91e33d00490c099cbd48841bc0ef65f1.tar.bz2
drakx-backup-do-not-use-4b21d97d91e33d00490c099cbd48841bc0ef65f1.tar.xz
drakx-backup-do-not-use-4b21d97d91e33d00490c099cbd48841bc0ef65f1.zip
(chooseGroups): warn if chosen size is too big
Diffstat (limited to 'perl-install/install_steps_interactive.pm')
-rw-r--r--perl-install/install_steps_interactive.pm18
1 files changed, 12 insertions, 6 deletions
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm
index 4725ed1e9..d6f4aace3 100644
--- a/perl-install/install_steps_interactive.pm
+++ b/perl-install/install_steps_interactive.pm
@@ -567,17 +567,23 @@ sub chooseGroups {
} @groups;
# @groups = grep { $size{$_} = round_down($size{$_} / sqr(1024), 10) } @groups; #- don't display the empty or small one (eg: because all packages are below $min_level)
- my ($all, $old_size);
+ my ($all, $size);
+ my $available_size = install_any::getAvailableSpace($o) / sqr(1024);
my $size_to_display = sub {
- my $size = $system_size + $compute_size->(map { @{$compssUsers->{$_}{flags}} } grep { $val{$_} } @groups);
+ my $lsize = $system_size + $compute_size->(map { @{$compssUsers->{$_}{flags}} } grep { $val{$_} } @groups);
#- if a profile is deselected, deselect everything (easier than deselecting the profile packages)
- $old_size > $size and install_any::unselectMostPackages($o);
- $old_size = $size;
- _("Selected size %d%s", pkgs::correctSize($size / sqr(1024)), _("MB"));
+ $size > $lsize and install_any::unselectMostPackages($o);
+ $size = $lsize;
+ _("Total size: %d / %d MB", pkgs::correctSize($size / sqr(1024)), $available_size);
};
- $o->reallyChooseGroups($size_to_display, $individual, \%val) or return;
+ while (1) {
+ $o->reallyChooseGroups($size_to_display, $individual, \%val) or return;
+ last if pkgs::correctSize($size / sqr(1024)) < $available_size;
+
+ $o->ask_warn('', _("Selected size is larger than available space"));
+ }
$o->{compssUsersChoice}{$_} = 0 foreach map { @{$compssUsers->{$_}{flags}} } grep { !$val{$_} } keys %val;
$o->{compssUsersChoice}{$_} = 1 foreach map { @{$compssUsers->{$_}{flags}} } grep { $val{$_} } keys %val;