gparted r1079 - in trunk: . src
- From: gedakc svn gnome org
- To: svn-commits-list gnome org
- Subject: gparted r1079 - in trunk: . src
- Date: Wed, 25 Feb 2009 20:42:45 +0000 (UTC)
Author: gedakc
Date: Wed Feb 25 20:42:44 2009
New Revision: 1079
URL: http://svn.gnome.org/viewvc/gparted?rev=1079&view=rev
Log:
Added recognition of /dev/mmcblk* SD/MMC devices
Modified:
trunk/ChangeLog
trunk/src/GParted_Core.cc
Modified: trunk/src/GParted_Core.cc
==============================================================================
--- trunk/src/GParted_Core.cc (original)
+++ trunk/src/GParted_Core.cc Wed Feb 25 20:42:44 2009
@@ -173,36 +173,40 @@
//
//try to find all available devices
std::ifstream proc_partitions( "/proc/partitions" ) ;
- if ( proc_partitions )
- {
- //parse device names from /proc/partitions
- std::string line ;
- std::string device ;
- while ( getline( proc_partitions, line ) )
- {
- //Whole disk devices are the ones we want.
- //Device names without a trailing digit refer to the whole disk.
- device = Utils::regexp_label(line, "^[\t ]+[0-9]+[\t ]+[0-9]+[\t ]+[0-9]+[\t ]+([^0-9]+)$") ;
- //Device names that end with a #[^p]# are HP Smart Array Devices (disks)
- //E.g., device = /dev/cciss/c0d0, partition = /dev/cciss/c0d0p1
- if ( device == "" )
- device = Utils::regexp_label(line, "^[\t ]+[0-9]+[\t ]+[0-9]+[\t ]+[0-9]+[\t ]+(.*[0-9]+[^p]{1}[0-9]+)$") ;
- if ( device != "" )
- {
- //try to have libparted detect the device and add it to the list
- device = "/dev/" + device;
- /*TO TRANSLATORS: looks like Scanning /dev/sda */
- set_thread_status_message( String::ucompose ( _("Scanning %1"), device ) ) ;
- ped_device_get( device .c_str() ) ;
- }
- }
- proc_partitions .close() ;
- }
- else
- {
- //file /proc/partitions doesn't exist so use libparted to probe devices
- ped_device_probe_all();
- }
+ if ( proc_partitions )
+ {
+ //parse device names from /proc/partitions
+ std::string line ;
+ std::string device ;
+ while ( getline( proc_partitions, line ) )
+ {
+ //Whole disk devices are the ones we want.
+ //Device names without a trailing digit refer to the whole disk.
+ device = Utils::regexp_label(line, "^[\t ]+[0-9]+[\t ]+[0-9]+[\t ]+[0-9]+[\t ]+([^0-9]+)$") ;
+ //Recognize /dev/mmcblk* devices.
+ //E.g., device = /dev/mmcblk0, partition = /dev/mmcblk0p1
+ if ( device == "" )
+ device = Utils::regexp_label(line, "^[\t ]+[0-9]+[\t ]+[0-9]+[\t ]+[0-9]+[\t ]+(mmcblk[0-9]+)$") ;
+ //Device names that end with a #[^p]# are HP Smart Array Devices (disks)
+ //E.g., device = /dev/cciss/c0d0, partition = /dev/cciss/c0d0p1
+ if ( device == "" )
+ device = Utils::regexp_label(line, "^[\t ]+[0-9]+[\t ]+[0-9]+[\t ]+[0-9]+[\t ]+(.*[0-9]+[^p]{1}[0-9]+)$") ;
+ if ( device != "" )
+ {
+ //try to have libparted detect the device and add it to the list
+ device = "/dev/" + device;
+ /*TO TRANSLATORS: looks like Scanning /dev/sda */
+ set_thread_status_message( String::ucompose ( _("Scanning %1"), device ) ) ;
+ ped_device_get( device .c_str() ) ;
+ }
+ }
+ proc_partitions .close() ;
+ }
+ else
+ {
+ //file /proc/partitions doesn't exist so use libparted to probe devices
+ ped_device_probe_all();
+ }
lp_device = ped_device_get_next( NULL );
while ( lp_device )
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]