diff -u gparted-0.3.5/debian/rules gparted-0.3.5/debian/rules --- gparted-0.3.5/debian/rules +++ gparted-0.3.5/debian/rules @@ -38,6 +38,8 @@ dh_installdirs $(MAKE) install DESTDIR=$(CURDIR)/debian/gparted + mv debian/gparted/usr/bin/gparted debian/gparted/usr/bin/gparted.real + install -m 755 debian/gparted.hal-lock-wrapper.sh debian/gparted/usr/bin/gparted binary-indep: build install diff -u gparted-0.3.5/debian/changelog gparted-0.3.5/debian/changelog --- gparted-0.3.5/debian/changelog +++ gparted-0.3.5/debian/changelog @@ -1,3 +1,16 @@ +gparted (0.3.5-1ubuntu4) hardy-proposed; urgency=low + + * Add debian/gparted.hal-lock-wrapper.sh: Run real gparted under hal-lock if + it is available, to prevent auto-mounting of freshly created partitions. + Backported from 0.3.8. + * debian/rules: Install real gparted under /usr/bin/gparted.real, and put + above wrapper script into /usr/bin/gparted instead. This roughly resembles + http://svn.gnome.org/viewvc/gparted?view=revision&revision=826 but avoids + changing the upstream build system for an SRU. + * LP: #37768 + + -- Martin Pitt Mon, 13 Oct 2008 13:08:40 +0200 + gparted (0.3.5-1ubuntu3) hardy; urgency=low * debian/patches/01_fix-desktop.patch: Fix comment field (LP: #114648) only in patch2: unchanged: --- gparted-0.3.5.orig/debian/gparted.hal-lock-wrapper.sh +++ gparted-0.3.5/debian/gparted.hal-lock-wrapper.sh @@ -0,0 +1,38 @@ +#!/bin/sh +# +# Purpose: Perform appropriate startup of GParted executable gpartedbin. +# +# On systems with hal-lock, use hal-lock to acquire device +# locks prior to running gparted.real. +# 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 gparted.real directly. +# + +# +# 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 + if test "z`ps -e | grep hald`" != "z"; then + HAVE_HAL_LOCK=yes + break + fi + fi +done + +# +# 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 "/usr/bin/gparted.real $*" +else + /usr/bin/gparted.real $* +fi +