rpms/gvfs/devel gdu-0001-Bug-573826-gdu-volume-monitor.patch, NONE, 1.1 gdu-0002-Fix-how-we-determine-if-a-volume-is-ignored.patch, NONE, 1.1 gdu-0003-Avoid-automounting-volumes-on-virtual-and-unknown-bu.patch, NONE, 1.1 gdu-0004-Remove-debug-spew.patch, NONE, 1.1 gdu-0005-Don-t-add-a-volume-if-the-device-is-mounted-and-igno.patch, NONE, 1.1 gdu-0006-Ignore-drives-if-all-volumes-of-the-drive-are-ignore.patch, NONE, 1.1 gdu-0007-Bug-576587-allow-eject-even-on-non-ejectable-vol.patch, NONE, 1.1 gvfs.spec, 1.120, 1.121 gvfs-1.1.7-gdu-monitor-empty-drives.patch, 1.1, NONE gvfs-1.2.0-fix-daemon-mount-op-bgo575728.patch, 1.1, NONE gvfs-1.2.1-only-mount-the-metal.patch, 1.1, NONE gvfs-gdu-volume-monitor-3.patch, 1.1, NONE

David Zeuthen davidz at fedoraproject.org
Fri Apr 10 01:24:24 UTC 2009


Author: davidz

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

Modified Files:
	gvfs.spec 
Added Files:
	gdu-0001-Bug-573826-gdu-volume-monitor.patch 
	gdu-0002-Fix-how-we-determine-if-a-volume-is-ignored.patch 
	gdu-0003-Avoid-automounting-volumes-on-virtual-and-unknown-bu.patch 
	gdu-0004-Remove-debug-spew.patch 
	gdu-0005-Don-t-add-a-volume-if-the-device-is-mounted-and-igno.patch 
	gdu-0006-Ignore-drives-if-all-volumes-of-the-drive-are-ignore.patch 
	gdu-0007-Bug-576587-allow-eject-even-on-non-ejectable-vol.patch 
Removed Files:
	gvfs-1.1.7-gdu-monitor-empty-drives.patch 
	gvfs-1.2.0-fix-daemon-mount-op-bgo575728.patch 
	gvfs-1.2.1-only-mount-the-metal.patch 
	gvfs-gdu-volume-monitor-3.patch 
