[gparted] Switch to using debugfs.reiser4 to read the label



commit e282b78b4ad90af0ee426812a05a3ce27780e9ae
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Sun Sep 23 20:14:57 2012 +0100

    Switch to using debugfs.reiser4 to read the label
    
    Vol_id command was deprecated in May 2009 and superseded by the blkid
    command.  Replace the generic vol_id command with the file system
    specific debugfs.reiser4 command to read the file system label.
    Debugfs.reiser4 will exist as it's already required to read the file
    system usage and UUID.

 src/reiser4.cc |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/src/reiser4.cc b/src/reiser4.cc
index 9d7472d..e627b0c 100644
--- a/src/reiser4.cc
+++ b/src/reiser4.cc
@@ -30,12 +30,10 @@ FS reiser4::get_filesystem_support()
 	if ( ! Glib::find_program_in_path( "debugfs.reiser4" ) .empty() )
 	{
 		fs .read = GParted::FS::EXTERNAL ;
+		fs .read_label = FS::EXTERNAL ;
 		fs .read_uuid = GParted::FS::EXTERNAL ;
 	}
-	
-	if ( ! Glib::find_program_in_path( "vol_id" ) .empty() )
-		fs .read_label = FS::EXTERNAL ;
-	
+
 	if ( ! Glib::find_program_in_path( "mkfs.reiser4" ) .empty() )
 		fs .create = GParted::FS::EXTERNAL ;
 	
@@ -94,9 +92,9 @@ void reiser4::set_used_sectors( Partition & partition )
 
 void reiser4::read_label( Partition & partition )
 {
-	if ( ! Utils::execute_command( "vol_id " + partition .get_path(), output, error, true ) )
+	if ( ! Utils::execute_command( "debugfs.reiser4 " + partition .get_path(), output, error, true ) )
 	{
-		partition .label = Utils::regexp_label( output, "ID_FS_LABEL=([^\n]*)" ) ;
+		partition .label = Utils::regexp_label( output, "^label:[[:blank:]]*(.*)$" ) ;
 	}
 	else
 	{



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