From 3d17b00fc48c79d1d27c261f424548fbbd863f41 Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Sat, 2 May 2009 13:26:47 +0000 Subject: [PATCH] - Don't show drives that are supposed to be hidden (#498649) - Only automount if media or drive was just inserted - this fixes a problem with spurious automounts when partitioning/formatting --- 0014-gvfs-use-device-media-detected.patch | 59 +++++++++++++++++++ ...respect-presentation-hide-for-drives.patch | 29 +++++++++ gvfs.spec | 16 ++++- 3 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 0014-gvfs-use-device-media-detected.patch create mode 100644 0015-gvfs-respect-presentation-hide-for-drives.patch diff --git a/0014-gvfs-use-device-media-detected.patch b/0014-gvfs-use-device-media-detected.patch new file mode 100644 index 0000000..15df34e --- /dev/null +++ b/0014-gvfs-use-device-media-detected.patch @@ -0,0 +1,59 @@ +From 3f3f21fe6e2bdac8fd6acf048da6fb228adde092 Mon Sep 17 00:00:00 2001 +From: David Zeuthen +Date: Fri, 01 May 2009 19:59:54 +0000 +Subject: Use new gnome-disk-utility API to figure out when media was inserted + +This fixes a problem with Nautilus automounting newly created volumes +appearing as a result of formatting/partitioning. +--- +diff --git a/monitor/gdu/ggdudrive.c b/monitor/gdu/ggdudrive.c +index 29e108d..c2c8b76 100644 +--- a/monitor/gdu/ggdudrive.c ++++ b/monitor/gdu/ggdudrive.c +@@ -51,7 +51,6 @@ struct _GGduDrive { + gboolean can_eject; + gboolean can_poll_for_media; + gboolean is_media_check_automatic; +- time_t time_of_last_media_insertion; + }; + + static void g_gdu_drive_drive_iface_init (GDriveIface *iface); +@@ -178,9 +177,6 @@ update_drive (GGduDrive *drive) + if (device != NULL) + g_object_unref (device); + +- if (drive->has_media != old_has_media) +- drive->time_of_last_media_insertion = time (NULL); +- + /* compute whether something changed */ + changed = !((old_is_media_removable == drive->is_media_removable) && + (old_has_media == drive->has_media) && +@@ -233,8 +229,6 @@ g_gdu_drive_new (GVolumeMonitor *volume_monitor, + + drive->presentable = g_object_ref (presentable); + +- drive->time_of_last_media_insertion = time (NULL); +- + g_signal_connect (drive->presentable, "changed", G_CALLBACK (presentable_changed), drive); + g_signal_connect (drive->presentable, "job-changed", G_CALLBACK (presentable_job_changed), drive); + +@@ -685,7 +679,16 @@ g_gdu_drive_has_presentable (GGduDrive *drive, + time_t + g_gdu_drive_get_time_of_last_media_insertion (GGduDrive *drive) + { +- return drive->time_of_last_media_insertion; ++ GduDevice *device; ++ time_t ret; ++ ++ ret = 0; ++ device = gdu_presentable_get_device (drive->presentable); ++ if (device != NULL) { ++ ret = gdu_device_get_media_detection_time (device); ++ g_object_unref (device); ++ } ++ return ret; + } + + GduPresentable * +-- +cgit v0.8.2 diff --git a/0015-gvfs-respect-presentation-hide-for-drives.patch b/0015-gvfs-respect-presentation-hide-for-drives.patch new file mode 100644 index 0000000..17a2ea4 --- /dev/null +++ b/0015-gvfs-respect-presentation-hide-for-drives.patch @@ -0,0 +1,29 @@ +From 59dd3b33a71a930651f23142e2a7d7e57727144f Mon Sep 17 00:00:00 2001 +From: David Zeuthen +Date: Fri, 01 May 2009 21:23:01 +0000 +Subject: Fix bug where drives are not ignored as they ought to be + +This should fix part of + + https://bugzilla.redhat.com/show_bug.cgi?id=498649#c14 + +(the other part is fixed in the Fedora livecd scripts) +--- +diff --git a/monitor/gdu/ggduvolumemonitor.c b/monitor/gdu/ggduvolumemonitor.c +index 2c1f727..df42249 100644 +--- a/monitor/gdu/ggduvolumemonitor.c ++++ b/monitor/gdu/ggduvolumemonitor.c +@@ -833,8 +833,10 @@ should_drive_be_ignored (GduPool *pool, GduDrive *d, GList *fstab_mount_points) + goto out; + } + +- if (gdu_device_get_presentation_hide (device)) ++ if (gdu_device_get_presentation_hide (device)) { ++ ignored = TRUE; + goto out; ++ } + + has_volumes = FALSE; + all_volumes_are_ignored = TRUE; +-- +cgit v0.8.2 diff --git a/gvfs.spec b/gvfs.spec index 2e4e72b..1dd3b4c 100644 --- a/gvfs.spec +++ b/gvfs.spec @@ -1,7 +1,7 @@ Summary: Backends for the gio framework in GLib Name: gvfs Version: 1.2.2 -Release: 3%{?dist} +Release: 4%{?dist} License: LGPLv2+ Group: System Environment/Libraries URL: http://www.gtk.org @@ -39,6 +39,8 @@ Patch4: gvfs-1.2.2-ssh-auth-sock.patch # Gdu volume monitor patches, from http://cgit.freedesktop.org/~david/gvfs/log/?h=gdu-volume-monitor # +# These are all in gvfs' master branch on git.gnome.org. +# # http://bugzilla.gnome.org/show_bug.cgi?id=573826 Patch101: gdu-0001-Bug-573826-gdu-volume-monitor.patch # http://bugzilla.gnome.org/show_bug.cgi?id=573826 @@ -65,6 +67,11 @@ Patch111: gdu-0011-Bug-576083-pre-unmount-signals-not-being-trigger.patch Patch112: gdu-0012-use-new-gnome-disk-utility-API-to-hide-unwanted-devi.patch Patch113: gdu-0013-pass-the-flush-mount-option-for-vfat.patch +# Only automount when media has just been inserted +Patch114: 0014-gvfs-use-device-media-detected.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=498649 +Patch115: 0015-gvfs-respect-presentation-hide-for-drives.patch + %description The gvfs package provides backend implementations for the gio framework in GLib. It includes ftp, sftp, cifs. @@ -163,6 +170,8 @@ media players (Media Transfer Protocol) to applications using gvfs. %patch111 -p1 -b .gdu-pre-unmount-signals %patch112 -p1 -b .gdu-unwanted-devices %patch113 -p1 -b .gdu-vfat-flush +%patch114 -p1 -b .gdu-automount-only-on-insertion +%patch115 -p1 -b .gdu-hide-drives %build @@ -306,6 +315,11 @@ update-desktop-database &> /dev/null ||: %changelog +* Sat May 02 2009 David Zeuthen - 1.2.2-4 +- Don't show drives that are supposed to be hidden (#498649) +- Only automount if media or drive was just inserted - this fixes + a problem with spurious automounts when partitioning/formatting + * Wed Apr 15 2009 David Zeuthen - 1.2.2-3 - Sync with the gdu-volume-monitor branch