Log Message:
* Thu Apr  9 2009 David Zeuthen <davidz at redhat.com> - 1.2.1-3
- Clean up gdu patches and bump BR for gdu to 0.3
- Avoiding showing volume for ignored mounts (#495033)



gdu-0001-Bug-573826-gdu-volume-monitor.patch:

--- NEW FILE gdu-0001-Bug-573826-gdu-volume-monitor.patch ---
>From 9d51c0de20170731db25422e858fee0e44b1dbd1 Mon Sep 17 00:00:00 2001
From: David Zeuthen <davidz at redhat.com>
Date: Thu, 9 Apr 2009 19:01:18 -0400
Subject: [PATCH 1/7] =?utf-8?q?Bug=20573826=20=E2=80=93=20gdu=20volume=20monitor?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Add the GNOME Disk Utility based volume monitor, see

 http://bugzilla.gnome.org/show_bug.cgi?id=573826
 http://mail.gnome.org/archives/gvfs-list/2009-March/msg00002.html

for details.
---
 configure.ac                                       |   28 +-
 monitor/Makefile.am                                |    4 +
 monitor/gdu/Makefile.am                            |   53 +
 monitor/gdu/gdu-volume-monitor-daemon.c            |   46 +
 monitor/gdu/gdu.monitor                            |    5 +
 monitor/gdu/ggdudrive.c                            |  691 ++++++++++
 monitor/gdu/ggdudrive.h                            |   69 +
 monitor/gdu/ggdumount.c                            |  958 +++++++++++++
 monitor/gdu/ggdumount.h                            |   64 +
 monitor/gdu/ggduvolume.c                           | 1408 +++++++++++++++++++
 monitor/gdu/ggduvolume.h                           |   78 ++
 monitor/gdu/ggduvolumemonitor.c                    | 1432 ++++++++++++++++++++
 monitor/gdu/ggduvolumemonitor.h                    |   60 +
 .../org.gtk.Private.GduVolumeMonitor.service.in    |    3 +
 monitor/gdu/polkit.c                               |  137 ++
 monitor/gdu/polkit.h                               |   44 +
 16 files changed, 5079 insertions(+), 1 deletions(-)
 create mode 100644 monitor/gdu/Makefile.am
 create mode 100644 monitor/gdu/gdu-volume-monitor-daemon.c
 create mode 100644 monitor/gdu/gdu.monitor
 create mode 100644 monitor/gdu/ggdudrive.c
 create mode 100644 monitor/gdu/ggdudrive.h
 create mode 100644 monitor/gdu/ggdumount.c
 create mode 100644 monitor/gdu/ggdumount.h
 create mode 100644 monitor/gdu/ggduvolume.c
 create mode 100644 monitor/gdu/ggduvolume.h
 create mode 100644 monitor/gdu/ggduvolumemonitor.c
 create mode 100644 monitor/gdu/ggduvolumemonitor.h
 create mode 100644 monitor/gdu/org.gtk.Private.GduVolumeMonitor.service.in
 create mode 100644 monitor/gdu/polkit.c
 create mode 100644 monitor/gdu/polkit.h

diff --git a/configure.ac b/configure.ac
index 311127e..895309b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -198,6 +198,30 @@ AC_SUBST(GCONF_CFLAGS)
 
 AM_CONDITIONAL(USE_GCONF, [test "$msg_gconf" = "yes"])
 
+dnl ************************************
+dnl *** Check for gnome-disk-utility ***
+dnl ************************************
+
+AC_ARG_ENABLE(gdu, [  --disable-gdu           build without GDU volume monitor])
+msg_gdu=no
+GDU_LIBS=
+GDU_CFLAGS=
+GDU_REQUIRED=0.3
+
+if test "x$enable_gdu" != "xno"; then
+  PKG_CHECK_EXISTS([gdu >= $GDU_REQUIRED], msg_gdu=yes)
+
+  if test "x$msg_gdu" == "xyes"; then
+    PKG_CHECK_MODULES([GDU],[gdu >= $GDU_REQUIRED])
+    AC_DEFINE(HAVE_GDU, 1, [Define to 1 if gnome-disk-utility is available])
+  fi
+fi
+
+AC_SUBST(GDU_LIBS)
+AC_SUBST(GDU_CFLAGS)
+
+AM_CONDITIONAL(USE_GDU, [test "$msg_gdu" = "yes"])
+
 dnl **********************
 dnl *** Check for HAL ***
 dnl **********************
@@ -558,6 +582,7 @@ daemon/Makefile
 monitor/Makefile
 monitor/proxy/Makefile
 monitor/hal/Makefile
+monitor/gdu/Makefile
 monitor/gphoto2/Makefile
 gconf/Makefile
 programs/Makefile
@@ -579,7 +604,8 @@ echo "
 	archive support:	      $msg_archive
         GConf support:                $msg_gconf
         DNS-SD support:               $msg_avahi
-	Use HAL for volume monitor:   $msg_hal (with fast init path: $have_hal_fast_init)
+	Build HAL volume monitor:     $msg_hal (with fast init path: $have_hal_fast_init)
+	Build GDU volume monitor:     $msg_gdu
 	GNOME Keyring support:        $msg_keyring
 	Bash-completion support:      $msg_bash_completion
 "
diff --git a/monitor/Makefile.am b/monitor/Makefile.am
index d4197d5..f68423e 100644
--- a/monitor/Makefile.am
+++ b/monitor/Makefile.am
@@ -5,6 +5,10 @@ if USE_HAL
 SUBDIRS += hal
 endif
 
+if USE_GDU
+SUBDIRS += gdu
+endif
+
 if USE_GPHOTO2
 SUBDIRS += gphoto2
 endif
diff --git a/monitor/gdu/Makefile.am b/monitor/gdu/Makefile.am
new file mode 100644
index 0000000..10b80f3
--- /dev/null
+++ b/monitor/gdu/Makefile.am
@@ -0,0 +1,53 @@
+
+NULL =
+
+libexec_PROGRAMS = gvfs-gdu-volume-monitor
+
+
+gvfs_gdu_volume_monitor_SOURCES =			\
+	gdu-volume-monitor-daemon.c			\
+	ggdudrive.c		ggdudrive.h		\
+	ggduvolume.c		ggduvolume.h		\
+	ggdumount.c		ggdumount.h		\
+	ggduvolumemonitor.c	ggduvolumemonitor.h	\
+	polkit.c		polkit.h		\
+	$(NULL)
+
+gvfs_gdu_volume_monitor_CFLAGS =		\
+	-DG_LOG_DOMAIN=\"GVFS-Gdu\"		\
+	-I$(top_srcdir)/common                  \
+	-I$(top_srcdir)/monitor/proxy           \
+	$(GLIB_CFLAGS)                          \
+	$(GDU_CFLAGS)                           \
+	$(DBUS_CFLAGS)                          \
+	-DGIO_MODULE_DIR=\"$(GIO_MODULE_DIR)\"	\
+	-DGVFS_LOCALEDIR=\""$(localedir)"\"	\
+	-DG_DISABLE_DEPRECATED			\
+	-DGDU_API_IS_SUBJECT_TO_CHANGE		\
+	$(NULL)
+
+gvfs_gdu_volume_monitor_LDFLAGS =	\
+	$(NULL)
+
+gvfs_gdu_volume_monitor_LDADD  =		     			      \
+	$(GLIB_LIBS)                                 			      \
+	$(GDU_LIBS)                                  			      \
+	$(DBUS_LIBS)                                 				\
+	$(top_builddir)/common/libgvfscommon.la 			      \
+	$(top_builddir)/monitor/proxy/libgvfsproxyvolumemonitordaemon-noin.la \
+	$(NULL)
+
+remote_volume_monitorsdir = $(datadir)/gvfs/remote-volume-monitors
+remote_volume_monitors_DATA = gdu.monitor
+
+servicedir       = $(datadir)/dbus-1/services
+service_in_files = org.gtk.Private.GduVolumeMonitor.service.in
+service_DATA     = $(service_in_files:.service.in=.service)
+
+$(service_DATA): $(service_in_files) Makefile
+	@sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
+
+clean-local:
+	rm -f *~ *.loT $(BUILT_SOURCES) $(service_DATA)
+
+EXTRA_DIST = $(service_in_files) gdu.monitor
diff --git a/monitor/gdu/gdu-volume-monitor-daemon.c b/monitor/gdu/gdu-volume-monitor-daemon.c
new file mode 100644
index 0000000..cdb4f84
--- /dev/null
+++ b/monitor/gdu/gdu-volume-monitor-daemon.c
@@ -0,0 +1,46 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/* gvfs - extensions for gio
+ *
+ * Copyright (C) 2006-2009 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
[...4851 lines suppressed...]
@@ -0,0 +1,3 @@
+[D-BUS Service]
+Name=org.gtk.Private.GduVolumeMonitor
+Exec=@libexecdir@/gvfs-gdu-volume-monitor
diff --git a/monitor/gdu/polkit.c b/monitor/gdu/polkit.c
new file mode 100644
index 0000000..5c37ba6
--- /dev/null
+++ b/monitor/gdu/polkit.c
@@ -0,0 +1,137 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/* gvfs - extensions for gio
+ *
+ * Copyright (C) 2006-2009 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: David Zeuthen <davidz at redhat.com>
+ */
+
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <gdbusutils.h>
+
+#include "polkit.h"
+
+static void
+_obtain_authz_cb (DBusMessage *reply,
+                  GError      *error,
+                  gpointer     user_data)
+{
+  GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (user_data);
+  gboolean gained_authz;
+  DBusError derror;
+
+  if (error != NULL) {
+    g_simple_async_result_set_from_error (simple, error);
+    goto out;
+  }
+
+  dbus_error_init (&derror);
+  if (!dbus_message_get_args (reply,
+                              &derror,
+                              DBUS_TYPE_BOOLEAN, &gained_authz,
+                              DBUS_TYPE_INVALID))
+    {
+      /* no need to translate; this only happens if the auth agent is buggy */
+      g_simple_async_result_set_error (simple,
+                                       G_IO_ERROR,
+                                       G_IO_ERROR_FAILED,
+                                       "Error parsing reply for ObtainAuthorization(): %s: %s",
+                                       derror.name, derror.message);
+      dbus_error_free (&derror);
+      goto out;
+    }
+
+  if (!gained_authz && error == NULL)
+    {
+      /* no need to translate, is never shown */
+      g_simple_async_result_set_error (simple,
+                                       G_IO_ERROR,
+                                       G_IO_ERROR_FAILED_HANDLED,
+                                       "Didn't obtain authorization (bug in libgio user, it shouldn't display this error)");
+    }
+
+ out:
+  g_simple_async_result_complete (simple);
+  g_object_unref (simple);
+}
+
+
+gboolean
+_obtain_authz_finish (GAsyncResult *res,
+                      GError       **error)
+{
+  GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
+
+  g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == _obtain_authz);
+
+  if (g_simple_async_result_propagate_error (simple, error))
+    return FALSE;
+  else
+    return TRUE;
+}
+
+void
+_obtain_authz (const gchar *action_id,
+               GCancellable *cancellable,
+               GAsyncReadyCallback callback,
+               gpointer user_data)
+{
+  DBusConnection *connection;
+  DBusMessage *message;
+  GSimpleAsyncResult *simple;
+  guint xid;
+  guint pid;
+  DBusError derror;
+
+  dbus_error_init (&derror);
+
+  /* this connection is already integrated and guaranteed to exist, see gvfsproxyvolumemonitordaemon.c */
+  connection = dbus_bus_get (DBUS_BUS_SESSION, &derror);
+
+  simple = g_simple_async_result_new (NULL,
+                                      callback,
+                                      user_data,
+                                      _obtain_authz);
+
+  message = dbus_message_new_method_call ("org.freedesktop.PolicyKit.AuthenticationAgent", /* bus name */
+                                          "/",                                             /* object */
+                                          "org.freedesktop.PolicyKit.AuthenticationAgent", /* interface */
+                                          "ObtainAuthorization");
+
+  xid = 0;
+  pid = getpid ();
+
+  dbus_message_append_args (message,
+                            DBUS_TYPE_STRING,
+                            &(action_id),
+                            DBUS_TYPE_UINT32,
+                            &(xid),
+                            DBUS_TYPE_UINT32,
+                            &(pid),
+                            DBUS_TYPE_INVALID);
+
+  _g_dbus_connection_call_async (connection,
+                                 message,
+                                 -1,
+                                 (GAsyncDBusCallback) _obtain_authz_cb,
+                                 simple);
+  dbus_message_unref (message);
+  dbus_connection_unref (connection);
+}
diff --git a/monitor/gdu/polkit.h b/monitor/gdu/polkit.h
new file mode 100644
index 0000000..4b26189
--- /dev/null
+++ b/monitor/gdu/polkit.h
@@ -0,0 +1,44 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/* gvfs - extensions for gio
+ *
+ * Copyright (C) 2006-2009 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: David Zeuthen <davidz at redhat.com>
+ */
+
+
+#ifndef __POLKIT_H__
+#define __POLKIT_H__
+
+#include <glib-object.h>
+#include <gio/gio.h>
+#include <polkit/polkit.h>
+
+G_BEGIN_DECLS
+
+void _obtain_authz (const gchar        *action_id,
+                    GCancellable       *cancellable,
+                    GAsyncReadyCallback callback,
+                    gpointer            user_data);
+
+gboolean _obtain_authz_finish (GAsyncResult  *res,
+                               GError       **error);
+
+G_END_DECLS
+
+#endif /* __POLKIT_H__ */
-- 
1.6.2.2


