diff options
author | Pascal Rigaux <pixel@mandriva.com> | 1999-07-02 09:25:48 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 1999-07-02 09:25:48 +0000 |
commit | 755e511024f29df150d9d150d19c849e59c1e216 (patch) | |
tree | 008a780c08366ce366c55cc3bbe0d49703f544d6 /perl-install/fsedit.pm | |
parent | e82688c8b8f639705356d25c180ffe754c2b2c34 (diff) | |
download | drakx-755e511024f29df150d9d150d19c849e59c1e216.tar drakx-755e511024f29df150d9d150d19c849e59c1e216.tar.gz drakx-755e511024f29df150d9d150d19c849e59c1e216.tar.bz2 drakx-755e511024f29df150d9d150d19c849e59c1e216.tar.xz drakx-755e511024f29df150d9d150d19c849e59c1e216.zip |
*** empty log message ***
Diffstat (limited to 'perl-install/fsedit.pm')
-rw-r--r-- | perl-install/fsedit.pm | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm index ecc13a79f..8687d694c 100644 --- a/perl-install/fsedit.pm +++ b/perl-install/fsedit.pm @@ -155,27 +155,28 @@ sub removeFromList($$$) { sub allocatePartitions($$) { my ($hds, $to_add) = @_; my %free_sectors = map { $_->{device} => [1, $_->{totalsectors} ] } @$hds; # first sector is always occupied by the MBR - my $remove = sub { removeFromList($_->{start}, $_->{start} + $_->{size}, $free_sectors{$_->{rootDevice}}) }; + my $remove = sub { removeFromList($_[0]->{start}, $_[0]->{start} + $_[0]->{size}, $free_sectors{$_[0]->{rootDevice}}) }; my $success = 0; - foreach (get_fstab(@$hds)) { &$remove(); } + foreach (get_fstab(@$hds)) { &$remove($_); } FSTAB: foreach (@$to_add) { + my %e = %$_; foreach my $hd (@$hds) { my $v = $free_sectors{$hd->{device}}; for (my $i = 0; $i < @$v; $i += 2) { my $size = $v->[$i + 1] - $v->[$i]; - $_->{size} > $size and next; - $_->{start} = $v->[$i]; - $_->{rootDevice} = $hd->{device}; - partition_table::adjustStartAndEnd($hd, $_); - &$remove(); - partition_table::add($hd, $_); + $e{size} > $size and next; + $e{start} = $v->[$i]; + $e{rootDevice} = $hd->{device}; + partition_table::adjustStartAndEnd($hd, \%e); + &$remove(\%e); + partition_table::add($hd, \%e); $success++; next FSTAB; } } - log::ld("can't allocate partition $_->{mntpoint} of size $_->{size}, not enough room"); + log::ld("can't allocate partition $e{mntpoint} of size $e{size}, not enough room"); } $success; } |