summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilles Dartiguelongue <eva@gentoo.org>2008-06-15 18:54:28 +0000
committerGilles Dartiguelongue <eva@gentoo.org>2008-06-15 18:54:28 +0000
commit706310a7406ddff8d11289952ddb8a5a9cfa6e80 (patch)
treea47f0f0360cb997c34cba0ce10a59b88463da1c9 /sys-block/gparted/files/gparted-0.3.7-hal-lock.patch
parentadd xfce use flag for sys-block/gparted (diff)
downloadhistorical-706310a7406ddff8d11289952ddb8a5a9cfa6e80.tar.gz
historical-706310a7406ddff8d11289952ddb8a5a9cfa6e80.tar.bz2
historical-706310a7406ddff8d11289952ddb8a5a9cfa6e80.zip
do not fail in absence of hal, bug #220459. more su helper sweetness, bug #220383.
Package-Manager: portage-2.1.5.4
Diffstat (limited to 'sys-block/gparted/files/gparted-0.3.7-hal-lock.patch')
-rw-r--r--sys-block/gparted/files/gparted-0.3.7-hal-lock.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/sys-block/gparted/files/gparted-0.3.7-hal-lock.patch b/sys-block/gparted/files/gparted-0.3.7-hal-lock.patch
new file mode 100644
index 000000000000..84d73c049c01
--- /dev/null
+++ b/sys-block/gparted/files/gparted-0.3.7-hal-lock.patch
@@ -0,0 +1,50 @@
+--- /var/tmp/portage/sys-block/gparted-0.3.7/work/gparted-0.3.7/gparted.in 2008-04-29 16:17:29.000000000 +0200
++++ gparted.in 2008-06-15 19:21:32.000000000 +0200
+@@ -1,23 +1,35 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+-# Purpose: Acquire device locks prior to running gparted.
++# Purpose: Perform appropriate startup of GParted executable gpartedbin.
++#
++# On systems with hal-lock, use hal-lock to acquire device
++# locks prior to running gpartedbin.
+ # This is to prevent devices from being automounted.
+ # File system problems can occur if devices are mounted
+ # prior to the completion of GParted's operations.
+ # See GParted bug #324220
+ # http://bugzilla.gnome.org/show_bug.cgi?id=324220
+ #
++# On systems without hal-lock, invoke gpartedbin directly.
+ #
+-# Following is a quote from HAL 0.5.10 Specification.
+-# http://people.freedesktop.org/~david/hal-spec/hal-spec.html#locking-guidelines
++
+ #
+-# In order to prevent HAL-based automounters from mounting partitions
+-# that are being prepared, applications that access block devices
+-# directly (and pokes the kernel to reload the partitioning table)
+-# should lock out automounters by either a) obtaining the
+-# org.freedesktop.Hal.Device.Storage lock on each drive being processed;
+-# or b) obtaining the global org.freedesktop.Hal.Device.Storage lock.
++# Search PATH to determine if hal-lock program can be found
+ #
++HAVE_HAL_LOCK=no
++for k in '' `echo "$PATH" | sed 's,:, ,g'`; do
++ if test -x "$k/hal-lock"; then
++ HAVE_HAL_LOCK=yes
++ break
++ fi
++done
+
+-hal-lock --interface org.freedeskdesktop.Hal.Device.Storage --exclusive \
+- --run @installdir@/gpartedbin $*
++#
++# Use hal-lock for invocation if it exists, otherwise simply run gpartedbin
++#
++if test "x$HAVE_HAL_LOCK" = "xyes"; then
++ hal-lock --interface org.freedeskdesktop.Hal.Device.Storage --exclusive \
++ --run "@installdir@/gpartedbin $*"
++else
++ @installdir@/gpartedbin $*
++fi