From ff9ef4ca73ccc9e72e126355d3c75310f7c4f86a Mon Sep 17 00:00:00 2001 From: ajacoutot Date: Tue, 7 Jun 2011 12:53:56 +0000 Subject: [PATCH] Better patch from upstream for webdav unmount. --- x11/gnome/gvfs/Makefile | 4 +- .../patches/patch-daemon_gvfsbackenddav_c | 77 +++++-------------- 2 files changed, 21 insertions(+), 60 deletions(-) diff --git a/x11/gnome/gvfs/Makefile b/x11/gnome/gvfs/Makefile index 6654b9d3a16..57b8b6626b6 100644 --- a/x11/gnome/gvfs/Makefile +++ b/x11/gnome/gvfs/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.47 2011/06/02 18:34:16 ajacoutot Exp $ +# $OpenBSD: Makefile,v 1.48 2011/06/07 12:53:56 ajacoutot Exp $ COMMENT-main= GNOME virtual file system COMMENT-smb= samba module for GVFS @@ -9,7 +9,7 @@ GNOME_VERSION= 1.8.2 PKGNAME-main= ${DISTNAME} PKGNAME-smb= ${GNOME_PROJECT}-smb-${GNOME_VERSION} -REVISION-main= 1 +REVISION-main= 2 SHARED_LIBS += gvfscommon 3.0 # .0.0 SHARED_LIBS += gvfscommon-dnssd 1.0 # .0.0 diff --git a/x11/gnome/gvfs/patches/patch-daemon_gvfsbackenddav_c b/x11/gnome/gvfs/patches/patch-daemon_gvfsbackenddav_c index 2da7f92007b..4ad8ab7b0f8 100644 --- a/x11/gnome/gvfs/patches/patch-daemon_gvfsbackenddav_c +++ b/x11/gnome/gvfs/patches/patch-daemon_gvfsbackenddav_c @@ -1,70 +1,31 @@ -$OpenBSD: patch-daemon_gvfsbackenddav_c,v 1.4 2011/05/23 22:41:04 ajacoutot Exp $ +$OpenBSD: patch-daemon_gvfsbackenddav_c,v 1.5 2011/06/07 12:53:56 ajacoutot Exp $ -https://bugzilla.gnome.org/show_bug.cgi?id=567664 -(Properly implement unmount) +From 6abbff2a11c28660a090e8b9398fb19332380094 Mon Sep 17 00:00:00 2001 +From: Christian Kellner +Date: Sun, 05 Jun 2011 11:23:05 +0000 +Subject: dav: Use default unmount logic --- daemon/gvfsbackenddav.c.orig Mon May 23 16:38:56 2011 -+++ daemon/gvfsbackenddav.c Tue May 24 00:33:42 2011 -@@ -56,6 +56,7 @@ - #include "gvfsjobqueryfsinfo.h" - #include "gvfsjobqueryattributes.h" - #include "gvfsjobenumerate.h" -+#include "gvfsjobunmount.h" - #include "gvfsdaemonprotocol.h" - - #include "soup-input-stream.h" -@@ -2379,13 +2380,49 @@ do_set_display_name (GVfsBackend *backend, ++++ daemon/gvfsbackenddav.c Tue Jun 7 14:47:36 2011 +@@ -2379,15 +2379,6 @@ do_set_display_name (GVfsBackend *backend, soup_uri_free (source); } -+static void -+unmount_cb (GVfsBackend *backend, -+ GAsyncResult *res, -+ gpointer user_data) -+{ -+ GVfsJobUnmount *job = G_VFS_JOB_UNMOUNT (user_data); -+ gboolean should_unmount; -+ -+ should_unmount = g_vfs_backend_unmount_with_operation_finish (backend, -+ res); -+ -+ if (should_unmount) -+ g_vfs_job_succeeded (G_VFS_JOB (job)); -+ else -+ g_vfs_job_failed_literal (G_VFS_JOB (job), -+ G_IO_ERROR, G_IO_ERROR_BUSY, -+ _("Filesystem is busy")); -+} -+ - static gboolean +-static gboolean -try_unmount (GVfsBackend *backend, - GVfsJobUnmount *job, - GMountUnmountFlags flags, - GMountSource *mount_source) -+try_unmount (GVfsBackend *backend, -+ GVfsJobUnmount *job, -+ GMountUnmountFlags flags, -+ GMountSource *mount_source) - { +-{ - _exit (0); -+ -+ if (! g_vfs_backend_has_blocking_processes (backend) || -+ flags & G_MOUNT_UNMOUNT_FORCE) -+ { -+ g_vfs_job_succeeded (G_VFS_JOB (job)); -+ } -+ else if (g_mount_source_is_dummy (mount_source)) -+ { -+ g_vfs_job_failed_literal (G_VFS_JOB (job), -+ G_IO_ERROR, G_IO_ERROR_BUSY, -+ _("Filesystem is busy")); -+ } -+ else -+ g_vfs_backend_unmount_with_operation (backend, -+ mount_source, -+ (GAsyncReadyCallback) unmount_cb, -+ job); -+ return TRUE; - } - +-} +- /* ************************************************************************* */ + /* */ + static void +@@ -2414,5 +2405,4 @@ g_vfs_backend_dav_class_init (GVfsBackendDavClass *kla + backend_class->make_directory = do_make_directory; + backend_class->delete = do_delete; + backend_class->set_display_name = do_set_display_name; +- backend_class->try_unmount = try_unmount; + }