summaryrefslogtreecommitdiffstats
path: root/perl-install/partition_table.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-08-18 22:45:39 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-08-18 22:45:39 +0000
commit0daa4b4bf3073a6b8a470e0bf3be6744d71ae92e (patch)
tree414a00dea21af9fabc6c3849de49c463dfab4066 /perl-install/partition_table.pm
parentfff406c0d039bd5094996a3ff0fa9c44173280ba (diff)
downloaddrakx-0daa4b4bf3073a6b8a470e0bf3be6744d71ae92e.tar
drakx-0daa4b4bf3073a6b8a470e0bf3be6744d71ae92e.tar.gz
drakx-0daa4b4bf3073a6b8a470e0bf3be6744d71ae92e.tar.bz2
drakx-0daa4b4bf3073a6b8a470e0bf3be6744d71ae92e.tar.xz
drakx-0daa4b4bf3073a6b8a470e0bf3be6744d71ae92e.zip
fixes and function prototype removing
Diffstat (limited to 'perl-install/partition_table.pm')
-rw-r--r--perl-install/partition_table.pm47
1 files changed, 23 insertions, 24 deletions
diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm
index 6793b33a6..2e7388b9a 100644
--- a/perl-install/partition_table.pm
+++ b/perl-install/partition_table.pm
@@ -195,7 +195,6 @@ arch() !~ /sparc/ ? (
0x483=> 'ext3',
0x401 => 'apple',
0x402 => 'hfs',
- nfs => 'nfs', #- hack
);
my %types_rev = reverse %types;
@@ -209,35 +208,35 @@ sub important_types {
difference2(\@l, \@bad_types);
}
-sub type2name($) { $types{$_[0]} || $_[0] }
-sub type2fs($) { $type2fs{$_[0]} }
-sub fs2type($) { $fs2type{$_[0]} }
-sub name2type($) {
+sub type2fs { $type2fs{$_[0]{type}} || $_[0]{type} }
+sub fs2type { $fs2type{$_[0]} || $_[0] }
+sub type2name { $types{$_[0]} || $_[0] }
+sub name2type {
local ($_) = @_;
/0x(.*)/ ? hex $1 : $types_rev{$_} || $_;
}
-sub isWholedisk($) { arch() =~ /^sparc/ && $_[0]{type} == 5 }
-sub isExtended($) { arch() !~ /^sparc/ && ($_[0]{type} == 5 || $_[0]{type} == 0xf || $_[0]{type} == 0x85) }
-sub isRawLVM($) { $_[0]{type} == 0x8e }
-sub isRawRAID($) { $_[0]{type} == 0xfd }
-sub isSwap($) { $type2fs{$_[0]{type}} eq 'swap' }
-sub isExt2($) { $type2fs{$_[0]{type}} eq 'ext2' }
-sub isDos($) { arch() !~ /^sparc/ && $ {{ 1=>1, 4=>1, 6=>1 }}{$_[0]{type}} }
-sub isWin($) { $ {{ 0xb=>1, 0xc=>1, 0xe=>1, 0x1b=>1, 0x1c=>1, 0x1e=>1 }}{$_[0]{type}} }
-sub isFat($) { isDos($_[0]) || isWin($_[0]) }
-sub isSunOS($) { arch() =~ /sparc/ && $ {{ 0x1=>1, 0x2=>1, 0x4=>1, 0x6=>1, 0x7=>1, 0x8=>1 }}{$_[0]{type}} }
-sub isNfs($) { $_[0]{type} eq 'nfs' } #- small hack
-sub isNT($) { arch() !~ /^sparc/ && $_[0]{type} == 0x7 }
-sub isSupermount($) { $_[0]{type} eq 'supermount' }
-sub isApple($) { $type2fs{$_[0]{type}} eq 'apple' && defined $_[0]{isDriver} }
-sub isAppleBootstrap($) { $type2fs{$_[0]{type}} eq 'apple' && defined $_[0]{isBoot} }
+sub isWholedisk { arch() =~ /^sparc/ && $_[0]{type} == 5 }
+sub isExtended { arch() !~ /^sparc/ && ($_[0]{type} == 5 || $_[0]{type} == 0xf || $_[0]{type} == 0x85) }
+sub isRawLVM { $_[0]{type} == 0x8e }
+sub isRawRAID { $_[0]{type} == 0xfd }
+sub isSwap { type2fs($_[0]) eq 'swap' }
+sub isExt2 { type2fs($_[0]) eq 'ext2' }
+sub isDos { arch() !~ /^sparc/ && $ {{ 1=>1, 4=>1, 6=>1 }}{$_[0]{type}} }
+sub isWin { $ {{ 0xb=>1, 0xc=>1, 0xe=>1, 0x1b=>1, 0x1c=>1, 0x1e=>1 }}{$_[0]{type}} }
+sub isFat { isDos($_[0]) || isWin($_[0]) }
+sub isSunOS { arch() =~ /sparc/ && $ {{ 0x1=>1, 0x2=>1, 0x4=>1, 0x6=>1, 0x7=>1, 0x8=>1 }}{$_[0]{type}} }
+sub isNfs { $_[0]{type} eq 'nfs' } #- small hack
+sub isNT { arch() !~ /^sparc/ && $_[0]{type} == 0x7 }
+sub isSupermount { $_[0]{type} eq 'supermount' }
+sub isApple { type2fs($_[0]) eq 'apple' && defined $_[0]{isDriver} }
+sub isAppleBootstrap { type2fs($_[0]) eq 'apple' && defined $_[0]{isBoot} }
sub isHiddenMacPart { defined $_[0]{isMap} }
-sub isThisFs { $type2fs{$_[1]{type}} eq $_[0] }
-sub isTrueFS { member($type2fs{$_[0]{type}}, qw(ext2 reiserfs xfs jfs ext3)) }
+sub isThisFs { type2fs($_[1]) eq $_[0] }
+sub isTrueFS { member(type2fs($_[0]), qw(ext2 reiserfs xfs jfs ext3)) }
-sub isOtherAvailableFS($) { isFat($_[0]) || isSunOS($_[0]) || isThisFs('hfs', $_[0]) } #- other OS that linux can access its filesystem
+sub isOtherAvailableFS { isFat($_[0]) || isSunOS($_[0]) || isThisFs('hfs', $_[0]) } #- other OS that linux can access its filesystem
sub isMountableRW { isTrueFS($_[0]) || isOtherAvailableFS($_[0]) }
sub isNonMountable { isRawRAID($_[0]) || isRawLVM($_[0]) }
@@ -512,7 +511,7 @@ sub read_extended {
}
# write the partition table
-sub write($) {
+sub write {
my ($hd) = @_;
$hd->{isDirty} or return;