summaryrefslogtreecommitdiffstats
path: root/perl-install/partition_table.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-07-23 04:11:20 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-07-23 04:11:20 +0000
commit4458a8a8985d3c7c66588ff1cf0748178ad23c17 (patch)
treea88ba2f5f2135cfeb37eee21471592a6e6e1d012 /perl-install/partition_table.pm
parent1d8347ff685c50364932f1b2e720a4a97c7d550c (diff)
downloaddrakx-4458a8a8985d3c7c66588ff1cf0748178ad23c17.tar
drakx-4458a8a8985d3c7c66588ff1cf0748178ad23c17.tar.gz
drakx-4458a8a8985d3c7c66588ff1cf0748178ad23c17.tar.bz2
drakx-4458a8a8985d3c7c66588ff1cf0748178ad23c17.tar.xz
drakx-4458a8a8985d3c7c66588ff1cf0748178ad23c17.zip
replace pt_type2name($part->{pt_type}) with part2name($part)
(hoisting the dereferencing {pt_type})
Diffstat (limited to 'perl-install/partition_table.pm')
-rw-r--r--perl-install/partition_table.pm9
1 files changed, 6 insertions, 3 deletions
diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm
index 3f6243ebe..812ed4826 100644
--- a/perl-install/partition_table.pm
+++ b/perl-install/partition_table.pm
@@ -6,7 +6,7 @@ use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK @important_types @important_types2 @fie
@ISA = qw(Exporter);
%EXPORT_TAGS = (
- types => [ qw(pt_type2name type2fs name2pt_type fs2pt_type isExtended isExt2 isThisFs isTrueLocalFS isTrueFS isSwap isDos isWin isFat isFat_or_NTFS isSunOS isOtherAvailableFS isPrimary isRawLVM isRawRAID isRAID isLVM isMountableRW isNonMountable isPartOfLVM isPartOfRAID isPartOfLoopback isLoopback isMounted isBusy isSpecial maybeFormatted isApple isAppleBootstrap isEfi) ],
+ types => [ qw(part2name type2fs name2pt_type fs2pt_type isExtended isExt2 isThisFs isTrueLocalFS isTrueFS isSwap isDos isWin isFat isFat_or_NTFS isSunOS isOtherAvailableFS isPrimary isRawLVM isRawRAID isRAID isLVM isMountableRW isNonMountable isPartOfLVM isPartOfRAID isPartOfLoopback isLoopback isMounted isBusy isSpecial maybeFormatted isApple isAppleBootstrap isEfi) ],
);
@EXPORT_OK = map { @$_ } values %EXPORT_TAGS;
@@ -220,7 +220,10 @@ sub type2fs {
$pt_type2fs{$pt_type} || $pt_type =~ /^(\d+)$/ && $o_default || $pt_type;
}
sub fs2pt_type { $fs2pt_type{$_[0]} || $_[0] }
-sub pt_type2name { $pt_type2name{$_[0]} || $_[0] }
+sub part2name {
+ my ($part) = @_;
+ $pt_type2name{$part->{pt_type}} || $part->{pt_type};
+}
sub name2pt_type {
local ($_) = @_;
/0x(.*)/ ? hex $1 : $name2pt_type{$_} || $_;
@@ -278,7 +281,7 @@ sub description {
formatXiB($hd->{totalsectors} || $hd->{size}, 512),
$hd->{info} && ", $hd->{info}",
$hd->{mntpoint} && ", " . $hd->{mntpoint},
- $hd->{pt_type} && ", " . pt_type2name($hd->{pt_type});
+ $hd->{pt_type} && ", " . part2name($hd);
}
sub isPrimary {