[gparted] Make copying and moving swap depend on mkswap availability (#775932)



commit a1c24548563b6dd55531796c0322006af9d8ce5f
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Sat Nov 19 22:46:11 2016 +0000

    Make copying and moving swap depend on mkswap availability (#775932)
    
    Attempting to copy or move linux-swap partition was possible when the
    mkswap command was unavailable.  However as linux-swap is re-created as
    part of these operations the mkswap command is a mandatory requirement.
    Example copy operation results:
    
        Copy /dev/sdb1 to /dev/sdb2
        + calibrate /dev/sdb1
        + check file system on /dev/sdb1 for errors and (if possible) fix them
        + create empty partition
        + set partition type on /dev/sdb2
        + copy file system from /dev/sdb1 to /dev/sdb2           [SUCCESS]
            Partition copy action skipped because linux-swap file system does not contain data
        + grow file system to fill the partition                 [WARNING]
            growing is not available for this file system
    
    Because mkswap was not available the grow action didn't re-create
    the linux-swap so the newly copied partition is left without any content
    and therefore reported as an unknown partition.
    
    Fix by making copying and moving linux-swap depend on mkswap being
    available.
    
    Bug 775932 - Refactor mostly applying of operations

 src/linux_swap.cc |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/src/linux_swap.cc b/src/linux_swap.cc
index e5ac623..8d711fa 100644
--- a/src/linux_swap.cc
+++ b/src/linux_swap.cc
@@ -55,6 +55,8 @@ FS linux_swap::get_filesystem_support()
                fs .create_with_label = GParted::FS::EXTERNAL ;
                fs .grow = GParted::FS::EXTERNAL ;
                fs .shrink = GParted::FS::EXTERNAL ;
+               fs.copy = FS::EXTERNAL;
+               fs.move = FS::EXTERNAL;
        }
 
        if ( ! Glib::find_program_in_path( "swaplabel" ) .empty() )
@@ -65,9 +67,6 @@ FS linux_swap::get_filesystem_support()
                fs .write_uuid = FS::EXTERNAL ;
        }
 
-       fs .copy = GParted::FS::EXTERNAL ;
-       fs .move = GParted::FS::EXTERNAL ;
-       
        return fs ;
 }
 


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