Cherrypick from master 2005-08-07 20:19:39 UTC freetz <freetz@pld-linux.org> '- misc fixes (stolen from ubuntu/debian)':
gnome-vfs2-defaults-path.patch -> 1.2
gnome-vfs2-get_volume_for_path.patch -> 1.1
gnome-vfs2-resolve_fstab_symlinks.patch -> 1.1
gnome-vfs2-user_visible_drives.patch -> 1.1
Cherrypick from master 2005-08-14 09:30:32 UTC freetz <freetz@pld-linux.org> '- handle drives without media detection':
gnome-vfs2-handle-drives-without-media-detection.patch -> 1.1
--- /dev/null
+diff -urN aa/gnome-vfs-2.9.90/libgnomevfs/gnome-vfs-mime-info.c gnome-vfs-2.9.90/libgnomevfs/gnome-vfs-mime-info.c
+--- aa/gnome-vfs-2.9.90/libgnomevfs/gnome-vfs-mime-info.c 2004-12-14 16:30:29.000000000 +0100
++++ gnome-vfs-2.9.90/libgnomevfs/gnome-vfs-mime-info.c 2005-02-06 22:33:14.677240592 +0100
+@@ -150,7 +150,7 @@
+
+ xdg_data_dirs = g_getenv ("XDG_DATA_DIRS");
+ if (!xdg_data_dirs) {
+- xdg_data_dirs = "/usr/local/share/:/usr/share/";
++ xdg_data_dirs = "/usr/local/share/:/usr/share/gnome/:/usr/share/";
+ }
+
+ split_data_dirs = g_strsplit (xdg_data_dirs, ":", 0);
+diff -urN aa/gnome-vfs-2.9.90/libgnomevfs/xdgmime.c gnome-vfs-2.9.90/libgnomevfs/xdgmime.c
+--- aa/gnome-vfs-2.9.90/libgnomevfs/xdgmime.c 2004-12-14 16:30:30.000000000 +0100
++++ gnome-vfs-2.9.90/libgnomevfs/xdgmime.c 2005-02-06 22:33:25.327621488 +0100
+@@ -207,7 +207,7 @@
+
+ xdg_data_dirs = getenv ("XDG_DATA_DIRS");
+ if (xdg_data_dirs == NULL)
+- xdg_data_dirs = "/usr/local/share/:/usr/share/";
++ xdg_data_dirs = "/usr/local/share/:/usr/share/gnome/:/usr/share/";
+
+ ptr = xdg_data_dirs;
+
--- /dev/null
+diff -Nur gnome-vfs2-2.10.1cvs20050510.orig/libgnomevfs/gnome-vfs-volume-monitor.c gnome-vfs2-2.10.1cvs20050510/libgnomevfs/gnome-vfs-volume-monitor.c
+--- gnome-vfs2-2.10.1cvs20050510.orig/libgnomevfs/gnome-vfs-volume-monitor.c 2005-04-21 01:58:14.000000000 +0200
++++ gnome-vfs2-2.10.1cvs20050510/libgnomevfs/gnome-vfs-volume-monitor.c 2005-05-10 15:30:29.165933432 +0200
+@@ -26,6 +26,7 @@
+ #include <string.h>
+
+ #include "gnome-vfs-private.h"
++#include "gnome-vfs-utils.h"
+ #include "gnome-vfs-volume-monitor.h"
+ #include "gnome-vfs-volume-monitor-private.h"
+ #include "gnome-vfs-volume-monitor-client.h"
+@@ -868,22 +869,28 @@
+ dev_t device;
+ GList *l;
+ GnomeVFSVolume *volume, *res;
++ char *uri;
+
+ if (g_stat (path, &statbuf) != 0)
+ return NULL;
+
+ device = statbuf.st_dev;
+
++ uri = gnome_vfs_get_uri_from_local_path(path);
++
+ res = NULL;
+ g_mutex_lock (volume_monitor->priv->mutex);
+ for (l = volume_monitor->priv->mtab_volumes; l != NULL; l = l->next) {
+ volume = l->data;
+- if (volume->priv->unix_device == device) {
++ if (volume->priv->unix_device == device &&
++ strncmp(volume->priv->activation_uri,uri,strlen(volume->priv->activation_uri)) == 0) {
+ res = gnome_vfs_volume_ref (volume);
+ break;
+ }
+ }
+ g_mutex_unlock (volume_monitor->priv->mutex);
+
++ g_free(uri);
++
+ return res;
+ }
--- /dev/null
+Index: libgnomevfs/gnome-vfs-hal-mounts.c
+===================================================================
+RCS file: /cvs/gnome/gnome-vfs/libgnomevfs/gnome-vfs-hal-mounts.c,v
+retrieving revision 1.15
+diff -u -p -r1.15 gnome-vfs-hal-mounts.c
+--- libgnomevfs/gnome-vfs-hal-mounts.c 23 Jul 2005 22:28:15 -0000 1.15
++++ libgnomevfs/gnome-vfs-hal-mounts.c 10 Aug 2005 20:50:50 -0000
+@@ -1475,6 +1475,24 @@ _gnome_vfs_hal_mounts_modify_volume (Gno
+ */
+ hal_drive = libhal_drive_from_device_file (hal_ctx, volume->priv->device_path);
+ if (hal_drive != NULL) {
++
++ /* handle drives that HAL can't poll and the user can still mount */
++ if (libhal_device_get_property_bool (hal_ctx,
++ libhal_drive_get_udi (hal_drive),
++ "storage.media_check_enabled",
++ NULL) == FALSE) {
++ GnomeVFSDrive *drive;
++
++ if ((drive = _gnome_vfs_volume_monitor_find_drive_by_hal_udi (
++ GNOME_VFS_VOLUME_MONITOR (volume_monitor_daemon),
++ libhal_drive_get_udi (hal_drive))) != NULL) {
++ volume->priv->drive = drive;
++ _gnome_vfs_drive_add_mounted_volume (drive, volume);
++
++ goto out;
++ }
++ }
++
+ /* ok, this device file is in HAL and thus managed by this backend */
+ gnome_vfs_volume_unref (volume);
+ result = NULL;
--- /dev/null
+# upstream http://bugzilla.gnome.org/show_bug.cgi?id=132797
+
+diff -Nur gnome-vfs2-2.8.3/libgnomevfs/gnome-vfs-unix-mounts.c gnome-vfs2-2.8.3.new/libgnomevfs/gnome-vfs-unix-mounts.c
+--- gnome-vfs2-2.8.3/libgnomevfs/gnome-vfs-unix-mounts.c 2004-10-15 10:00:02.000000000 +0200
++++ gnome-vfs2-2.8.3.new/libgnomevfs/gnome-vfs-unix-mounts.c 2004-11-23 17:19:09.426568360 +0100
+@@ -538,6 +538,7 @@
+ char *opt, *opt_end;
+ struct stat sb;
+ GnomeVFSUnixMountPoint *mount_entry;
++ char rpath[PATH_MAX];
+
+ stat_file = read_file = get_fstab_file ();
+
+@@ -569,7 +570,12 @@
+
+ mount_entry = g_new0 (GnomeVFSUnixMountPoint, 1);
+
+- mount_entry->mount_path = g_strdup (mntent->mnt_dir);
++ /* resolve symlinks */
++ if (realpath (mntent->mnt_dir, rpath))
++ mount_entry->mount_path = g_strdup (rpath);
++ else
++ mount_entry->mount_path = g_strdup (mntent->mnt_dir);
++
+ mount_entry->device_path = g_strdup (mntent->mnt_fsname);
+ mount_entry->filesystem_type = g_strdup (mntent->mnt_type);
+
--- /dev/null
+Nur in gnome-vfs2-2.8.1.old/debian/patches: 12_user_visible_drives.patch.
+diff -ru gnome-vfs2-2.8.1.old/libgnomevfs/gnome-vfs-volume-monitor-daemon.c gnome-vfs2-2.8.1/libgnomevfs/gnome-vfs-volume-monitor-daemon.c
+--- gnome-vfs2-2.8.1.old/libgnomevfs/gnome-vfs-volume-monitor-daemon.c 2004-09-23 15:20:46.099901960 +0200
++++ gnome-vfs2-2.8.1/libgnomevfs/gnome-vfs-volume-monitor-daemon.c 2004-09-23 15:23:00.649447320 +0200
+@@ -954,6 +954,10 @@
+ vol->priv->is_user_visible = 1;
+ break;
+ default:
++ /* additionally mark devices below /media/ as user visible, in
++ * case they are not recognized as devices above */
++ if (!strncmp (mount->mount_path, "/media/", 7))
++ vol->priv->is_user_visible = 1;
+ break;
+ }
+