From b3ea4e6495b4e43148ab452bc093b276305f3027 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 6 Jun 2003 12:01:02 +0000 Subject: fix computeSize which took into account suggested partitions on another drives (which is especially bad for LVMs) --- perl-install/fsedit.pm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'perl-install/fsedit.pm') 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->{$_}; } -- cgit v1.2.1