gdu-0002-Fix-how-we-determine-if-a-volume-is-ignored.patch:

--- NEW FILE gdu-0002-Fix-how-we-determine-if-a-volume-is-ignored.patch ---
>From 94707c12442ed9ce099f110ec7089309133727ae Mon Sep 17 00:00:00 2001
From: Tomas Bzatek <tbzatek at redhat.com>
Date: Thu, 9 Apr 2009 19:03:16 -0400
Subject: [PATCH 2/7] Fix how we determine if a volume is ignored

This fixes a typo - wrong assignment of device file when testing whether the
volume should be ignored or not. It led to empty GVolume list associated to a
GDrive and thus inability to mount anything via computer://

Signed-off-by: David Zeuthen <davidz at redhat.com>
---
 monitor/gdu/ggduvolumemonitor.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/monitor/gdu/ggduvolumemonitor.c b/monitor/gdu/ggduvolumemonitor.c
index 32604d0..b52ee11 100644
--- a/monitor/gdu/ggduvolumemonitor.c
+++ b/monitor/gdu/ggduvolumemonitor.c
@@ -617,7 +617,7 @@ get_mount_point_for_device (GduDevice *d, GList *fstab_mount_points)
   for (l = fstab_mount_points; l != NULL; l = l->next)
     {
       GUnixMountPoint *mount_point = l->data;
-      const gchar *device_file;
+      const gchar *fstab_device_file;
       const gchar *fstab_mount_path;
 
       fstab_mount_path = g_unix_mount_point_get_mount_path (mount_point);
@@ -627,18 +627,18 @@ get_mount_point_for_device (GduDevice *d, GList *fstab_mount_points)
           goto out;
         }
 
