rpms/gparted/FC-6 gparted-devices.patch, NONE, 1.1 gparted.spec, 1.18, 1.19

Deji Akingunola (deji) fedora-extras-commits at redhat.com
Thu Jun 14 22:08:18 UTC 2007


Author: deji

Update of /cvs/extras/rpms/gparted/FC-6
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv22589

Modified Files:
	gparted.spec 
Added Files:
	gparted-devices.patch 
Log Message:
* Mon Jun 11 2007 Deji Akingunola <dakingun at gmail.com> - 0.3.3-3
- Apply patch to only detect real devices, useful for correcting gparted slow 
 startup in situations when floppy drives doesn't exist but are enabled in bios
 (BZ #208821).


gparted-devices.patch:

--- NEW FILE gparted-devices.patch ---
--- src/GParted_Core.cc	2006/12/08 13:14:05	759
+++ src/GParted_Core.cc	2007/01/07 20:29:03	764
@@ -155,7 +155,20 @@
 		lp_device = ped_device_get_next( NULL );
 		while ( lp_device ) 
 		{
-			device_paths .push_back( lp_device ->path ) ;
+			//only add this device if we can read the first sector (which means it's a real device)
+			char * buf = static_cast<char *>( malloc( lp_device ->sector_size ) ) ;
+			if ( buf )
+			{
+				if ( ped_device_open( lp_device ) )
+				{
+					if ( ped_device_read( lp_device, buf, 0, 1 ) )
+						device_paths .push_back( lp_device ->path ) ;
+
+					ped_device_close( lp_device ) ;
+				}
+
+				free( buf ) ;
+			}
 			
 			lp_device = ped_device_get_next( lp_device ) ;
 		}
@@ -163,10 +176,10 @@
 
 		std::sort( device_paths .begin(), device_paths .end() ) ;
 	}
-	
+
 	for ( unsigned int t = 0 ; t < device_paths .size() ; t++ ) 
 	{ 
-		if ( device_paths[ t ] .length() > 6 && device_paths[ t ] .is_ascii() && open_device_and_disk( device_paths[ t ], false ) )
+		if ( open_device_and_disk( device_paths[ t ], false ) )
 		{
 			temp_device .Reset() ;


Index: gparted.spec
===================================================================
RCS file: /cvs/extras/rpms/gparted/FC-6/gparted.spec,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- gparted.spec	8 Mar 2007 02:12:13 -0000	1.18
+++ gparted.spec	14 Jun 2007 22:07:43 -0000	1.19
@@ -1,11 +1,12 @@
 Summary: Gnome Partition Editor
 Name:    gparted
 Version: 0.3.3
-Release: 2%{?dist}
+Release: 3%{?dist}
 Group:   Applications/System
 License: GPL
 URL:     http://gparted.sourceforge.net
 Source0: http://dl.sf.net/sourceforge/%{name}/%{name}-%{version}.tar.bz2
+Patch0: gparted-devices.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: gtkmm24-devel parted-devel 
 BuildRequires: e2fsprogs-devel gettext perl(XML::Parser) 
@@ -20,6 +21,7 @@
 
 %prep
 %setup -q
+%patch0 -p0 -b .devs
 
 %build
 %configure
@@ -77,6 +79,11 @@
 %config(noreplace) %{_sysconfdir}/security/console.apps/gparted
 
 %changelog
+* Mon Jun 11 2007 Deji Akingunola <dakingun at gmail.com> - 0.3.3-3
+- Apply patch to only detect real devices, useful for correcting gparted slow 
+ startup in situations when floppy drives doesn't exist but are enabled in bios
+ (BZ #208821).
+
 * Wed Mar 07 2007 Deji Akingunola <dakingun at gmail.com> - 0.3.3-2
 - Rebuild
 




More information about the fedora-extras-commits mailing list