aboutsummaryrefslogtreecommitdiff
path: root/x11-fm/nautilus/files/patch-ac
diff options
context:
space:
mode:
Diffstat (limited to 'x11-fm/nautilus/files/patch-ac')
-rw-r--r--x11-fm/nautilus/files/patch-ac211
1 files changed, 69 insertions, 142 deletions
diff --git a/x11-fm/nautilus/files/patch-ac b/x11-fm/nautilus/files/patch-ac
index 708c7d4175cd..ab6106eec066 100644
--- a/x11-fm/nautilus/files/patch-ac
+++ b/x11-fm/nautilus/files/patch-ac
@@ -1,152 +1,79 @@
---- libnautilus-extensions/nautilus-volume-monitor.c.orig Thu Aug 3 17:15:57 2000
-+++ libnautilus-extensions/nautilus-volume-monitor.c Tue Aug 22 17:45:07 2000
-@@ -22,6 +22,9 @@
- Authors: Gene Z. Ragan <gzr@eazel.com>
- */
-
+--- libnautilus-extensions/nautilus-volume-monitor.c.orig Thu Oct 19 16:51:16 2000
++++ libnautilus-extensions/nautilus-volume-monitor.c Fri Jan 12 11:05:57 2001
+@@ -60,4 +60,9 @@
+ #else
++#ifdef __FreeBSD__
+#include <sys/param.h>
+#include <sys/mount.h>
++#else
+ #include <mntent.h>
+ #endif
++#endif
+
+@@ -935,2 +940,40 @@
+
++#ifdef __FreeBSD__
++static void
++fstab_add_mount_volume (NautilusVolumeMonitor *monitor, struct fstab *ent)
++{
++ NautilusVolume *volume;
++ gboolean mounted;
++
++ volume = g_new0 (NautilusVolume, 1);
++ volume->fsname = g_strdup(ent->fs_spec);
++ volume->mount_path = g_strdup(ent->fs_file);
++
++ mounted = FALSE;
++
++ if (nautilus_str_has_prefix (ent->fs_spec, "/dev/fd")) {
++ mounted = mount_volume_floppy_add (monitor, volume);
++ } else if (strcmp (ent->fs_vfstype, "ufs") == 0) {
++ mounted = mount_volume_ext2_add (volume);
++ } else if (strcmp (ent->fs_vfstype, "nfs") == 0) {
++ mounted = mount_volume_nfs_add (volume);
++ } else if (strcmp (ent->fs_vfstype, "cd9660") == 0) {
++ mounted = mount_volume_iso9660_add (volume);
++ } else if (strcmp (ent->fs_vfstype, "msdos") == 0) {
++ mounted = mount_volume_msdos_add (volume);
++ }
++
++ if (mounted) {
++ volume->is_read_only = strstr (ent->fs_type, FSTAB_RO) != NULL;
++ monitor->details->volumes = g_list_append (monitor->details->volumes, volume);
++ mount_volume_add_aliases (monitor, volume->fsname, volume);
++ } else {
++ g_free (volume->fsname);
++ g_free (volume->mount_path);
++ g_free (volume);
++ }
++}
++
++#else
+
- #include <config.h>
-
- #include <errno.h>
-@@ -31,7 +34,6 @@
- #include <gnome.h>
- #include <libgnome/gnome-i18n.h>
- #include <libgnomevfs/gnome-vfs.h>
--#include <mntent.h>
- #include <libnautilus-extensions/nautilus-cdrom-extensions.h>
- #include <libnautilus-extensions/nautilus-directory-private.h>
- #include <libnautilus-extensions/nautilus-file-utilities.h>
-@@ -48,6 +50,11 @@
- #include <sys/types.h>
- #include <xmlmemory.h>
-
-+#undef MOUNT_TYPE_ISO9660
-+#define MOUNT_TYPE_ISO9660 "cd9660"
-+#undef MOUNT_TYPE_EXT2
-+#define MOUNT_TYPE_EXT2 "ufs" /* really ufs */
-+#define _PATH_MOUNTED "/etc/fstab"
-
- /* FIXME: Remove messages when this code is done. */
- #define MESSAGE g_message
-@@ -91,7 +98,7 @@
- DeviceInfo *device);
- static void mount_device_activate_floppy (NautilusVolumeMonitor *view,
- DeviceInfo *device);
--static gboolean mntent_is_removable_fs (struct mntent *ent);
-+static gboolean mntent_is_removable_fs (struct fstab *ent);
- static void free_device_info (DeviceInfo *device,
- NautilusVolumeMonitor *monitor);
- static gboolean add_mount_link_property (const char *path);
-@@ -197,21 +204,19 @@
- fm_desktop_get_removable_volume_list (void)
- {
- GList *list;
-- FILE *mef;
-- struct mntent *ent;
-+ struct fstab *ent;
-
- list = NULL;
-
-- mef = setmntent (_PATH_FSTAB, "r");
-- g_return_val_if_fail (mef, NULL);
-+ setfsent();
-
-- while ((ent = getmntent (mef))) {
-+ while ((ent = getfsent ())) {
- if (mntent_is_removable_fs (ent)) {
-- list = g_list_append (list, g_strdup (ent->mnt_dir));
-+ list = g_list_append (list, g_strdup (ent->fs_file));
- continue;
- }
- }
-- endmntent (mef);
-+ endfsent ();
-
- /* Move all floppy mounts to top of list */
- list = g_list_sort (list, (GCompareFunc) floppy_sort);
-@@ -754,7 +759,7 @@
-
-
static void
--add_mount_device (NautilusVolumeMonitor *monitor, struct mntent *ent)
-+add_mount_device (NautilusVolumeMonitor *monitor, struct fstab *ent)
- {
- DeviceInfo *newdev = NULL;
- gboolean mounted;
-@@ -762,23 +767,23 @@
- newdev = g_new0 (DeviceInfo, 1);
- g_assert (newdev);
- newdev->device_fd = -1;
-- newdev->fsname = g_strdup (ent->mnt_fsname);
-- newdev->mount_path = g_strdup (ent->mnt_dir);
-+ newdev->fsname = g_strdup (ent->fs_spec);
-+ newdev->mount_path = g_strdup (ent->fs_file);
- newdev->volume_name = NULL;
- newdev->link_uri = NULL;
- newdev->state = STATE_EMPTY;
-
+@@ -946,3 +989,3 @@
mounted = FALSE;
-
-- if (strcmp (ent->mnt_type, MOUNT_TYPE_ISO9660) == 0) {
-+ if (strcmp (ent->fs_type, MOUNT_TYPE_ISO9660) == 0) {
- mounted = mount_device_iso9660_add (monitor, newdev);
-- } else if (strncmp (ent->mnt_fsname, "/dev/fd", strlen("/dev/fd")) == 0) {
-+ } else if (strncmp (ent->fs_file, "/dev/fd", strlen("/dev/fd")) == 0) {
- mounted = mount_device_floppy_add (monitor, newdev);
-- } else if (strcmp (ent->mnt_type, MOUNT_TYPE_EXT2) == 0) {
-+ } else if (strcmp (ent->fs_type, MOUNT_TYPE_EXT2) == 0) {
- mounted = mount_device_ext2_add (newdev);
- } else {
- /* FIXME: Is this a reasonable way to report this error? */
-- MESSAGE ("Unknown file system: %s", ent->mnt_type);
-+ MESSAGE ("Unknown file system: %s", ent->fs_type);
- }
-
- if (mounted) {
-@@ -794,13 +799,13 @@
+-
++
+ if (nautilus_str_has_prefix (ent->mnt_fsname, FLOPPY_DEVICE_PATH_PREFIX)) {
+@@ -993,2 +1036,3 @@
}
-
- static gboolean
--mntent_is_removable_fs (struct mntent *ent)
-+mntent_is_removable_fs (struct fstab *ent)
- {
-- if (strcmp (ent->mnt_type, MOUNT_TYPE_ISO9660) == 0) {
-+ if (strcmp (ent->fs_type, MOUNT_TYPE_ISO9660) == 0) {
- return TRUE;
- }
-
-- if (strncmp (ent->mnt_fsname, "/dev/fd", strlen("/dev/fd")) == 0) {
-+ if (strncmp (ent->fs_file, "/dev/fd", strlen("/dev/fd")) == 0) {
- return TRUE;
- }
-
-@@ -833,14 +838,12 @@
- void
- nautilus_volume_monitor_find_mount_devices (NautilusVolumeMonitor *monitor)
++#endif /* __FreeBSD__ */
+ #endif /* HAVE_SYS_MNTTAB_H */
+@@ -1021,2 +1065,11 @@
{
-- FILE *mef;
-- struct mntent *ent;
++#ifdef __FreeBSD__
+ struct fstab *ent;
-
-- mef = setmntent (_PATH_MNTTAB, "r");
-- g_return_if_fail (mef);
++
+ setfsent ();
-
-- while ((ent = getmntent (mef))) {
-- MESSAGE ("Checking device %s", ent->mnt_fsname);
-+ while ((ent = getfsent ())) {
-+ MESSAGE ("Checking device %s", ent->fs_spec);
-
- #if 0
- /* Think some more about these checks */
-@@ -859,7 +862,7 @@
- }
-
-
-- endmntent (mef);
-+ endfsent ();
-
- g_list_foreach (monitor->details->devices, (GFunc) mount_device_set_state, monitor);
++ while ((ent = getfsent ()))
++ fstab_add_mount_volume (monitor, ent);
++ endfsent ();
++#else
++
+ FILE *mef;
+@@ -1055,2 +1108,4 @@
+ #endif
++
++#endif /* __FreeBSD__ */