aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils
diff options
context:
space:
mode:
authorjylefort <jylefort@FreeBSD.org>2007-04-07 19:53:22 +0800
committerjylefort <jylefort@FreeBSD.org>2007-04-07 19:53:22 +0800
commita31499f8472cb1c1eafab2a27942eae80272da09 (patch)
tree2da2b81f61a43f00b8c17d838ef93da3ffbfa13c /sysutils
parent1c02a5df7c3ae569cecd1184171bdabd55c5b757 (diff)
downloadfreebsd-ports-gnome-a31499f8472cb1c1eafab2a27942eae80272da09.tar.gz
freebsd-ports-gnome-a31499f8472cb1c1eafab2a27942eae80272da09.tar.zst
freebsd-ports-gnome-a31499f8472cb1c1eafab2a27942eae80272da09.zip
Add an option which makes hald use the device name rather than the
volume label as default mountpoint. Using the UTF-8 volume label as mountpoint can be problematic with legacy locales. Reported by: Andrew Muhametshin <andrew@dobrohot.org>, lofi
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/hal/Makefile6
-rw-r--r--sysutils/hal/files/extra-patch-tools_hal-storage-mount.c30
2 files changed, 36 insertions, 0 deletions
diff --git a/sysutils/hal/Makefile b/sysutils/hal/Makefile
index 37805f8f5714..0af97ff0e02a 100644
--- a/sysutils/hal/Makefile
+++ b/sysutils/hal/Makefile
@@ -64,6 +64,8 @@ PLIST_FILES= ${PRIV_FILES:S|^|%%DATADIR%%/dist/|}
SUB_FILES= pkg-install pkg-deinstall
SUB_LIST= RC_FILES="${RC_FILES}"
+
+OPTIONS= FIXED_MOUNTPOINTS "use fixed mountpoints" off
.else # Slave port stuff
LIB_DEPENDS+= hal.1:${PORTSDIR}/sysutils/hal
RUN_DEPENDS+= ${PYTHON_SITELIBDIR}/dbus/__init__.py:${PORTSDIR}/devel/py-dbus
@@ -96,6 +98,10 @@ PLIST_SUB+= MEDIA=""
.else
PLIST_SUB+= MEDIA="@comment "
.endif
+
+.if defined(WITH_FIXED_MOUNTPOINTS)
+EXTRA_PATCHES+= ${FILESDIR}/extra-patch-tools_hal-storage-mount.c
+.endif
.endif
post-patch:
diff --git a/sysutils/hal/files/extra-patch-tools_hal-storage-mount.c b/sysutils/hal/files/extra-patch-tools_hal-storage-mount.c
new file mode 100644
index 000000000000..ce9895f941a4
--- /dev/null
+++ b/sysutils/hal/files/extra-patch-tools_hal-storage-mount.c
@@ -0,0 +1,30 @@
+--- tools/hal-storage-mount.c.orig Sun May 14 20:57:59 2006
++++ tools/hal-storage-mount.c Sat Apr 7 12:50:53 2007
+@@ -513,23 +513,11 @@
+ explicit_mount_point_given = FALSE;
+ if (strlen (mount_point) == 0) {
+ char *p;
+- const char *label;
++ char *basename;
+
+- if (volume != NULL)
+- label = libhal_volume_get_label (volume);
+- else
+- label = NULL;
+-
+- if (label != NULL) {
+- /* best - use label */
+- g_strlcpy (mount_point, label, sizeof (mount_point));
+-
+- /* TODO: use drive type */
+-
+- } else {
+- /* fallback - use "disk" */
+- g_snprintf (mount_point, sizeof (mount_point), "disk");
+- }
++ basename = g_path_get_basename (device);
++ g_strlcpy (mount_point, basename, sizeof (mount_point));
++ g_free (basename);
+
+ /* sanitize computed mount point name, e.g. replace invalid chars with '-' */
+ p = mount_point;