[arch-commits] Commit in nautilus-cd-burner/trunk (PKGBUILD use-gio-for-eject.patch)
Jan de Groot
jgc at archlinux.org
Sat Oct 31 20:12:26 UTC 2009
Date: Saturday, October 31, 2009 @ 16:12:26
Author: jgc
Revision: 57520
upgpkg: nautilus-cd-burner 2.25.3-1
Update to 2.25.3 - removes eel dependency for nautilus extension, remove dependency on gnome-mount
Added:
nautilus-cd-burner/trunk/use-gio-for-eject.patch
Modified:
nautilus-cd-burner/trunk/PKGBUILD
-------------------------+
PKGBUILD | 17 ++-
use-gio-for-eject.patch | 198 ++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 208 insertions(+), 7 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2009-10-31 20:03:26 UTC (rev 57519)
+++ PKGBUILD 2009-10-31 20:12:26 UTC (rev 57520)
@@ -2,22 +2,25 @@
# Maintainer: Jan de Groot <jgc at archlinux.org>
pkgname=nautilus-cd-burner
-pkgver=2.24.0
-pkgrel=2
+pkgver=2.25.3
+pkgrel=1
pkgdesc="Adds cd burner functionality to nautilus"
arch=(i686 x86_64)
-depends=('cdrkit' 'dvd+rw-tools' 'gnome-mount>=0.8' 'desktop-file-utils' 'libgnomeui>=2.24.0')
-makedepends=('intltool' 'pkgconfig' 'nautilus>=2.24.0' 'eel')
-optdepends=('nautilus' 'eel')
+depends=('cdrkit' 'dvd+rw-tools' 'desktop-file-utils' 'libgnomeui>=2.24.2')
+makedepends=('intltool' 'pkgconfig' 'nautilus>=2.28.0')
+optdepends=('nautilus')
options=('!libtool' '!emptydirs')
license=('GPL')
url=http://www.gnome.org/
install=nautilus-cd-burner.install
-source=(http://ftp.gnome.org/pub/GNOME/sources/nautilus-cd-burner/2.24/${pkgname}-${pkgver}.tar.bz2)
-md5sums=('eb211dd03d0518263fa4eadccc3caa88')
+source=(http://ftp.gnome.org/pub/GNOME/sources/nautilus-cd-burner/2.25/${pkgname}-${pkgver}.tar.bz2
+ use-gio-for-eject.patch)
+md5sums=('02324246d8e4804e15e41ef7b62836a7'
+ 'c915d5fda67b7604fc61fad7e9559b3d')
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
+ patch -Np1 -i "${srcdir}/use-gio-for-eject.patch" || return 1
./configure --prefix=/usr --sysconfdir=/etc \
--libexecdir=/usr/lib/nautilus-cd-burner \
--localstatedir=/var --enable-hal || return 1
Added: use-gio-for-eject.patch
===================================================================
--- use-gio-for-eject.patch (rev 0)
+++ use-gio-for-eject.patch 2009-10-31 20:12:26 UTC (rev 57520)
@@ -0,0 +1,198 @@
+From 555f4ef2a64a79d7bb63421859eb8a554cfe104d Mon Sep 17 00:00:00 2001
+From: Bastien Nocera <hadess at hadess.net>
+Date: Wed, 17 Dec 2008 11:49:06 +0000
+Subject: Eject using GIO instead of calling out to eject, or gnome-mount (Closes:
+
+2008-12-17 Bastien Nocera <hadess at hadess.net>
+
+ * src/nautilus-burn-drive.c
+ (nautilus_burn_drive_get_drive_for_node),
+ (nautilus_burn_drive_eject_cb), (nautilus_burn_drive_eject):
+ Eject using GIO instead of calling out to eject, or gnome-mount
+ (Closes: #504391)
+
+
+svn path=/trunk/; revision=2270
+---
+diff --git a/src/nautilus-burn-drive.c b/src/nautilus-burn-drive.c
+index b32078b..2322937 100644
+--- a/src/nautilus-burn-drive.c
++++ b/src/nautilus-burn-drive.c
+@@ -781,6 +781,48 @@ nautilus_burn_drive_is_mounted (NautilusBurnDrive *drive)
+ return drive->priv->media_is_mounted;
+ }
+
++static GDrive *
++nautilus_burn_drive_get_drive_for_node (NautilusBurnDrive *drive)
++{
++ GVolumeMonitor *monitor;
++ GList *drives, *l;
++ GDrive *ret;
++
++ ret = NULL;
++
++ monitor = g_volume_monitor_get ();
++ drives = g_volume_monitor_get_connected_drives (monitor);
++ g_object_unref (monitor);
++
++ for (l = drives; l != NULL && ret == NULL; l = l->next) {
++ GDrive *d = l->data;
++ char *id;
++
++ id = g_drive_get_identifier (d, G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE);
++ if (g_strcmp0 (id, drive->priv->device) == 0)
++ ret = g_object_ref (d);
++ }
++ g_list_foreach (drives, (GFunc) g_object_unref, NULL);
++ g_list_free (drives);
++
++ return ret;
++}
++
++typedef struct _CdCacheCallbackData {
++ gboolean called;
++ gboolean result;
++} EjectCallbackData;
++
++static void
++nautilus_burn_drive_eject_cb (GObject *source_object,
++ GAsyncResult *res,
++ EjectCallbackData *data)
++{
++ data->result = g_drive_eject_finish (G_DRIVE (source_object),
++ res, NULL);
++ data->called = TRUE;
++}
++
+ /**
+ * nautilus_burn_drive_eject:
+ * @drive: #NautilusBurnDrive
+@@ -794,8 +836,8 @@ nautilus_burn_drive_is_mounted (NautilusBurnDrive *drive)
+ gboolean
+ nautilus_burn_drive_eject (NautilusBurnDrive *drive)
+ {
+- char *cmd;
+- gboolean res;
++ GDrive *gdrive;
++ EjectCallbackData data;
+
+ g_return_val_if_fail (drive != NULL, FALSE);
+
+@@ -803,19 +845,25 @@ nautilus_burn_drive_eject (NautilusBurnDrive *drive)
+ return FALSE;
+ }
+
+-#ifdef USE_GNOME_MOUNT
+- cmd = g_strdup_printf ("gnome-mount --block --eject --no-ui --device=%s", drive->priv->device);
+-#else
+- cmd = g_strdup_printf ("eject %s", drive->priv->device);
+-#endif
++ gdrive = nautilus_burn_drive_get_drive_for_node (drive);
++ if (gdrive == NULL)
++ return FALSE;
++ if (g_drive_can_eject (gdrive) == FALSE) {
++ g_object_unref (gdrive);
++ return FALSE;
++ }
+
+- res = g_spawn_command_line_sync (cmd, NULL, NULL, NULL, NULL);
+- g_free (cmd);
++ memset (&data, 0, sizeof(data));
+
+- /* delay a bit to make sure eject finishes */
+- sleep (1);
++ g_drive_eject (gdrive, G_MOUNT_UNMOUNT_FORCE, NULL,
++ (GAsyncReadyCallback) nautilus_burn_drive_eject_cb,
++ &data);
++ while (!data.called)
++ g_main_context_iteration (NULL, TRUE);
+
+- return res;
++ g_object_unref (gdrive);
++
++ return data.result;
+ }
+
+ /**
+--
+cgit v0.8.2
+From 0a997551806573b6e495353bf9b5766a558c44f9 Mon Sep 17 00:00:00 2001
+From: Bastien Nocera <hadess at hadess.net>
+Date: Wed, 17 Dec 2008 11:52:37 +0000
+Subject: Simplify _can_eject by calling out to GIO instead of our Linux specific
+
+2008-12-17 Bastien Nocera <hadess at hadess.net>
+
+ * src/nautilus-burn-drive.c (nautilus_burn_drive_can_eject):
+ Simplify _can_eject by calling out to GIO instead of our
+ Linux specific ioctl
+
+
+svn path=/trunk/; revision=2271
+---
+diff --git a/src/nautilus-burn-drive.c b/src/nautilus-burn-drive.c
+index 2322937..541d6f2 100644
+--- a/src/nautilus-burn-drive.c
++++ b/src/nautilus-burn-drive.c
+@@ -1492,29 +1492,6 @@ nautilus_burn_drive_class_init (NautilusBurnDriveClass *klass)
+ G_PARAM_READWRITE));
+ }
+
+-static gboolean
+-can_drive_eject (int fd)
+-{
+- if (fd < 0) {
+- return FALSE;
+- }
+-
+-#ifdef __linux__
+- {
+- int status;
+-
+- status = ioctl (fd, CDROM_GET_CAPABILITY, 0);
+- if (status < 0) {
+- return FALSE;
+- }
+-
+- return status & CDC_OPEN_TRAY;
+- }
+-#else
+- return FALSE;
+-#endif
+-}
+-
+ /**
+ * nautilus_burn_drive_can_eject:
+ * @drive: #NautilusBurnDrive
+@@ -1526,22 +1503,16 @@ can_drive_eject (int fd)
+ gboolean
+ nautilus_burn_drive_can_eject (NautilusBurnDrive *drive)
+ {
+- gpointer ioctl_handle;
+- int fd;
+- gboolean ret;
++ GDrive *gdrive;
++ gboolean ret;
+
+ g_return_val_if_fail (drive != NULL, FALSE);
+
+- ioctl_handle = open_ioctl_handle (drive->priv->device);
+- if (ioctl_handle == INVALID_HANDLE) {
+- return FALSE;
+- }
+-
+- fd = get_ioctl_handle_fd (ioctl_handle);
+-
+- ret = can_drive_eject (fd);
+-
+- close_ioctl_handle (ioctl_handle);
++ gdrive = nautilus_burn_drive_get_drive_for_node (drive);
++ if (gdrive == NULL)
++ return FALSE;
++ ret = g_drive_can_eject (gdrive);
++ g_object_unref (gdrive);
+
+ return ret;
+ }
+--
+cgit v0.8.2
More information about the arch-commits
mailing list