-      device_file = g_unix_mount_point_get_device_path (mount_point);
-      if (g_str_has_prefix (device_file, "LABEL="))
+      fstab_device_file = g_unix_mount_point_get_device_path (mount_point);
+      if (g_str_has_prefix (fstab_device_file, "LABEL="))
         {
-          if (g_strcmp0 (device_file + 6, gdu_device_id_get_label (d)) == 0)
+          if (g_strcmp0 (fstab_device_file + 6, gdu_device_id_get_label (d)) == 0)
             {
               ret = mount_point;
               goto out;
             }
         }
-      else if (g_str_has_prefix (device_file, "UUID="))
+      else if (g_str_has_prefix (fstab_device_file, "UUID="))
         {
-          if (g_ascii_strcasecmp (device_file + 5, gdu_device_id_get_uuid (d)) == 0)
+          if (g_ascii_strcasecmp (fstab_device_file + 5, gdu_device_id_get_uuid (d)) == 0)
             {
               ret = mount_point;
               goto out;
@@ -646,11 +646,11 @@ get_mount_point_for_device (GduDevice *d, GList *fstab_mount_points)
         }
       else
         {
-          char resolved_device_file[PATH_MAX];
+          char resolved_fstab_device_file[PATH_MAX];
 
           /* handle symlinks such as /dev/disk/by-uuid/47C2-1994 */
-          if (realpath (device_file, resolved_device_file) != NULL &&
-              g_strcmp0 (resolved_device_file, device_file) == 0)
+          if (realpath (fstab_device_file, resolved_fstab_device_file) != NULL &&
+              g_strcmp0 (resolved_fstab_device_file, device_file) == 0)
             {
               ret = mount_point;
               goto out;
-- 
1.6.2.2


gdu-0003-Avoid-automounting-volumes-on-virtual-and-unknown-bu.patch:

--- NEW FILE gdu-0003-Avoid-automounting-volumes-on-virtual-and-unknown-bu.patch ---
>From 47a663c7ad7b9de9942b9b740abff6610968a402 Mon Sep 17 00:00:00 2001
From: David Zeuthen <davidz at redhat.com>
Date: Thu, 9 Apr 2009 19:05:37 -0400
Subject: [PATCH 3/7] Avoid automounting volumes on virtual and unknown buses

Basically we want to avoid automounting volumes from

 1. drives on a 'virtual' or unset bus
 2. volumes without a drive

This is to avoid interference with things like Fedora's livecd-tools
that use device-mapper to set up images. See

 https://bugzilla.redhat.com/show_bug.cgi?id=494144 for more

background.

In the future we might want to relax 1. so automounting things like
Linux MD and LVM2 devices work.
---
 monitor/gdu/ggduvolume.c |   50 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 50 insertions(+), 0 deletions(-)

diff --git a/monitor/gdu/ggduvolume.c b/monitor/gdu/ggduvolume.c
index b540325..a5a3321 100644
--- a/monitor/gdu/ggduvolume.c
+++ b/monitor/gdu/ggduvolume.c
@@ -293,6 +293,56 @@ update_volume (GGduVolume *volume)
             volume->should_automount = FALSE;
         }
 
+      /* Avoid automounting volumes from
+       *
+       * 1. drives on a 'virtual' or unset bus
+       * 2. volumes without a drive
+       *
+       * This is to avoid interference with things like Fedora's
+       * livecd-tools that use device-mapper to set up images. See
+       * https://bugzilla.redhat.com/show_bug.cgi?id=494144 for more
+       * background.
+       *
+       * In the future we might want to relax 1. so automounting
+       * things like Linux MD and LVM2 devices work.
+       */
+      if (volume->drive != NULL)
+        {
+          GduPresentable *drive_presentable;
+          drive_presentable = g_gdu_drive_get_presentable (volume->drive);
+          if (drive_presentable != NULL)
+            {
+              GduDevice *drive_device;
+              drive_device = gdu_presentable_get_device (drive_presentable);
+              if (drive_device != NULL)
+                {
+                  const gchar *bus;
+                  bus = gdu_device_drive_get_connection_interface (drive_device);
+                  if (bus == NULL || strlen (bus) == 0 || g_strcmp0 (bus, "virtual") == 0)
+                    {
+                      volume->should_automount = FALSE;
+                    }
+                  g_object_unref (drive_device);
+                }
+              else
+                {
+                  volume->should_automount = FALSE;
+                }
+            }
+          else
+            {
+              volume->should_automount = FALSE;
+            }
+        }
+      else
+        {
+          volume->should_automount = FALSE;
+        }
+
+      g_debug ("should_automount = %d for %s",
+               volume->should_automount,
+               device != NULL ? gdu_device_get_device_file (device) : "(none)");
+
       g_free (activation_uri);
     }
 
-- 
1.6.2.2


gdu-0004-Remove-debug-spew.patch:

--- NEW FILE gdu-0004-Remove-debug-spew.patch ---
>From 82202f50bb76248f5a6368fe08de947758674acd Mon Sep 17 00:00:00 2001
From: David Zeuthen <davidz at redhat.com>
Date: Thu, 9 Apr 2009 19:14:25 -0400
Subject: [PATCH 4/7] Remove debug spew

---
 monitor/gdu/ggduvolume.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/monitor/gdu/ggduvolume.c b/monitor/gdu/ggduvolume.c
index a5a3321..6779f0f 100644
--- a/monitor/gdu/ggduvolume.c
+++ b/monitor/gdu/ggduvolume.c
@@ -339,10 +339,6 @@ update_volume (GGduVolume *volume)
           volume->should_automount = FALSE;
         }
 
