From 97f547c7822980aca2ec4cbbe236b930bab38b76 Mon Sep 17 00:00:00 2001 From: "Kaleb S. KEITHLEY" Date: Sat, 2 Sep 2017 06:50:50 -0400 Subject: scripts: mount.glusterfs contains non-portable bashisms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Debian's default shell is dash, i.e. /bin/sh -> dash, which doesn't support bash extensions Cherry picked from commit c0406501f0b4295a9917d31574baa2e462a18799: > Reported-by: "Michael Lundkvist" > Reported-by: pmatthaei@debian.org > Debian BZ: 873878 > Change-Id: I33003183b9bc6459cae28c565125e6b2bd1eaa47 > BUG: 1487830 > Signed-off-by: Kaleb S. KEITHLEY > Reviewed-on: https://review.gluster.org/18184 > Reviewed-by: Niels de Vos > Tested-by: Niels de Vos > Smoke: Gluster Build System > CentOS-regression: Gluster Build System Reported-by: Michael Lundkvist Reported-by: Patrick Matthäi Debian BZ: 873878 Change-Id: I33003183b9bc6459cae28c565125e6b2bd1eaa47 BUG: 1488119 Signed-off-by: Niels de Vos Reviewed-on: https://review.gluster.org/18205 Smoke: Gluster Build System Reviewed-by: Kaleb KEITHLEY CentOS-regression: Gluster Build System --- xlators/mount/fuse/utils/mount.glusterfs.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xlators/mount/fuse/utils/mount.glusterfs.in b/xlators/mount/fuse/utils/mount.glusterfs.in index 826991ba402..409e32163f7 100755 --- a/xlators/mount/fuse/utils/mount.glusterfs.in +++ b/xlators/mount/fuse/utils/mount.glusterfs.in @@ -664,8 +664,9 @@ main () [ -n "$volume_str" ] && { volume_id=$volume_str volume_str_temp=$volume_str - [ ${volume_str:0:1} = '/' ] && { - volume_str_temp=${volume_str:1} + first_char=$(echo "$volume_str" | cut -c 1) + [ ${first_char} = '/' ] && { + volume_str_temp=$(echo "$volume_str" | cut -c 2-) } [ $(echo $volume_str_temp | grep -c "/") -eq 1 ] && { volume_id=$(echo "$volume_str_temp" | cut -f1 -d '/'); -- cgit