packages: luks-tools/luks-tools.spec, luks-tools/udisks.patch (NEW) - port ...

glen glen at pld-linux.org
Mon Aug 22 22:40:35 CEST 2011


Author: glen                         Date: Mon Aug 22 20:40:35 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- port to use udisks instead of hal

---- Files affected:
packages/luks-tools:
   luks-tools.spec (1.11 -> 1.12) , udisks.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/luks-tools/luks-tools.spec
diff -u packages/luks-tools/luks-tools.spec:1.11 packages/luks-tools/luks-tools.spec:1.12
--- packages/luks-tools/luks-tools.spec:1.11	Wed Aug 17 23:40:37 2011
+++ packages/luks-tools/luks-tools.spec	Mon Aug 22 22:40:30 2011
@@ -3,11 +3,12 @@
 Summary(pl.UTF-8):	Narzędzia do pracy z systemami plików chronionymi przez LUKS
 Name:		luks-tools
 Version:	0.0.14
-Release:	1
+Release:	2
 License:	GPL v2
 Group:		Applications
 Source0:	http://www.flyn.org/projects/luks-tools/%{name}-%{version}.tar.gz
 # Source0-md5:	c9b5f19e2b601c8f776e98c4a8c2189d
+Patch0:		udisks.patch
 URL:		http://www.flyn.org/projects/luks-tools/index.html
 BuildRequires:	autoconf
 BuildRequires:	automake
@@ -46,6 +47,7 @@
 
 %prep
 %setup -q
+%patch0 -p1
 
 # let rpm generate %{__python} dep
 %{__sed} -i -e '1s,^#!.*python,#!%{__python},' src/gnome-luks-format.in
@@ -92,6 +94,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.12  2011/08/22 20:40:30  glen
+- port to use udisks instead of hal
+
 Revision 1.11  2011/08/17 21:40:37  glen
 - up to 0.0.14
 

================================================================
Index: packages/luks-tools/udisks.patch
diff -u /dev/null packages/luks-tools/udisks.patch:1.1
--- /dev/null	Mon Aug 22 22:40:35 2011
+++ packages/luks-tools/udisks.patch	Mon Aug 22 22:40:30 2011
@@ -0,0 +1,51 @@
+--- luks-tools-0.0.14/src/gnome-luks-format.in	2011-08-22 23:37:49.412140022 +0300
++++ luks-tools-0.0.14/src/gnome-luks-format.in	2011-08-19 22:45:05.749157578 +0300
+@@ -220,20 +220,36 @@
+ 	def setupAvailableDevices(self, menu):
+ 		# Find available block devices.
+ 		bus = dbus.Bus.get_system()
+-		hal_manager = bus.get_object("org.freedesktop.Hal",
+-		                             "/org/freedesktop/Hal/Manager")
+-		blockDevs = hal_manager.FindDeviceByCapability("block",
+-			           dbus_interface="org.freedesktop.Hal.Manager")
+-
+-		for devUri in blockDevs:
+-		        dev = bus.get_object ("org.freedesktop.Hal", devUri)
+-			devIface = dbus.Interface(dev,
+-			                          "org.freedesktop.Hal.Device")
+-			devicePath = devIface.GetPropertyString ("block.device")
+-			self.addToAvailableDevices(menu, devicePath)
++		proxy = bus.get_object("org.freedesktop.UDisks", "/org/freedesktop/UDisks")
++		iface = dbus.Interface(proxy, "org.freedesktop.UDisks")
++		devices = iface.EnumerateDevices()
++
++		for device in devices:
++			dev_obj = bus.get_object("org.freedesktop.UDisks", device)
++			dev = dbus.Interface(dev_obj, "org.freedesktop.DBus.Properties")
++			data = {
++				'is_optical': bool(dev.Get(device, 'DeviceIsOpticalDisc')),
++				'device': str(dev.Get(device, 'DeviceFile')),
++				'mount': map(str, list(dev.Get(device, 'DeviceMountPaths'))),
++				'size': int(dev.Get(device, 'DeviceSize')),
++			}
++
++			# Skip things without a size
++			if not data['size']:
++				continue
++
++			# Skip optical drives
++			if data['is_optical']:
++				continue
++
++			# skip mounted disks
++			if data['mount']:
++				continue
++
++			self.addToAvailableDevices(menu, data['device'])
+ 
+ 		# FIXME: what should be default?  do we need to ask are you sure?
+-		self.device = devicePath
++		self.device = data['device']
+ 
+ 	def error(self, msg):
+ 		l = self.glade.get_widget("labelErr")
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/luks-tools/luks-tools.spec?r1=1.11&r2=1.12&f=u



More information about the pld-cvs-commit mailing list