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

« back to all changes in this revision

Viewing changes to debian/patches/02_udisks.patch

  • 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:
 
1
From 4168794e8e80d2d6457d87f33983cee2d836f527 Mon Sep 17 00:00:00 2001
 
2
From: Curtis Gedak <gedakc@gmail.com>
 
3
Date: Tue, 01 Jun 2010 23:04:39 +0000
 
4
Subject: Handle devkit-disks being renamed to udisks on Dec. 1, 2009.
 
5
 
 
6
Reference link for devkit-disks being renamed to udisks:
 
7
http://www.freedesktop.org/wiki/Software/DeviceKit-disks
 
8
 
 
9
Bug-Ubuntu: https://launchpad.net/bugs/588530
 
10
---
 
11
diff --git a/gparted.in b/gparted.in
 
12
index e6c1473..3a2696d 100755..100644
 
13
--- a/gparted.in
 
14
+++ b/gparted.in
 
15
@@ -9,8 +9,23 @@
 
16
 #
 
17
 
 
18
 #
 
19
+#  Search PATH to determine if udisks program can be found
 
20
+#  and if appropriate daemon is running.
 
21
+#
 
22
+HAVE_UDISKS=no
 
23
+for k in '' `echo "$PATH" | sed 's,:, ,g'`; do
 
24
+       if test -x "$k/udisks"; then
 
25
+               if test "z`ps -e | grep udisks-daemon`" != "z"; then
 
26
+                       HAVE_UDISKS=yes
 
27
+                       break
 
28
+               fi
 
29
+       fi
 
30
+done
 
31
+
 
32
+#
 
33
 #  Search PATH to determine if devkit-disks program can be found
 
34
 #  and if appropriate daemon is running.
 
35
+#  On December 1, 2009, devkit-disks was named udisks.
 
36
 #
 
37
 HAVE_DEVKIT_DISKS=no
 
38
 for k in '' `echo "$PATH" | sed 's,:, ,g'`; do
 
39
@@ -37,14 +52,17 @@ for k in '' `echo "$PATH" | sed 's,:, ,g'`; do
 
40
 done
 
41
 
 
42
 #
 
43
-#  Use both devkit-disks and hal-lock for invocation if both binaries exist
 
44
+#  Use udisks if binary exists and daemon is running.
 
45
+#  Else use both devkit-disks and hal-lock for invocation if both binaries exist
 
46
 #  and both of the daemons are running.
 
47
-#  Else use devkit-disks for invocation if binary exists and daemon is running.
 
48
+#  Else use devkit-disks if binary exists and daemon is running.
 
49
 #  Otherwise use hal-lock for invocation if binary exists and daemon is running.
 
50
 #  If the above checks fail then simply run gpartedbin.
 
51
 #
 
52
 BASE_CMD="@installdir@/gpartedbin $*"
 
53
-if test "x$HAVE_DEVKIT_DISKS" = "xyes" && test "x$HAVE_HAL_LOCK" = "xyes"; then
 
54
+if test "x$HAVE_UDISKS" = "xyes"; then
 
55
+       udisks --inhibit -- $BASE_CMD
 
56
+elif test "x$HAVE_DEVKIT_DISKS" = "xyes" && test "x$HAVE_HAL_LOCK" = "xyes"; then
 
57
        devkit-disks --inhibit -- \
 
58
                hal-lock --interface org.freedesktop.Hal.Device.Storage --exclusive \
 
59
                        --run "$BASE_CMD"
 
60
--
 
61
cgit v0.8.3.1