-      g_debug ("should_automount = %d for %s",
-               volume->should_automount,
-               device != NULL ? gdu_device_get_device_file (device) : "(none)");
-
       g_free (activation_uri);
     }
 
-- 
1.6.2.2


gdu-0005-Don-t-add-a-volume-if-the-device-is-mounted-and-igno.patch:

--- NEW FILE gdu-0005-Don-t-add-a-volume-if-the-device-is-mounted-and-igno.patch ---
>From d9a00cc6172e2bf82f6825023c7a619be7f56747 Mon Sep 17 00:00:00 2001
From: David Zeuthen <davidz at redhat.com>
Date: Thu, 9 Apr 2009 19:33:35 -0400
Subject: [PATCH 5/7] Don't add a volume if the device is mounted and ignored

This fixes a problem where e.g. /dev/sdb1 a) is not referenced in
/etc/fstab; and b) is mounted in an ignored location e.g. /mnt/live.

Specifically this bug affects the Fedora Live CD, see
https://bugzilla.redhat.com/show_bug.cgi?id=495033 for details.
---
 monitor/gdu/ggduvolumemonitor.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/monitor/gdu/ggduvolumemonitor.c b/monitor/gdu/ggduvolumemonitor.c
index b52ee11..93aaf03 100644
--- a/monitor/gdu/ggduvolumemonitor.c
+++ b/monitor/gdu/ggduvolumemonitor.c
@@ -671,9 +671,6 @@ should_mount_be_ignored (GduPool *pool, GduDevice *d)
 
   ret = FALSE;
 
