From f53a007268b7f67874c77e6514d68e0199108e49 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 17 Apr 2008 03:34:27 +0000 Subject: [PATCH] Reenable gphoto automounting --- gvfs-gphoto-automount.patch | 14 +++++++++ gvfs-unmount-scheme.patch | 63 +++++++++++++++++++++++++++++++++++++ gvfs.spec | 10 +++++- 3 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 gvfs-gphoto-automount.patch create mode 100644 gvfs-unmount-scheme.patch diff --git a/gvfs-gphoto-automount.patch b/gvfs-gphoto-automount.patch new file mode 100644 index 0000000..3aeca9e --- /dev/null +++ b/gvfs-gphoto-automount.patch @@ -0,0 +1,14 @@ +diff -up gvfs-0.2.3/hal/ghalvolume.c.gphoto-automount gvfs-0.2.3/hal/ghalvolume.c +--- gvfs-0.2.3/hal/ghalvolume.c.gphoto-automount 2008-04-16 23:32:31.000000000 -0400 ++++ gvfs-0.2.3/hal/ghalvolume.c 2008-04-16 23:32:39.000000000 -0400 +@@ -519,10 +519,6 @@ g_hal_volume_new (GVolumeMonitor *volu + + if (foreign_mount_root == NULL) + return NULL; +- +- /* We don't want to automount cameras as the gphoto backend +- blocks access from other apps */ +- ignore_automount = TRUE; + } + #endif + else diff --git a/gvfs-unmount-scheme.patch b/gvfs-unmount-scheme.patch new file mode 100644 index 0000000..22e0cd4 --- /dev/null +++ b/gvfs-unmount-scheme.patch @@ -0,0 +1,63 @@ +--- trunk/programs/gvfs-mount.c 2008/04/02 19:51:01 1720 ++++ trunk/programs/gvfs-mount.c 2008/04/07 19:50:52 1726 +@@ -43,11 +43,13 @@ + static gboolean mount_unmount = FALSE; + static gboolean mount_list = FALSE; + static gboolean mount_list_info = FALSE; ++static const char *unmount_scheme = NULL; + +-static GOptionEntry entries[] = ++static const GOptionEntry entries[] = + { + { "mountable", 'm', 0, G_OPTION_ARG_NONE, &mount_mountable, "Mount as mountable", NULL }, + { "unmount", 'u', 0, G_OPTION_ARG_NONE, &mount_unmount, "Unmount", NULL}, ++ { "unmount-scheme", 's', 0, G_OPTION_ARG_STRING, &unmount_scheme, "Unmount all mounts with the given scheme", NULL}, + { "list", 'l', 0, G_OPTION_ARG_NONE, &mount_list, "List", NULL}, + { "list-info", 'i', 0, G_OPTION_ARG_NONE, &mount_list_info, "List extra information", NULL}, + { NULL } +@@ -502,6 +504,34 @@ + g_list_free (mounts); + } + ++static void ++unmount_all_with_scheme (const char *scheme) ++{ ++ GVolumeMonitor *volume_monitor; ++ GList *mounts; ++ GList *l; ++ ++ volume_monitor = g_volume_monitor_get(); ++ ++ /* populate gvfs network mounts */ ++ iterate_gmain(); ++ ++ mounts = g_volume_monitor_get_mounts (volume_monitor); ++ for (l = mounts; l != NULL; l = l->next) { ++ GMount *mount = G_MOUNT (l->data); ++ GFile *root; ++ ++ root = g_mount_get_root (mount); ++ if (g_file_has_uri_scheme (root, scheme)) { ++ unmount (root); ++ } ++ g_object_unref (root); ++ } ++ g_list_foreach (mounts, (GFunc)g_object_unref, NULL); ++ g_list_free (mounts); ++ ++} ++ + int + main (int argc, char *argv[]) + { +@@ -523,6 +553,10 @@ + + if (mount_list) + list_monitor_items (); ++ else if (unmount_scheme != NULL) ++ { ++ unmount_all_with_scheme (unmount_scheme); ++ } + else if (argc > 1) + { + int i; diff --git a/gvfs.spec b/gvfs.spec index 652fb68..93d2010 100644 --- a/gvfs.spec +++ b/gvfs.spec @@ -1,7 +1,7 @@ Summary: Backends for the gio framework in GLib Name: gvfs Version: 0.2.3 -Release: 5%{?dist} +Release: 6%{?dist} License: LGPLv2+ Group: System Environment/Libraries URL: http://www.gtk.org @@ -38,6 +38,8 @@ Patch2: gvfs-64clean.patch Patch3: regexxer-crash.patch Patch4: gvfs-0.2.2-only-show-allowed-mounts.patch Patch5: gphoto-unmount-hang.patch +Patch6: gvfs-gphoto-automount.patch +Patch7: gvfs-unmount-scheme.patch %description The gvfs package provides backend implementations for the gio @@ -71,6 +73,8 @@ to access the gvfs filesystems. %patch3 -p1 -b .regexxer-crash %patch4 -p0 -b .only-show-allowed-mounts %patch5 -p1 -b .gphoto-unmount-hang +%patch6 -p1 -b .gphoto-automount +%patch7 -p1 -b .unmount-scheme %build @@ -184,6 +188,10 @@ update-desktop-database &> /dev/null ||: %changelog +* Wed Apr 16 2008 Matthias Clasen - 0.2.3-6 +- Reenable gphoto automounting +- Support unmounting all mounts for a scheme + * Wed Apr 16 2008 Matthias Clasen - 0.2.3-5 - Fix hangs when unmounting gphoto mounts