summaryrefslogtreecommitdiffstats
path: root/perl-install/partition_table/gpt.pm
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2015-03-24 10:16:41 -0400
committerThierry Vignaud <thierry.vignaud@gmail.com>2015-03-25 19:55:33 +0100
commit134d2506afa228492d0a61f2d31486ca41ec54ef (patch)
tree6197e32a0d3ea2fe30bbd269c2ced79f2a945d03 /perl-install/partition_table/gpt.pm
parent7f7356af622b3762f8a4b16c28e5daee2a69b220 (diff)
downloaddrakx-134d2506afa228492d0a61f2d31486ca41ec54ef.tar
drakx-134d2506afa228492d0a61f2d31486ca41ec54ef.tar.gz
drakx-134d2506afa228492d0a61f2d31486ca41ec54ef.tar.bz2
drakx-134d2506afa228492d0a61f2d31486ca41ec54ef.tar.xz
drakx-134d2506afa228492d0a61f2d31486ca41ec54ef.zip
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
Diffstat (limited to 'perl-install/partition_table/gpt.pm')
-rw-r--r--perl-install/partition_table/gpt.pm13
1 files changed, 2 insertions, 11 deletions
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++) {