-  if (gdu_device_is_mounted (d))
-    goto out;
-
   mount_path = gdu_device_get_mount_path (d);
   if (mount_path == NULL || strlen (mount_path) == 0)
     goto out;
-- 
1.6.2.2


gdu-0006-Ignore-drives-if-all-volumes-of-the-drive-are-ignore.patch:

--- NEW FILE gdu-0006-Ignore-drives-if-all-volumes-of-the-drive-are-ignore.patch ---
>From 346fdc3ddf383228ed58a48252e70919f6636b6e Mon Sep 17 00:00:00 2001
From: David Zeuthen <davidz at redhat.com>
Date: Thu, 9 Apr 2009 19:39:55 -0400
Subject: [PATCH 6/7] Ignore drives if all volumes of the drive are ignored

---
 monitor/gdu/ggduvolumemonitor.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/monitor/gdu/ggduvolumemonitor.c b/monitor/gdu/ggduvolumemonitor.c
index 93aaf03..9ecee8b 100644
--- a/monitor/gdu/ggduvolumemonitor.c
+++ b/monitor/gdu/ggduvolumemonitor.c
@@ -763,15 +763,17 @@ should_drive_be_ignored (GduPool *pool, GduDrive *d, GList *fstab_mount_points)
 
   device = gdu_presentable_get_device (GDU_PRESENTABLE (d));
 
