freebsd-ports/net/glusterfs/files/patch-mount_glusterfs.in
Eugene Grosbein b2384d48d6 glusterfs should be mountable by means of /etc/fstab now
as we have /sbin/mount_fusefs in all supported FreeBSD versions,
for example:

gluster1:name /mnt/name fusefs rw,late,backup-volfile-servers=gluster2:gluster3,mountprog=/usr/local/sbin/mount_glusterfs 0 0

Make it work by fixing shell script /usr/local/sbin/mount_glusterfs
to properly process multiple -o command line options.

PR:		224451
Submitted by:	Vladimir Kurtukov <vk@vk.pp.ru>
Reported by:	Vladimir Kurtukov <vk@vk.pp.ru>
Approved by:	craig001@lerwick.hopto.org (maintainer)
2018-02-11 05:40:56 +00:00

57 lines
1.5 KiB
Text

--- xlators/mount/fuse/utils/mount_glusterfs.in.orig 2017-06-27 22:25:12.392137135 +0700
+++ xlators/mount/fuse/utils/mount_glusterfs.in 2017-12-19 18:24:21.736142000 +0700
@@ -463,50 +463,44 @@ parse_options()
if [ "$key" = "$value" ]; then
without_options $pair;
else
with_options $key $value;
fi
done
}
main ()
{
- ## `mount` on OSX specifies options as first argument
- echo $1|grep -q -- "-o"
- if [ $? -eq 0 ]; then
- volfile_loc=$3
- mount_point=$4
- else
- volfile_loc=$1
- mount_point=$2
- fi
-
while getopts "Vo:h" opt; do
case "${opt}" in
o)
parse_options ${OPTARG};
;;
V)
${cmd_line} -V;
exit 0;
;;
h)
print_usage;
exit 0;
;;
?)
print_usage;
exit 0;
;;
esac
done
+ shift $((OPTIND - 1))
+ volfile_loc="$1"
+ mount_point="$2"
+
[ -r "$volfile_loc" ] || {
# '%' included to support ipv6 link local addresses
server_ip=$(echo "$volfile_loc" | sed -n 's/\([a-zA-Z0-9:%.\-]*\):.*/\1/p');
volume_str=$(echo "$volfile_loc" | sed -n 's/.*:\([^ ]*\).*/\1/p');
[ -n "$volume_str" ] && {
volume_id="$volume_str";
}
volfile_loc="";
}