From 70332b22b1bd064d1ce1467afad65443821b5337 Mon Sep 17 00:00:00 2001 From: Deji Akingunola Date: Mon, 11 Jun 2007 20:44:10 +0000 Subject: [PATCH] - Apply patch to only detect real devices, useful for correcting gparted slow startup in situations when floppy drives don't exist but are enabled in bios (BZ #208821). --- gparted-devices.patch | 36 ++++++++++++++++++++++++++++++++++++ gparted.spec | 11 +++++++++-- 2 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 gparted-devices.patch diff --git a/gparted-devices.patch b/gparted-devices.patch new file mode 100644 index 0000000..0f2d35e --- /dev/null +++ b/gparted-devices.patch @@ -0,0 +1,36 @@ +--- 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( 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() ; diff --git a/gparted.spec b/gparted.spec index b363bdf..382472f 100644 --- a/gparted.spec +++ b/gparted.spec @@ -1,7 +1,7 @@ Summary: Gnome Partition Editor Name: gparted Version: 0.3.3 -Release: 10%{?dist} +Release: 11%{?dist} Group: Applications/System License: GPL URL: http://gparted.sourceforge.net @@ -10,6 +10,7 @@ Source1: run-gparted Source2: gparted-console.apps Source3: gparted-pam.d Patch0: gparted-dont-lock-hal.patch +Patch1: gparted-devices.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: gtkmm24-devel parted-devel BuildRequires: e2fsprogs-devel gettext perl(XML::Parser) @@ -25,7 +26,8 @@ will be detected at runtime and don't require a rebuild of GParted %prep %setup -q -%patch -p0 -b .hal +%patch0 -p0 -b .hal +%patch1 -p0 -b .devs %build %configure @@ -81,6 +83,11 @@ fi %config(noreplace) %{_sysconfdir}/security/console.apps/gparted %changelog +* Mon Jun 11 2007 Deji Akingunola - 0.3.3-11 +- Apply patch to only detect real devices, useful for correcting gparted slow + startup in situations when floppy drives don't exist but are enabled in bios + (BZ #208821). + * Wed Apr 18 2007 Deji Akingunola - 0.3.3-10 - Fix another typos in the run-gparted script