From 134d2506afa228492d0a61f2d31486ca41ec54ef Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Tue, 24 Mar 2015 10:16:41 -0400 Subject: use a proper interface between parted/perl worlds create directly the hash in XS instead of instead of sprintf()ing it into a string which was then parsed in perl in order to actually create the hash this fixes several issues: - due to adding some fields to the string under if (), we could silently have ignored some partitions - this also simplifies adding further fields --- perl-install/partition_table/gpt.pm | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'perl-install/partition_table/gpt.pm') diff --git a/perl-install/partition_table/gpt.pm b/perl-install/partition_table/gpt.pm index a1d8b84f8..77173b268 100644 --- a/perl-install/partition_table/gpt.pm +++ b/perl-install/partition_table/gpt.pm @@ -107,18 +107,9 @@ sub read_one { c::get_disk_type($hd->{file}) eq "gpt" or die "$hd->{device} not a GPT disk ($hd->{file})"; my @pt; + # FIXME: just use '@pt = c::...' if part_numbers are always linear: foreach (c::get_disk_partitions($hd->{file})) { - log::l($_); - if (/^([^ ]*) ([^ ]*) ([^ ]*) (.*) \((\d*),(\d*),(\d*)\)$/) { - my %p; - $p{part_number} = $1; - $p{real_device} = $2; - $p{fs_type} = $3; - $p{pt_type} = 0xba; - $p{start} = $5; - $p{size} = $7; - @pt[$p{part_number}-1] = \%p; - } + @pt[$_->{part_number}-1] = $_; } for (my $part_number = 1; $part_number < $nb_primary; $part_number++) { -- cgit v1.2.1