gparted r948 - in trunk: . src



Author: gedakc
Date: Fri Oct 31 21:50:07 2008
New Revision: 948
URL: http://svn.gnome.org/viewvc/gparted?rev=948&view=rev

Log:
Changed get_label() to use vol_id instead of debugfs.reiser4

Modified:
   trunk/ChangeLog
   trunk/README
   trunk/src/reiser4.cc

Modified: trunk/README
==============================================================================
--- trunk/README	(original)
+++ trunk/README	Fri Oct 31 21:50:07 2008
@@ -116,5 +116,7 @@
    reiser4progs
    reiserfsprogs
    xfsprogs
-   NOTE:  If the vol_id command is in the search PATH, it will be
-          used to read linux-swap, hfs, and hfs+ file system volume labels.
+
+   NOTE:  If the vol_id command is in the search PATH, it will be used
+          to read linux-swap, reiser4, hfs, and hfs+ file system
+          volume labels.

Modified: trunk/src/reiser4.cc
==============================================================================
--- trunk/src/reiser4.cc	(original)
+++ trunk/src/reiser4.cc	Fri Oct 31 21:50:07 2008
@@ -27,10 +27,10 @@
 	fs .filesystem = GParted::FS_REISER4 ;
 	
 	if ( ! Glib::find_program_in_path( "debugfs.reiser4" ) .empty() )
-	{
 		fs .read = GParted::FS::EXTERNAL ;
+	
+	if ( ! Glib::find_program_in_path( "vol_id" ) .empty() )
 		fs .get_label = FS::EXTERNAL ;
-	}
 	
 	if ( ! Glib::find_program_in_path( "mkfs.reiser4" ) .empty() )
 		fs .create = GParted::FS::EXTERNAL ;
@@ -82,18 +82,15 @@
 
 void reiser4::get_label( Partition & partition )
 {
-	if ( ! Utils::execute_command( "debugfs.reiser4 -f " + partition .get_path(), output, error, true ) )
+	if ( ! Utils::execute_command( "vol_id " + partition .get_path(), output, error, true ) )
 	{
-		Glib::ustring label = Utils::regexp_label( output, "^label:[\t ]*([^!]*)$" ) ;
-		//FIXME: find a better way to see if label is empty.. imagine someone uses '<none>' as label.... ;)
-		if( label != "<none>" ) 
-			partition .label = label ; 
+		partition .label = Utils::regexp_label( output, "ID_FS_LABEL=([^\n]*)" ) ;
 	}
 	else
 	{
 		if ( ! output .empty() )
 			partition .messages .push_back( output ) ;
-		
+
 		if ( ! error .empty() )
 			partition .messages .push_back( error ) ;
 	}



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