[gparted] Stop trying unneeded alternative libparted linux-swap names



commit ab1381b1f4edeabca7897b003793e3f3595a5b92
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Sat Apr 13 11:31:19 2019 +0100

    Stop trying unneeded alternative libparted linux-swap names
    
    With that same commit in parted 1.9 [1], libparted only recognised these
    linux-swap names via deprecated aliases:
        linux-swap(old)
        linux-swap(new)
    but does accept this name as a current alias:
        linux-swap
    for:
        linux-swap(v1)
    
    Demonstration:
        # parted -v
        parted (GNU parted) 2.1
        ...
    
        # parted /dev/sdc mkfs yes 1 "linux-swap(new)" unit s print
        ...
        [0] filesys.c:148 (ped_file_system_type_get(): File system alias linux-swap(new) is deprecated
        ...
        Number  Start  End       Size      Type     File system     Flags
         1      2048s  2099199s  2097152s  primary  linux-swap(v1)
    
        # parted /dev/sdc mkfs yes 1 "linux-swap" unit s print
        ...
        Number  Start  End       Size      Type     File system     Flags
         1      2048s  2099199s  2097152s  primary  linux-swap(v1)
    
    Again as GParted now requires libparted 2.2 or later:
    1) Stop using alternative "linux-swap(new)" name as that is deprecated
       by libparted.
    2) Also stop using alternative "linux-swap(v1)" name as that code is
       never used because libparted recognised the GParted "linux-swap"
       name as a current alias.
    
    [1] http://git.savannah.gnu.org/cgit/parted.git/commit/?id=cfafa4394998a11f871a0f8d172b13314f9062c2
        Rationalise linux-swap fs names, and add a "linux-swap" alias

 src/GParted_Core.cc | 8 --------
 1 file changed, 8 deletions(-)
---
diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc
index ad6b67f9..fa3261ea 100644
--- a/src/GParted_Core.cc
+++ b/src/GParted_Core.cc
@@ -3554,14 +3554,6 @@ bool GParted_Core::set_partition_type( const Partition & partition, OperationDet
                        if (partition.filesystem != FS_CLEARED)
                                lp_fs_type = ped_file_system_type_get(fs_type.c_str());
 
-                       // If not found, and FS is linux-swap, then try linux-swap(v1)
-                       if ( ! lp_fs_type && fs_type == "linux-swap" )
-                               lp_fs_type = ped_file_system_type_get( "linux-swap(v1)" );
-
-                       // If not found, and FS is linux-swap, then try linux-swap(new)
-                       if ( ! lp_fs_type && fs_type == "linux-swap" )
-                               lp_fs_type = ped_file_system_type_get( "linux-swap(new)" );
-
                        // If not found, and FS is udf, then try ntfs.
                        // Actually MBR 07 IFS (Microsoft Installable File System) or
                        // GPT BDP (Windows Basic Data Partition).


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