From 4a217824737f82d15cf8120356111739d00269db Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 14 Nov 2016 17:39:47 +0100 Subject: (isFormatable) introduce it we could have exported cannotBeMountable() but it's cleaner to export another isFoobar() function --- perl-install/fs/type.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/perl-install/fs/type.pm b/perl-install/fs/type.pm index 679525774..ad84738f7 100644 --- a/perl-install/fs/type.pm +++ b/perl-install/fs/type.pm @@ -9,7 +9,7 @@ use devices; our @ISA = qw(Exporter); our @EXPORT = qw( - isBlockCheckable isEmpty isExtended isTrueLocalFS isTrueFS isDos isSwap isOtherAvailableFS isRawLVM isRawRAID isRawLUKS isRAID isLVM isLUKS isMountableRW isNonMountable isPartOfLVM isPartOfRAID isPartOfLoopback isLoopback isMounted isBusy isSpecial isApple isAppleBootstrap isBIOS_GRUB isESP isFat_or_NTFS isnormal_Fat_or_NTFS isRecovery + isBlockCheckable isEmpty isExtended isFormatable isTrueLocalFS isTrueFS isDos isSwap isOtherAvailableFS isRawLVM isRawRAID isRawLUKS isRAID isLVM isLUKS isMountableRW isNonMountable isPartOfLVM isPartOfRAID isPartOfLoopback isLoopback isMounted isBusy isSpecial isApple isAppleBootstrap isBIOS_GRUB isESP isFat_or_NTFS isnormal_Fat_or_NTFS isRecovery maybeFormatted set_isFormatted defaultFS ); @@ -328,6 +328,12 @@ sub cannotBeMountable { my ($part) = @_; isRawRAID($part) || isRawLUKS($part) || isRawLVM($part) || isBIOS_GRUB($part); } +# is not a special sg that cannot be mounted/formatted (parts of RAID/LVM, BIOS_GRUB): +sub isFormatable { + my ($part) = @_; + !cannotBeMountable($part); +} + sub isNonMountable { my ($part) = @_; cannotBeMountable($part) || $part->{fs_type} eq 'ntfs' && !$part->{isFormatted} && $part->{notFormatted}; -- cgit v1.2.1