-  /* the GduDevice for an activatable drive (such as RAID) is NULL if the drive is not
-   * activated; never ignore these
+  /* If there is no GduDevice for a drive, then ignore it.
+   *
+   * Note that right now the only drives without a GduDevice are Linux
+   * MD arrays not yet activated. In the future we might want to
+   * display these so the user can start the array.
    */
   if (device == NULL)
-    goto out;
-
-  /* never ignore drives with removable media */
-  if (gdu_device_is_removable (device))
-    goto out;
+    {
+      ret = TRUE;
+      goto out;
+    }
 
   has_volumes = FALSE;
   all_volumes_are_ignored = TRUE;
-- 
1.6.2.2


gdu-0007-Bug-576587-allow-eject-even-on-non-ejectable-vol.patch:

--- NEW FILE gdu-0007-Bug-576587-allow-eject-even-on-non-ejectable-vol.patch ---
>From 303cfd43578f0a4198c063f1a5fbcd16fec2b0bf Mon Sep 17 00:00:00 2001
From: David Zeuthen <davidz at redhat.com>
Date: Thu, 9 Apr 2009 21:04:24 -0400
Subject: [PATCH 7/7] =?utf-8?q?Bug=20576587=20=E2=80=93=20allow=20eject=20even=20on=20non-ejectable=20volumes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

This fixes a host of problems with e.g. Kindle or iPod devices
requiring to be "ejected" to display messages such as

 "If you want to use your Kindle and continue charging, please eject
 your Kindle from your computer."

to the user.

Previously we relied on HAL fdi files or similar to tag that such
devices needed to be ejectable. Now we just set everything as
ejectable.

For this to really work well the Nautilus patch in

 http://bugzilla.gnome.org/show_bug.cgi?id=574067

needs to be reverted.
---
 monitor/gdu/ggdudrive.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/monitor/gdu/ggdudrive.c b/monitor/gdu/ggdudrive.c
index 257a113..29e108d 100644
--- a/monitor/gdu/ggdudrive.c
+++ b/monitor/gdu/ggdudrive.c
@@ -166,7 +166,11 @@ update_drive (GGduDrive *drive)
       drive->device_file = g_strdup (gdu_device_get_device_file (device));
       drive->is_media_removable = gdu_device_is_removable (device);
       drive->has_media = gdu_device_is_media_available (device);
-      drive->can_eject = gdu_device_drive_get_is_media_ejectable (device) || gdu_device_drive_get_requires_eject (device);
+      /* All drives with removable media are ejectable
+       *
+       * See http://bugzilla.gnome.org/show_bug.cgi?id=576587 for why we want this.
+       */
+      drive->can_eject = gdu_device_drive_get_is_media_ejectable (device) || gdu_device_drive_get_requires_eject (device) || gdu_device_is_removable (device);
       drive->is_media_check_automatic = gdu_device_is_media_change_detected (device);
       drive->can_poll_for_media = TRUE;
     }
-- 
1.6.2.2



Index: gvfs.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gvfs/devel/gvfs.spec,v
retrieving revision 1.120
retrieving revision 1.121
diff -u -r1.120 -r1.121
--- gvfs.spec	9 Apr 2009 18:36:06 -0000	1.120
+++ gvfs.spec	10 Apr 2009 01:24:24 -0000	1.121
@@ -1,7 +1,7 @@
 Summary: Backends for the gio framework in GLib
 Name: gvfs
 Version: 1.2.1
