[gparted] Fix mkswap error "UUID parsing failed" when resizing with no UUID



commit f23746959fb0c8f2783fdadef16e66df43e98a09
Author: Curtis Gedak <gedakc gmail com>
Date:   Sun Mar 14 13:45:05 2010 -0600

    Fix mkswap error "UUID parsing failed" when resizing with no UUID
    
    See following debian bug report:
    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=573836

 src/linux_swap.cc |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/linux_swap.cc b/src/linux_swap.cc
index 61251a7..3383b79 100644
--- a/src/linux_swap.cc
+++ b/src/linux_swap.cc
@@ -80,7 +80,10 @@ bool linux_swap::resize( const Partition & partition_new, OperationDetail & oper
 		String::ucompose( _("create new %1 file system"), Utils::get_filesystem_string( FS_LINUX_SWAP ) ) ) ) ;
 
 	//Maintain label and uuid when recreating swap
-	Glib::ustring command = "mkswap -L \"" + partition_new .label + "\" -U \"" + partition_new .uuid + "\" " + partition_new .get_path() ;
+	Glib::ustring command = "mkswap -L \"" + partition_new .label + "\" " ;
+	if ( ! partition_new .uuid .empty() )
+		command +=  " -U \"" + partition_new .uuid + "\" " ;
+	command += partition_new .get_path() ;
 	bool exit_status = ! execute_command( command , operationdetail .get_last_child() ) ;
 
 	operationdetail .get_last_child() .set_status( exit_status ? STATUS_SUCCES : STATUS_ERROR ) ;



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