From: Allan Randall Date: Thu, 11 Jan 2007 02:56:11 +0000 (+0000) Subject: fixed dmapi mount filter to work on irix X-Git-Tag: v1.1.0~533 X-Git-Url: http://git.apps.os.sepia.ceph.com/?p=xfstests-dev.git;a=commitdiff_plain;h=5dbb6726b46250bfcdc967db0261652b55e4f46a;hp=9bad123a70489ce321c93a0e4a92cc8661868f22 fixed dmapi mount filter to work on irix Merge of master-melb:xfs-cmds:27901a by kenmcd. Execute bits changed from --- to xxx fixed dmapi mount filter to work on irix --- diff --git a/common.rc b/common.rc index df6d02e0..7f13c27c 100644 --- a/common.rc +++ b/common.rc @@ -151,20 +151,20 @@ _mount_ops_filter() { params="$*" - #handle dmapi mtpt option correctly - let "last_index=$#-1" + #get mount point to handle dmapi mtpt option correctly + last_index=`expr $# - 1` [ $last_index -gt 0 ] && shift $last_index - FS_ESCAPED=`echo $1 | $SED_PROG -e 's/\\//\\\\\\//g'` - params="`echo $params | \ - $PERL_PROG -ne "s/mtpt=[^,|^\n|^\s]*/mtpt=$FS_ESCAPED\1\2/; print;"`" + FS_ESCAPED=$1 # irix is fussy about how it is fed its mount options # - multiple -o's are not allowed # - no spaces between comma delimitered options - - # this sed script replaces all -o's (except the first) with a comma + # the sed script replaces all -o's (except the first) with a comma # not required for linux, but won't hurt - echo $params | sed -e 's/[[:space:]]*-o[[:space:]]*/UnIqUe/1; s/[[:space:]]*-o[[:space:]]*/,/g; s/UnIqUe/ -o /1' + + echo $params | sed -e 's/[[:space:]]*-o[[:space:]]*/UnIqUe/1; s/[[:space:]]*-o[[:space:]]*/,/g; s/UnIqUe/ -o /1' \ + | $PERL_PROG -ne "s#mtpt=[^,|^\n|^\s]*#mtpt=$FS_ESCAPED\1\2#; print;" + } _scratch_mount_options()