[Pkg-xfce-commits] r1882 - in desktop/trunk/exo/debian: . patches

corsac at alioth.debian.org corsac at alioth.debian.org
Sun Apr 20 15:49:24 UTC 2008


Author: corsac
Date: 2008-04-20 15:49:23 +0000 (Sun, 20 Apr 2008)
New Revision: 1882

Added:
   desktop/trunk/exo/debian/patches/
   desktop/trunk/exo/debian/patches/01_exo-alt-eject.patch
   desktop/trunk/exo/debian/patches/series
Modified:
   desktop/trunk/exo/debian/changelog
   desktop/trunk/exo/debian/control
   desktop/trunk/exo/debian/rules
Log:
* debian/patches: 01_exo-alt-eject added, fix optical discs ejection, patch
  taken from Xfce bugzila (#2968)                             closes: #469425
* debian/control: add build-dep on quilt.
* debian/rules: include quilt rules.

Modified: desktop/trunk/exo/debian/changelog
===================================================================
--- desktop/trunk/exo/debian/changelog	2008-04-20 11:37:05 UTC (rev 1881)
+++ desktop/trunk/exo/debian/changelog	2008-04-20 15:49:23 UTC (rev 1882)
@@ -1,3 +1,12 @@
+exo (0.3.4-6) UNRELEASED; urgency=low
+
+  * debian/patches: 01_exo-alt-eject added, fix optical discs ejection, patch
+    taken from Xfce bugzila (#2968)                             closes: #469425
+  * debian/control: add build-dep on quilt.
+  * debian/rules: include quilt rules.
+
+ -- Yves-Alexis Perez <corsac at debian.org>  Sun, 20 Apr 2008 16:01:19 +0200
+
 exo (0.3.4-5) unstable; urgency=low
 
   * build exo with libnotify support.                           closes: #472255

Modified: desktop/trunk/exo/debian/control
===================================================================
--- desktop/trunk/exo/debian/control	2008-04-20 11:37:05 UTC (rev 1881)
+++ desktop/trunk/exo/debian/control	2008-04-20 15:49:23 UTC (rev 1882)
@@ -2,7 +2,7 @@
 Priority: optional
 Maintainer: Debian Xfce Maintainers <pkg-xfce-devel at lists.alioth.debian.org>
 Uploaders: Emanuele Rocca <ema at debian.org>, Simon Huggins <huggie at earth.li>, Rudy Godoy <rudy at kernel-panik.org>, Martin Loschwitz <madkiss at debian.org>, Yves-Alexis Perez <corsac at debian.org>
-Build-Depends: debhelper (>= 5.0.0), libxfcegui4-dev (>= 4.4.2), liburi-perl, xfce4-mcs-manager-dev, chrpath, libhal-storage-dev [!hurd-i386], libnotify-dev
+Build-Depends: debhelper (>= 5.0.0), libxfcegui4-dev (>= 4.4.2), liburi-perl, xfce4-mcs-manager-dev, chrpath, libhal-storage-dev [!hurd-i386], libnotify-dev, quilt
 Standards-Version: 3.7.3
 Section: libs
 Homepage: http://libexo.os-cillation.com/

Added: desktop/trunk/exo/debian/patches/01_exo-alt-eject.patch
===================================================================
--- desktop/trunk/exo/debian/patches/01_exo-alt-eject.patch	                        (rev 0)
+++ desktop/trunk/exo/debian/patches/01_exo-alt-eject.patch	2008-04-20 15:49:23 UTC (rev 1882)
@@ -0,0 +1,207 @@
+diff --git a/exo-mount/exo-mount-hal.c b/exo-mount/exo-mount-hal.c
+index 791a536..4084719 100644
+--- a/exo-mount/exo-mount-hal.c
++++ b/exo-mount/exo-mount-hal.c
+@@ -145,6 +145,42 @@ exo_mount_hal_propagate_error (GError   **error,
+ }
+ 
+ 
++static gboolean
++string_in_list(gchar * const *haystack, const gchar *needle)
++{
++  gint n;
++
++  if (!haystack)
++      return FALSE;
++
++  for (n=0; haystack[n]; ++n) {
++      if (!strcmp (haystack[n], needle))
++          return TRUE;
++  }
++  return FALSE;
++}
++
++
++static gboolean
++device_has_interface(const gchar *udi, const gchar *iface,
++        DBusError *derror)
++{
++  gboolean result;
++  gchar **interfaces;
++
++  /* determine the info.interfaces property of the device */
++  interfaces = libhal_device_get_property_strlist (hal_context, udi,
++          "info.interfaces", derror);
++
++  /* check for the interface we need */
++  result = string_in_list(interfaces, iface);
++  libhal_free_string_array(interfaces);
++
++  return result;
++}
++
++
++
+ 
+ /**
+  * exo_mount_hal_device_from_udi:
+@@ -158,18 +194,15 @@ exo_mount_hal_propagate_error (GError   **error,
+  *               or %NULL in case of an error.
+  **/
+ ExoMountHalDevice*
+-exo_mount_hal_device_from_udi (const gchar *udi,
++exo_mount_hal_device_from_udi (const gchar *in_udi,
+                                GError     **error)
+ {
+   ExoMountHalDevice *device = NULL;
+   DBusError          derror;
+-  gchar            **interfaces;
+-  gchar            **volume_udis;
+-  gchar             *volume_udi = NULL;
+   gint               n_volume_udis;
+-  gint               n;
++  gchar             *udi;
+ 
+-  g_return_val_if_fail (udi != NULL, NULL);
++  g_return_val_if_fail (in_udi != NULL, NULL);
+   g_return_val_if_fail (error == NULL || *error == NULL, NULL);
+ 
+   /* make sure the HAL support is initialized */
+@@ -179,55 +212,60 @@ exo_mount_hal_device_from_udi (const gchar *udi,
+   /* initialize D-Bus error */
+   dbus_error_init (&derror);
+ 
+-again:
+-  /* determine the info.interfaces property of the device */
+-  interfaces = libhal_device_get_property_strlist (hal_context, udi, "info.interfaces", &derror);
+-  if (G_UNLIKELY (interfaces == NULL))
++  udi = g_strdup (in_udi);
++  /* at this point, we own udi */
++
++  /* maybe we have a mountable device here */
++  while(G_UNLIKELY (!device_has_interface (udi,
++                  "org.freedesktop.Hal.Device.Volume", &derror)))
+     {
+-      /* reset D-Bus error */
+-      dbus_error_free (&derror);
++      gchar **volume_udis;
+ 
+-      /* release any previous volume UDI */
+-      g_free (volume_udi);
+-      volume_udi = NULL;
++      /* maybe there was a D-Bus error? gotta check */
++      if (G_UNLIKELY (dbus_error_is_set (&derror)))
++        {
++          exo_mount_hal_propagate_error (error, &derror);
++          g_free (udi);
++          return NULL;
++        }
++
++      /* maybe we have a volume whose parent is identified by the udi */
++      volume_udis = libhal_manager_find_device_string_match (hal_context,
++              "info.parent", udi, &n_volume_udis, &derror);
+ 
+-      /* ok, but maybe we have a volume whose parent is identified by the udi */
+-      volume_udis = libhal_manager_find_device_string_match (hal_context, "info.parent", udi, &n_volume_udis, &derror);
+       if (G_UNLIKELY (volume_udis == NULL))
+         {
+-err0:     exo_mount_hal_propagate_error (error, &derror);
+-          goto out;
++          exo_mount_hal_propagate_error (error, &derror);
++          g_free (udi);
++          return NULL;
+         }
+       else if (G_UNLIKELY (n_volume_udis < 1))
+         {
+-          /* no match, we cannot handle that device */
+           libhal_free_string_array (volume_udis);
+-          goto err1;
++          dbus_error_free (&derror);
++          /* definitely not a device that we're able to
++           * mount, eject or unmount */
++          g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
++                  _("Given device \"%s\" is not a volume or drive"), udi);
++          g_free (udi);
++          return NULL;
+         }
+ 
++      g_free (udi);
++
+       /* use the first volume UDI... */
+-      volume_udi = g_strdup (volume_udis[0]);
++      udi = g_strdup (volume_udis[0]);
+       libhal_free_string_array (volume_udis);
+-
+       /* ..and try again using that UDI */
+-      udi = (const gchar *) volume_udi;
+-      goto again;
+     }
+ 
+-  /* verify that we have a mountable device here */
+-  for (n = 0; interfaces[n] != NULL; ++n)
+-    if (strcmp (interfaces[n], "org.freedesktop.Hal.Device.Volume") == 0)
+-      break;
+-  if (G_UNLIKELY (interfaces[n] == NULL))
+-    {
+-      /* definitely not a device that we're able to mount, eject or unmount */
+-err1: g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, _("Given device \"%s\" is not a volume or drive"), udi);
+-      goto out;
+-    }
++  /* at this point, udi contains the UDI of something
++   * that implements Hal.Device.Volume.
++   * udi is the only resource that we hold here. */
+ 
+   /* setup the device struct */
+   device = g_new0 (ExoMountHalDevice, 1);
+-  device->udi = g_strdup (udi);
++  device->udi = udi;
+ 
+   /* check if we have a volume here */
+   device->volume = libhal_volume_from_udi (hal_context, udi);
+@@ -269,8 +307,8 @@ err1: g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, _("Given device \"%
+   if (G_UNLIKELY (device->file == NULL || device->name == NULL))
+     {
+       exo_mount_hal_device_free (device);
+-      device = NULL;
+-      goto err0;
++      exo_mount_hal_propagate_error(error, &derror);
++      return NULL;
+     }
+ 
+   /* check if we failed */
+@@ -282,11 +320,7 @@ err1: g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, _("Given device \"%
+       device = NULL;
+     }
+ 
+-out:
+-  /* cleanup */
+-  libhal_free_string_array (interfaces);
+-  g_free (volume_udi);
+-
++  dbus_error_free (&derror);
+   return device;
+ }
+ 
+@@ -313,7 +347,7 @@ exo_mount_hal_device_from_file (const gchar *file,
+   gchar            **interfaces;
+   gchar            **udis;
+   gint               n_udis;
+-  gint               n, m;
++  gint               n;
+ 
+   g_return_val_if_fail (g_path_is_absolute (file), NULL);
+   g_return_val_if_fail (error == NULL || *error == NULL, NULL);
+@@ -347,12 +381,7 @@ exo_mount_hal_device_from_file (const gchar *file,
+         continue;
+ 
+       /* check if we have a mountable device here */
+-      for (m = 0; interfaces[m] != NULL; ++m)
+-        if (strcmp (interfaces[m], "org.freedesktop.Hal.Device.Volume") == 0)
+-          break;
+-
+-      /* check if it's a usable device */
+-      if (interfaces[m] != NULL)
++      if (string_in_list (interfaces, "org.freedesktop.Hal.Device.Volume"))
+         {
+           libhal_free_string_array (interfaces);
+           break;

Added: desktop/trunk/exo/debian/patches/series
===================================================================
--- desktop/trunk/exo/debian/patches/series	                        (rev 0)
+++ desktop/trunk/exo/debian/patches/series	2008-04-20 15:49:23 UTC (rev 1882)
@@ -0,0 +1 @@
+01_exo-alt-eject.patch

Modified: desktop/trunk/exo/debian/rules
===================================================================
--- desktop/trunk/exo/debian/rules	2008-04-20 11:37:05 UTC (rev 1881)
+++ desktop/trunk/exo/debian/rules	2008-04-20 15:49:23 UTC (rev 1882)
@@ -4,6 +4,8 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
+include /usr/share/quilt/quilt.make
+
 # These are used for cross-compiling and for saving the configure script
 # from having to guess our platform (since we know it already)
 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
@@ -35,7 +37,7 @@
 major=`ls exo/.libs/lib*.so.* | \
  awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'`
 
-config.status: configure
+config.status: patch configure
 	dh_testdir
 	# Add here commands to configure the package.
 	CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --sysconfdir=/etc --libexecdir=/usr/lib/libexo-0.3-0 --enable-final --disable-gtk-doc --disable-python --enable-notifications
@@ -50,7 +52,7 @@
 
 	touch build-stamp
 
-clean:
+clean: unpatch
 	dh_testdir
 	dh_testroot
 	rm -f build-stamp 




More information about the Pkg-xfce-commits mailing list