[gparted] Switch to using jfs_tune to read the UUID



commit aa16bf545151ce91d98b58eab7b3027c7d89a29a
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Sun Sep 23 12:15:27 2012 +0100

    Switch to using jfs_tune to read the UUID
    
    Not necessary but use the simpler file system tune command rather than
    the file system debug command where possible.  Also saves creating an
    echo process.

 src/jfs.cc |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/jfs.cc b/src/jfs.cc
index aa4d069..b9aa952 100644
--- a/src/jfs.cc
+++ b/src/jfs.cc
@@ -31,12 +31,12 @@ FS jfs::get_filesystem_support()
 		
 	if ( ! Glib::find_program_in_path( "jfs_debugfs" ) .empty() ) {
 		fs .read = GParted::FS::EXTERNAL ;
-		fs .read_uuid = GParted::FS::EXTERNAL ;
 	}
 	
 	if ( ! Glib::find_program_in_path( "jfs_tune" ) .empty() ) {
 		fs .read_label = FS::EXTERNAL ;
 		fs .write_label = FS::EXTERNAL ;
+		fs .read_uuid = FS::EXTERNAL ;
 		fs .write_uuid = FS::EXTERNAL ;
 	}
 
@@ -128,9 +128,9 @@ bool jfs::write_label( const Partition & partition, OperationDetail & operationd
 
 void jfs::read_uuid( Partition & partition )
 {
-	if ( ! Utils::execute_command( "echo su | jfs_debugfs " + partition .get_path(), output, error, true ) )
+	if ( ! Utils::execute_command( "jfs_tune -l " + partition .get_path(), output, error, true ) )
 	{
-		partition .uuid = Utils::regexp_label( output, "s_uuid:[[:blank:]]*([^[:space:]]+)" ) ;
+		partition .uuid = Utils::regexp_label( output, "^File system UUID:[[:blank:]]*([^[:space:]]+)" ) ;
 		if ( partition .uuid == "00000000-0000-0000-0000-000000000000" )
 			partition .uuid .clear() ;
 	}



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