~ubuntu-branches/ubuntu/maverick/gparted/maverick-proposed

« back to all changes in this revision

Viewing changes to gparted.in

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2010-07-20 15:00:40 UTC
  • Revision ID: james.westby@ubuntu.com-20100720150040-ie66i3y752w3ue4a
Tags: 0.5.2-2ubuntu2
Add 02_udisks.patch: Use udisks in favor of devicekit-disks and hal to
inhibit automount while gparted is running. Patch backported from 6.0.
(LP: #588530)

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
#
10
10
 
11
11
#
 
12
#  Search PATH to determine if udisks program can be found
 
13
#  and if appropriate daemon is running.
 
14
#
 
15
HAVE_UDISKS=no
 
16
for k in '' `echo "$PATH" | sed 's,:, ,g'`; do
 
17
        if test -x "$k/udisks"; then
 
18
                if test "z`ps -e | grep udisks-daemon`" != "z"; then
 
19
                        HAVE_UDISKS=yes
 
20
                        break
 
21
                fi
 
22
        fi
 
23
done
 
24
 
 
25
#
12
26
#  Search PATH to determine if devkit-disks program can be found
13
27
#  and if appropriate daemon is running.
 
28
#  On December 1, 2009, devkit-disks was named udisks.
14
29
#
15
30
HAVE_DEVKIT_DISKS=no
16
31
for k in '' `echo "$PATH" | sed 's,:, ,g'`; do
37
52
done
38
53
 
39
54
#
40
 
#  Use both devkit-disks and hal-lock for invocation if both binaries exist
 
55
#  Use udisks if binary exists and daemon is running.
 
56
#  Else use both devkit-disks and hal-lock for invocation if both binaries exist
41
57
#  and both of the daemons are running.
42
 
#  Else use devkit-disks for invocation if binary exists and daemon is running.
 
58
#  Else use devkit-disks if binary exists and daemon is running.
43
59
#  Otherwise use hal-lock for invocation if binary exists and daemon is running.
44
60
#  If the above checks fail then simply run gpartedbin.
45
61
#
46
62
BASE_CMD="@installdir@/gpartedbin $*"
47
 
if test "x$HAVE_DEVKIT_DISKS" = "xyes" && test "x$HAVE_HAL_LOCK" = "xyes"; then
 
63
if test "x$HAVE_UDISKS" = "xyes"; then
 
64
        udisks --inhibit -- $BASE_CMD
 
65
elif test "x$HAVE_DEVKIT_DISKS" = "xyes" && test "x$HAVE_HAL_LOCK" = "xyes"; then
48
66
        devkit-disks --inhibit -- \
49
67
                hal-lock --interface org.freedesktop.Hal.Device.Storage --exclusive \
50
68
                        --run "$BASE_CMD"