From 9db4c229e520acce2e80a4871f2b996becc58a1f Mon Sep 17 00:00:00 2001 From: Deji Akingunola Date: Sat, 9 Feb 2008 04:09:19 +0000 Subject: [PATCH] - New upstream version --- .cvsignore | 2 +- gparted-devices.patch | 36 -------------------- gparted-dont-lock-hal.patch | 60 +++++++++++++++++++++++++++++---- gparted-realpath-fix.patch | 35 +++++-------------- gparted-refresh_crash-fix.patch | 18 ++++++++-- gparted.spec | 17 +++++----- sources | 2 +- 7 files changed, 89 insertions(+), 81 deletions(-) delete mode 100644 gparted-devices.patch diff --git a/.cvsignore b/.cvsignore index 501f72e..58ffb7a 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -gparted-0.3.3.tar.bz2 +gparted-0.3.5.tar.bz2 diff --git a/gparted-devices.patch b/gparted-devices.patch deleted file mode 100644 index 0f2d35e..0000000 --- a/gparted-devices.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- 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-dont-lock-hal.patch b/gparted-dont-lock-hal.patch index 3bddc66..caa2029 100644 --- a/gparted-dont-lock-hal.patch +++ b/gparted-dont-lock-hal.patch @@ -1,17 +1,63 @@ ---- src/GParted_Core.cc 2006-12-05 14:39:31.000000000 -0500 -+++ src/GParted_Core.cc.new 2007-04-02 21:59:01.000000000 -0400 -@@ -54,21 +54,6 @@ +--- src/GParted_Core.cc 2008-02-04 09:35:47.000000000 -0500 ++++ src/GParted_Core.cc.new 2008-02-07 15:26:32.000000000 -0500 +@@ -38,8 +38,6 @@ + #include "../include/ufs.h" + + #include +-#include +-#include + #include + + std::vector libparted_messages ; //see ped_exception_handler() +@@ -47,13 +45,6 @@ + namespace GParted + { + +-// Clean up the fdi when terminating +-void sig_fdi_cleanup( int signum ) +-{ +- remove( "/usr/share/hal/fdi/policy/gparted-disable-automount.fdi" ); +- raise( signum ); +-} +- + GParted_Core::GParted_Core() + { + lp_device = NULL ; +@@ -63,44 +54,6 @@ ped_exception_set_handler( ped_exception_handler ) ; - + +- //make sure that the fdi is cleaned up on all but the most forceful +- //program exits +- struct sigaction sa; +- sa.sa_handler = sig_fdi_cleanup; +- sigemptyset( &sa.sa_mask ); +- sa.sa_flags = SA_RESETHAND; +- if( sigaction( SIGHUP, &sa, NULL ) == -1 || +- sigaction( SIGINT, &sa, NULL ) == -1 || +- sigaction( SIGQUIT, &sa, NULL ) == -1 || +- sigaction( SIGILL, &sa, NULL ) == -1 || +- sigaction( SIGABRT, &sa, NULL ) == -1 || +- sigaction( SIGFPE, &sa, NULL ) == -1 || +- sigaction( SIGSEGV, &sa, NULL ) == -1 || +- sigaction( SIGPIPE, &sa, NULL ) == -1 || +- sigaction( SIGALRM, &sa, NULL ) == -1 || +- sigaction( SIGTERM, &sa, NULL ) == -1 || +- sigaction( SIGUSR1, &sa, NULL ) == -1 || +- sigaction( SIGUSR2, &sa, NULL ) == -1 || +- sigaction( SIGBUS, &sa, NULL ) == -1 || +- sigaction( SIGXCPU, &sa, NULL ) == -1 || +- sigaction( SIGXFSZ, &sa, NULL ) == -1 ) +- perror( "Could not set signal handler" ); +- - //disable automount //FIXME: temporary hack, till i find a better solution... - std::ofstream fdi_file( "/usr/share/hal/fdi/policy/gparted-disable-automount.fdi" ) ; - if ( fdi_file ) - { - fdi_file << "" ; - fdi_file << "" ; -- fdi_file << "" ; -- fdi_file << "true" ; +- fdi_file << "" ; +- fdi_file << "false" ; - fdi_file << "" ; - fdi_file << "" ; - fdi_file << "" ; @@ -22,7 +68,7 @@ //get valid flags ... for ( PedPartitionFlag flag = ped_partition_flag_next( static_cast( NULL ) ) ; flag ; -@@ -2287,8 +2272,6 @@ +@@ -2332,8 +2285,6 @@ if ( p_filesystem ) delete p_filesystem ; diff --git a/gparted-realpath-fix.patch b/gparted-realpath-fix.patch index af44446..daad905 100644 --- a/gparted-realpath-fix.patch +++ b/gparted-realpath-fix.patch @@ -1,28 +1,11 @@ ---- src/GParted_Core.cc 2006-12-05 14:39:31.000000000 -0500 -+++ src/GParted_Core.cc.new 2007-11-22 00:01:43.000000000 -0500 -@@ -487,19 +487,23 @@ +--- src/GParted_Core.cc 2008-02-04 09:35:47.000000000 -0500 ++++ src/GParted_Core.cc.new2 2008-02-07 15:57:14.000000000 -0500 +@@ -527,7 +527,7 @@ + std::ifstream proc_partitions( "/proc/partitions" ) ; + if ( proc_partitions ) + { +- char c_str[255] ; ++ char c_str[PATH_MAX+1] ; + while ( getline( proc_partitions, line ) ) if ( sscanf( line .c_str(), "%*d %*d %*d %255s", c_str ) == 1 ) - { -+ char *real_path = NULL; -+ - line = "/dev/" ; - line += c_str ; - - //FIXME: it seems realpath is very unsafe to use (manpage)... -+ real_path = realpath( line .c_str(), NULL ) ; - if ( file_test( line, Glib::FILE_TEST_EXISTS ) && -- realpath( line .c_str(), c_str ) && -+ real_path && - line != c_str ) - { - //because we can make no assumption about which path libparted will detect - //we add all combinations. - alternate_paths[ c_str ] = line ; -- alternate_paths[ line ] = c_str ; - } -+ if ( real_path ) -+ free( real_path ) ; - } - - proc_partitions .close() ; diff --git a/gparted-refresh_crash-fix.patch b/gparted-refresh_crash-fix.patch index 6d0bcf8..47a206e 100644 --- a/gparted-refresh_crash-fix.patch +++ b/gparted-refresh_crash-fix.patch @@ -8,8 +8,8 @@ GParted_Core gparted_core ; std::vector device_info ; ---- src/Win_GParted.cc 2006-12-01 08:14:23.000000000 -0500 -+++ src/Win_GParted.cc.new 2007-10-30 00:35:47.000000000 -0400 +--- src/Win_GParted.cc 2008-02-04 09:35:47.000000000 -0500 ++++ src/Win_GParted.cc.new 2008-02-07 15:34:30.000000000 -0500 @@ -260,7 +260,8 @@ combo_devices .pack_start( treeview_devices_columns .device ) ; combo_devices .pack_start( treeview_devices_columns .size, false ) ; @@ -36,3 +36,17 @@ combo_devices .set_active( current_device ) ; } +@@ -916,13 +919,8 @@ + + void Win_GParted::combo_devices_changed() + { +- unsigned int old_current_device = current_device; + //set new current device + current_device = combo_devices .get_active_row_number() ; +- if ( current_device == (unsigned int) -1 ) +- current_device = old_current_device; +- if ( current_device >= devices .size() ) +- current_device = 0 ; + set_title( String::ucompose( _("%1 - GParted"), devices[ current_device ] .get_path() ) ); + + //refresh label_device_info diff --git a/gparted.spec b/gparted.spec index 8baca60..31b58e6 100644 --- a/gparted.spec +++ b/gparted.spec @@ -1,7 +1,7 @@ Summary: Gnome Partition Editor Name: gparted -Version: 0.3.3 -Release: 16%{?dist} +Version: 0.3.5 +Release: 1%{?dist} Group: Applications/System License: GPLv2+ URL: http://gparted.sourceforge.net @@ -10,9 +10,8 @@ Source1: run-gparted Source2: gparted-console.apps Source3: gparted-pam.d Patch0: gparted-dont-lock-hal.patch -Patch1: gparted-devices.patch -Patch2: gparted-realpath-fix.patch -Patch3: gparted-refresh_crash-fix.patch +Patch1: gparted-realpath-fix.patch +Patch2: gparted-refresh_crash-fix.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: gtkmm24-devel parted-devel BuildRequires: e2fsprogs-devel gettext perl(XML::Parser) @@ -30,9 +29,8 @@ will be detected at runtime and don't require a rebuild of GParted %prep %setup -q %patch0 -p0 -b .hal -%patch1 -p0 -b .devs -%patch2 -p0 -b .realpath -%patch3 -p0 -b .refresh +%patch1 -p0 -b .realpath +%patch2 -p0 -b .refresh %build %configure @@ -88,6 +86,9 @@ fi %config(noreplace) %{_sysconfdir}/security/console.apps/gparted %changelog +* Thu Feb 07 2008 Deji Akingunola - 0.3.5-1 +- New upstream version + * Fri Jan 04 2008 Adam Tkac - 0.3.3-16 - rebuild against new parted diff --git a/sources b/sources index 53c76c5..1193a4d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -f3d16ccfda72fa1dac9fa1ff9ded2c42 gparted-0.3.3.tar.bz2 +c99c3d78192519b0b7c932a0920ac169 gparted-0.3.5.tar.bz2