Reenable gphoto automounting

This commit is contained in:
Matthias Clasen 2008-04-17 03:34:27 +00:00
parent ee7c0e7bc5
commit f53a007268
3 changed files with 86 additions and 1 deletions

View File

@ -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

63
gvfs-unmount-scheme.patch Normal file
View File

@ -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;

View File

@ -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 <mclasen@redhat.com> - 0.2.3-6
- Reenable gphoto automounting
- Support unmounting all mounts for a scheme
* Wed Apr 16 2008 Matthias Clasen <mclasen@redhat.com> - 0.2.3-5
- Fix hangs when unmounting gphoto mounts