[gparted] Remove use of retired vol_id from FS_Info module (#767842)
- From: Curtis Gedak <gedakc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gparted] Remove use of retired vol_id from FS_Info module (#767842)
- Date: Sun, 7 Aug 2016 20:53:55 +0000 (UTC)
commit 8aa34f7baaac5a70e8901275619f7587b2ed21b8
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date: Wed Jul 6 18:17:26 2016 +0100
Remove use of retired vol_id from FS_Info module (#767842)
Vol_id was removed from udev 142, released 2009-05-13, and udev switched
to using blkid instead [1]. All currently supported distributions use
later versions of udev (or systemd after the udev merge), except for
RedHat / CentOS 5 with udev 095. However RedHat / CentOS 5 does provide
blkid and vol_id is found in udev specific /lib/udev directory not on
the PATH. Therefore effectively vol_id is not available on any
supported distribution and blkid is always available. Therefore remove
use of vol_id from the FS_Info module. Less code to refactor and test
in following changes.
[1] delete vol_id and require util-linux-ng's blkid
http://git.kernel.org/cgit/linux/hotplug/udev.git/commit/?id=f07996885dab45102492d7f16e7e2997e264c725
Bug 767842 - File system usage missing when tools report alternate block
device names
include/FS_Info.h | 1 -
src/FS_Info.cc | 20 --------------------
2 files changed, 0 insertions(+), 21 deletions(-)
---
diff --git a/include/FS_Info.h b/include/FS_Info.h
index 88343e6..6121315 100644
--- a/include/FS_Info.h
+++ b/include/FS_Info.h
@@ -40,7 +40,6 @@ private:
static bool fs_info_cache_initialized ;
static bool blkid_found ;
static bool need_blkid_vfat_cache_update_workaround;
- static bool vol_id_found ;
static Glib::ustring fs_info_cache ;
};
diff --git a/src/FS_Info.cc b/src/FS_Info.cc
index 02acb87..2ab1a6e 100644
--- a/src/FS_Info.cc
+++ b/src/FS_Info.cc
@@ -25,7 +25,6 @@ bool FS_Info::blkid_found = false ;
// Assume workaround is needed just in case determination fails and as
// it only costs a fraction of a second to run blkid command again.
bool FS_Info::need_blkid_vfat_cache_update_workaround = true;
-bool FS_Info::vol_id_found = false ;
Glib::ustring FS_Info::fs_info_cache = "";
FS_Info::FS_Info()
@@ -91,8 +90,6 @@ void FS_Info::set_commands_found()
( blkid_major_ver == 2 && blkid_minor_ver < 23 ) );
}
}
-
- vol_id_found = (! Glib::find_program_in_path( "vol_id" ) .empty() ) ;
}
Glib::ustring FS_Info::get_device_entry( const Glib::ustring & path )
@@ -134,13 +131,6 @@ Glib::ustring FS_Info::get_fs_type( const Glib::ustring & path )
fs_type = "fat32" ;
}
- if ( fs_type .empty() && vol_id_found )
- {
- //Retrieve TYPE using vol_id command
- if ( ! Utils::execute_command( "vol_id " + path, output, error, true ) )
- fs_type = Utils::regexp_label( output, "ID_FS_TYPE=([^\n]*)" ) ;
- }
-
return fs_type ;
}
@@ -169,16 +159,6 @@ Glib::ustring FS_Info::get_uuid( const Glib::ustring & path )
//Retrieve the UUID
Glib::ustring uuid = Utils::regexp_label( temp, " UUID=\"([^\"]*)\"" );
- if ( uuid .empty() && vol_id_found )
- {
- //Retrieve UUID using vol_id command
- Glib::ustring output, error ;
- if ( ! Utils::execute_command( "vol_id " + path, output, error, true ) )
- {
- uuid = Utils::regexp_label( output, "ID_FS_UUID=([^\n]*)" ) ;
- }
- }
-
return uuid ;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]