From c5a72673d869c8dd2d8f8f3d6d70649a64f8dbb5 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 18 Sep 2007 11:01:42 +0000 Subject: move more things from read() to read_primary() --- perl-install/partition_table.pm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm index 1d15d6ece..e9c192e09 100644 --- a/perl-install/partition_table.pm +++ b/perl-install/partition_table.pm @@ -249,19 +249,20 @@ sub read_primary { }; $@ or last; } - partition_table::raw::pt_info_to_primary($hd, $pt, $info); + my $primary = partition_table::raw::pt_info_to_primary($hd, $pt, $info) or return; + $hd->{primary} = $primary; + undef $hd->{extended}; + verifyPrimary($primary); + 1; } sub read { my ($hd) = @_; - my $pt = read_primary($hd, 0) or return 0; - $hd->{primary} = $pt; - undef $hd->{extended}; - verifyPrimary($pt); + read_primary($hd) or return 0; eval { my $need_removing_empty_extended; - if ($pt->{extended}) { - read_extended($hd, $pt->{extended}, \$need_removing_empty_extended) or return 0; + if ($hd->{primary}{extended}) { + read_extended($hd, $hd->{primary}{extended}, \$need_removing_empty_extended) or return 0; } if ($need_removing_empty_extended) { #- special case when hda5 is empty, it must be skipped -- cgit v1.2.1