rpms/gvfs/devel 0014-gvfs-use-device-media-detected.patch, NONE, 1.1 0015-gvfs-respect-presentation-hide-for-drives.patch, NONE, 1.1 gvfs.spec, 1.126, 1.127

David Zeuthen davidz at fedoraproject.org
Sat May 2 13:27:17 UTC 2009


Author: davidz

Update of /cvs/pkgs/rpms/gvfs/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv30841

Modified Files:
	gvfs.spec 
Added Files:
	0014-gvfs-use-device-media-detected.patch 
	0015-gvfs-respect-presentation-hide-for-drives.patch 
Log Message:
* Sat May 02 2009 David Zeuthen <davidz at redhat.com> - 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



0014-gvfs-use-device-media-detected.patch:

--- NEW FILE 0014-gvfs-use-device-media-detected.patch ---
>From 3f3f21fe6e2bdac8fd6acf048da6fb228adde092 Mon Sep 17 00:00:00 2001
From: David Zeuthen <davidz at redhat.com>
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

0015-gvfs-respect-presentation-hide-for-drives.patch:

--- NEW FILE 0015-gvfs-respect-presentation-hide-for-drives.patch ---
>From 59dd3b33a71a930651f23142e2a7d7e57727144f Mon Sep 17 00:00:00 2001
From: David Zeuthen <davidz at redhat.com>
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


Index: gvfs.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gvfs/devel/gvfs.spec,v
retrieving revision 1.126
retrieving revision 1.127
diff -u -p -r1.126 -r1.127
--- gvfs.spec	15 Apr 2009 19:24:55 -0000	1.126
+++ gvfs.spec	2 May 2009 13:26:47 -0000	1.127
@@ -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-unmoun
 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) 
 %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 <davidz at redhat.com> - 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 <davidz at redhat.com> - 1.2.2-3
 - Sync with the gdu-volume-monitor branch
 




More information about the scm-commits mailing list