rpms/gvfs/devel gdu-0008-ignore-drives-without-volumes.patch, NONE, 1.1 gdu-0009-never-ignore-drives-without-media.patch, NONE, 1.1 gvfs.spec, 1.122, 1.123

David Zeuthen davidz at fedoraproject.org
Sat Apr 11 17:05:04 UTC 2009


Author: davidz

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

Modified Files:
	gvfs.spec 
Added Files:
	gdu-0008-ignore-drives-without-volumes.patch 
	gdu-0009-never-ignore-drives-without-media.patch 
Log Message:
* Sat Apr 11 2009 David Zeuthen <davidz at redhat.com> - 1.2.1-5
- Don't show drives in computer:/// if media is available but
  no volumes are recognized (#495152)



gdu-0008-ignore-drives-without-volumes.patch:

--- NEW FILE gdu-0008-ignore-drives-without-volumes.patch ---
>From 9a265228542de72df41caef8bd31402841ac389c Mon Sep 17 00:00:00 2001
From: David Zeuthen <davidz at redhat.com>
Date: Sat, 11 Apr 2009 12:43:06 -0400
Subject: [PATCH] ignore drives without volumes

This fixes a problem on some dmraid setups where we have drives
without any partitions (the dmraid boot scripts removes all partitions
(!)). See https://bugzilla.redhat.com/show_bug.cgi?id=495152 for more
details.

This fix is also consistent with the policy of ignoring drives where
all volumes are ignored. E.g. prior to this patch we didn't shown
neither sdb if sdb1 was a the only unrecognized partition on sdb.. so
if you delete sdb1, it would be natural to keep hiding sdb (which is
what this patch does).
---
 monitor/gdu/ggduvolumemonitor.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/monitor/gdu/ggduvolumemonitor.c b/monitor/gdu/ggduvolumemonitor.c
index 9ecee8b..0e7ce6f 100644
--- a/monitor/gdu/ggduvolumemonitor.c
+++ b/monitor/gdu/ggduvolumemonitor.c
@@ -799,7 +799,13 @@ should_drive_be_ignored (GduPool *pool, GduDrive *d, GList *fstab_mount_points)
         }
     }
 
-  ret = has_volumes && all_volumes_are_ignored;
+  /* we ignore a drive if
+   *
+   * a) it doesn't have any volumes; or
+   *
+   * b) the volumes of the drive are all ignored
+   */
+  ret = (!has_volumes) || (has_volumes && all_volumes_are_ignored);
 
  out:
   g_list_foreach (enclosed, (GFunc) g_object_unref, NULL);
-- 
1.6.2.2


gdu-0009-never-ignore-drives-without-media.patch:

--- NEW FILE gdu-0009-never-ignore-drives-without-media.patch ---
>From c54217a58f71f3ca7a85ce81fb96f363255c6110 Mon Sep 17 00:00:00 2001
From: David Zeuthen <davidz at redhat.com>
Date: Sat, 11 Apr 2009 12:57:55 -0400
Subject: [PATCH] never ignore drives without media

---
 monitor/gdu/ggduvolumemonitor.c |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/monitor/gdu/ggduvolumemonitor.c b/monitor/gdu/ggduvolumemonitor.c
index 0e7ce6f..caa25a0 100644
--- a/monitor/gdu/ggduvolumemonitor.c
+++ b/monitor/gdu/ggduvolumemonitor.c
@@ -751,13 +751,13 @@ static gboolean
 should_drive_be_ignored (GduPool *pool, GduDrive *d, GList *fstab_mount_points)
 {
   GduDevice *device;
-  gboolean ret;
+  gboolean ignored;
   gboolean has_volumes;
   gboolean all_volumes_are_ignored;
   GList *enclosed;
   GList *l;
 
-  ret = FALSE;
+  ignored = FALSE;
   device = NULL;
   enclosed = NULL;
 
@@ -771,7 +771,7 @@ should_drive_be_ignored (GduPool *pool, GduDrive *d, GList *fstab_mount_points)
    */
   if (device == NULL)
     {
-      ret = TRUE;
+      ignored = TRUE;
       goto out;
     }
 
@@ -801,11 +801,20 @@ should_drive_be_ignored (GduPool *pool, GduDrive *d, GList *fstab_mount_points)
 
   /* we ignore a drive if
    *
-   * a) it doesn't have any volumes; or
+   * a) no volumes are available AND media is available; OR
    *
    * b) the volumes of the drive are all ignored
    */
-  ret = (!has_volumes) || (has_volumes && all_volumes_are_ignored);
+  if (!has_volumes)
+    {
+      if (gdu_device_is_media_available (device))
+        ignored = TRUE;
+    }
+  else
+    {
+      if (all_volumes_are_ignored)
+        ignored = TRUE;
+    }
 
  out:
   g_list_foreach (enclosed, (GFunc) g_object_unref, NULL);
@@ -814,7 +823,7 @@ should_drive_be_ignored (GduPool *pool, GduDrive *d, GList *fstab_mount_points)
   if (device != NULL)
     g_object_unref (device);
 
-  return ret;
+  return ignored;
 }
 
 static void
-- 
1.6.2.2



Index: gvfs.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gvfs/devel/gvfs.spec,v
retrieving revision 1.122
retrieving revision 1.123
diff -u -r1.122 -r1.123
--- gvfs.spec	11 Apr 2009 04:48:14 -0000	1.122
+++ gvfs.spec	11 Apr 2009 17:04:34 -0000	1.123
@@ -1,7 +1,7 @@
 Summary: Backends for the gio framework in GLib
 Name: gvfs
 Version: 1.2.1
-Release: 4%{?dist}
+Release: 5%{?dist}
 License: LGPLv2+
 Group: System Environment/Libraries
 URL: http://www.gtk.org
@@ -52,6 +52,10 @@
 # - Pending discussion + requires Nautilus patch
 #Patch107: gdu-0007-Bug-576587-allow-eject-even-on-non-ejectable-vol.patch
 
+# https://bugzilla.redhat.com/show_bug.cgi?id=495152
+Patch108: gdu-0008-ignore-drives-without-volumes.patch
+Patch109: gdu-0009-never-ignore-drives-without-media.patch
+
 %description
 The gvfs package provides backend implementations for the gio
 framework in GLib. It includes ftp, sftp, cifs.
@@ -143,6 +147,8 @@
 %patch105 -p1 -b .gdu-ignore-1
 %patch106 -p1 -b .gdu-ignore-2
 #%patch107 -p1 -b .gdu-always-eject
+%patch108 -p1 -b .gdu-ignore-drives-without-volumes
+%patch109 -p1 -b .gdu-never-ignore-drives-without-media
 
 %build
 
@@ -286,6 +292,10 @@
 
 
 %changelog
+* Sat Apr 11 2009 David Zeuthen <davidz at redhat.com> - 1.2.1-5
+- Don't show drives in computer:/// if media is available but
+  no volumes are recognized (#495152)
+
 * Sat Apr 11 2009 Matthias Clasen <mclasen at redhat.com> - 1.2.1-4
 - No need for bash completion to be executable
 




More information about the scm-commits mailing list