-Release: 2%{?dist}
+Release: 3%{?dist}
 License: LGPLv2+
 Group: System Environment/Libraries
 URL: http://www.gtk.org
@@ -19,7 +19,7 @@
 BuildRequires: intltool
 BuildRequires: gettext-devel
 BuildRequires: GConf2-devel
-BuildRequires: gnome-disk-utility-devel >= 0.2
+BuildRequires: gnome-disk-utility-devel >= 0.3
 
 
 Requires(post): desktop-file-utils
@@ -30,18 +30,25 @@
 BuildRequires: libtool
 # http://bugzilla.gnome.org/show_bug.cgi?id=567235
 Patch1: gvfs-0.99.2-archive-integration.patch
-
 # http://bugzilla.gnome.org/show_bug.cgi?id=573826
-Patch2: gvfs-gdu-volume-monitor-3.patch
+Patch2: gvfs-1.1.7-gdu-computer-expose-devices.patch
 
+# Gdu volume monitor patches, from http://cgit.freedesktop.org/~david/gvfs/log/?h=gdu-volume-monitor
+#
 # http://bugzilla.gnome.org/show_bug.cgi?id=573826
-Patch3: gvfs-1.1.7-gdu-monitor-empty-drives.patch
-
+Patch101: gdu-0001-Bug-573826-gdu-volume-monitor.patch
 # http://bugzilla.gnome.org/show_bug.cgi?id=573826
-Patch4: gvfs-1.1.7-gdu-computer-expose-devices.patch
-
+Patch102: gdu-0002-Fix-how-we-determine-if-a-volume-is-ignored.patch
 # https://bugzilla.redhat.com/show_bug.cgi?id=494144
-Patch5: gvfs-1.2.1-only-mount-the-metal.patch
+Patch103: gdu-0003-Avoid-automounting-volumes-on-virtual-and-unknown-bu.patch
+Patch104: gdu-0004-Remove-debug-spew.patch
+# https://bugzilla.redhat.com/show_bug.cgi?id=495033
+Patch105: gdu-0005-Don-t-add-a-volume-if-the-device-is-mounted-and-igno.patch
+Patch106: gdu-0006-Ignore-drives-if-all-volumes-of-the-drive-are-ignore.patch
+
+# http://bugzilla.gnome.org/show_bug.cgi?id=576587
+# - Pending discussion + requires Nautilus patch
+#Patch107: gdu-0007-Bug-576587-allow-eject-even-on-non-ejectable-vol.patch
 
 %description
 The gvfs package provides backend implementations for the gio
@@ -124,10 +131,15 @@
 %prep
 %setup -q
 %patch1 -p0 -b .archive-integration
-%patch2 -p0 -b .gdu
-%patch3 -p1 -b .gdu-volumes-typo
-%patch4 -p1 -b .computer-gdu
-%patch5 -p1 -b .metal
+%patch2 -p1 -b .computer-expose-devices
+
+%patch101 -p1 -b .gdu-volume-monitor
+%patch102 -p1 -b .gdu-volumes-typo
+%patch103 -p1 -b .gdu-avoid-automount
+%patch104 -p1 -b .gdu-debug-spew
+%patch105 -p1 -b .gdu-ignore-1
+%patch106 -p1 -b .gdu-ignore-2
+#%patch107 -p1 -b .gdu-always-eject
 
 %build
 
@@ -271,6 +283,10 @@
 
 
 %changelog
+* Thu Apr  9 2009 David Zeuthen <davidz at redhat.com> - 1.2.1-3
+- Clean up gdu patches and bump BR for gdu to 0.3
+- Avoiding showing volume for ignored mounts (#495033)
+
 * Thu Apr  9 2009 David Zeuthen <davidz at redhat.com> - 1.2.1-2
 - Avoid automounting device-mapper devices and similar (#494144)
 


--- gvfs-1.1.7-gdu-monitor-empty-drives.patch DELETED ---


--- gvfs-1.2.0-fix-daemon-mount-op-bgo575728.patch DELETED ---


--- gvfs-1.2.1-only-mount-the-metal.patch DELETED ---


--- gvfs-gdu-volume-monitor-3.patch DELETED ---




More information about the fedora-extras-commits mailing list