summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-06-06 12:01:02 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-06-06 12:01:02 +0000
commitb3ea4e6495b4e43148ab452bc093b276305f3027 (patch)
tree48df33f551b5451b42c15939e5916a6e9d84d360 /perl-install
parent8383579687ccfad77bad202bae9d5914606c3b88 (diff)
downloaddrakx-b3ea4e6495b4e43148ab452bc093b276305f3027.tar
drakx-b3ea4e6495b4e43148ab452bc093b276305f3027.tar.gz
drakx-b3ea4e6495b4e43148ab452bc093b276305f3027.tar.bz2
drakx-b3ea4e6495b4e43148ab452bc093b276305f3027.tar.xz
drakx-b3ea4e6495b4e43148ab452bc093b276305f3027.zip
fix computeSize which took into account suggested partitions on another drives
(which is especially bad for LVMs)
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/fsedit.pm13
1 files changed, 8 insertions, 5 deletions
diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm
index 506eddf62..d46444d10 100644
--- a/perl-install/fsedit.pm
+++ b/perl-install/fsedit.pm
@@ -431,7 +431,7 @@ sub computeSize {
my $free_space = all_free_space($all_hds);
my @l = my @L = grep {
- if (!has_mntpoint($_->{mntpoint}, $all_hds) && $free_space >= $_->{size}) {
+ if ($free_space >= $_->{size}) {
$free_space -= $_->{size};
1;
} else { 0 } } @$suggestions;
@@ -466,19 +466,22 @@ sub suggest_part {
my $has_swap = any { isSwap($_) } get_all_fstab($all_hds);
+ my @local_suggestions =
+ grep { !has_mntpoint($_->{mntpoint}, $all_hds) || isSwap($_) && !$has_swap }
+ grep { !$_->{hd} || $_->{hd} eq $part->{rootDevice} }
+ @$suggestions;
+
my ($best) =
grep { !$_->{maxsize} || $part->{size} <= $_->{maxsize} }
grep { $_->{size} <= ($part->{maxsize} || $part->{size}) }
- grep { !has_mntpoint($_->{mntpoint}, $all_hds) || isSwap($_) && !$has_swap }
- grep { !$_->{hd} || $_->{hd} eq $part->{rootDevice} }
grep { !$part->{type} || $part->{type} == $_->{type} || isTrueFS($part) && isTrueFS($_) }
- @$suggestions or return;
+ @local_suggestions;
defined $best or return; #- sorry no suggestion :(
$part->{mntpoint} = $best->{mntpoint};
$part->{type} = $best->{type} if !(isTrueFS($best) && isTrueFS($part));
- $part->{size} = computeSize($part, $best, $all_hds, $suggestions);
+ $part->{size} = computeSize($part, $best, $all_hds, \@local_suggestions);
foreach ('options', 'lv_name') {
$part->{$_} = $best->{$_} if $best->{$_};
}