[gparted] Enhance to use new linux-swap "filesystem" types added in parted-1.9.0



commit 8aa941204c42c17507fe13aa0720346b1b78ae36
Author: Curtis Gedak <gedakc gmail com>
Date:   Tue Jul 28 15:38:30 2009 -0600

    Enhance to use new linux-swap "filesystem" types added in parted-1.9.0
    
    Excerpt from parted-1.9.0 release notes follows:
      In libparted, the linux-swap "filesystem" types are now called
      "linux-swap(v0)" and "linux-swap(v1)" rather than "linux-swap(old)"
      and "linux-swap(new)" as in parted 1.8, or "linux-swap" as in older
      versions; "old" and "new" generally make poor names, and v1 is the
      only format supported by current Linux kernels. Aliases for all
      previous names are available.

 src/GParted_Core.cc |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc
index 5ffa606..147990e 100644
--- a/src/GParted_Core.cc
+++ b/src/GParted_Core.cc
@@ -880,7 +880,9 @@ GParted::FILESYSTEM GParted_Core::get_filesystem()
 		else if ( Glib::ustring( lp_partition ->fs_type ->name ) == "ext4" )
 			return GParted::FS_EXT4 ;
 		else if ( Glib::ustring( lp_partition ->fs_type ->name ) == "linux-swap" ||
+		          Glib::ustring( lp_partition ->fs_type ->name ) == "linux-swap(v1)" ||
 		          Glib::ustring( lp_partition ->fs_type ->name ) == "linux-swap(new)" ||
+		          Glib::ustring( lp_partition ->fs_type ->name ) == "linux-swap(v0)" ||
 		          Glib::ustring( lp_partition ->fs_type ->name ) == "linux-swap(old)" )
 			return GParted::FS_LINUX_SWAP ;
 		else if ( Glib::ustring( lp_partition ->fs_type ->name ) == "fat16" )
@@ -2178,6 +2180,10 @@ bool GParted_Core::set_partition_type( const Partition & partition, OperationDet
 		PedFileSystemType * fs_type = 
 			ped_file_system_type_get( Utils::get_filesystem_string( partition .filesystem ) .c_str() ) ;
 
+		//If not found, and FS is linux-swap, then try linux-swap(v1)
+		if ( ! fs_type && Utils::get_filesystem_string( partition .filesystem ) == "linux-swap" )
+			fs_type = ped_file_system_type_get( "linux-swap(v1)" ) ;
+
 		//If not found, and FS is linux-swap, then try linux-swap(new)
 		if ( ! fs_type && Utils::get_filesystem_string( partition .filesystem ) == "linux-swap" )
 			fs_type = ped_file_system_type_get( "linux-swap(new)" ) ;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]