summaryrefslogtreecommitdiff
path: root/sysutils/hal
diff options
context:
space:
mode:
authorJean-Yves Lefort <jylefort@FreeBSD.org>2007-04-07 11:53:22 +0000
committerJean-Yves Lefort <jylefort@FreeBSD.org>2007-04-07 11:53:22 +0000
commitd3a462f81cdae4a076d488f45313c3930819ebb8 (patch)
tree0dc35cdc21ade05971dc51fcb794bef85cd077b4 /sysutils/hal
parent- Remove apache cruft (diff)
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
Notes
Notes: svn path=/head/; revision=189428
Diffstat (limited to 'sysutils/hal')
-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;