diff --git a/src/tm_mad/tm_common.sh b/src/tm_mad/tm_common.sh index aff902102c..605ebd6197 100644 --- a/src/tm_mad/tm_common.sh +++ b/src/tm_mad/tm_common.sh @@ -42,12 +42,26 @@ WGET=/usr/bin/wget function get_vmdir { VMDIR=`grep '^VM_DIR=' $ONE_LOCAL_VAR/config | cut -d= -f2` + fix_var_slashes +} + +function fix_dir_slashes +{ + dirname "$1/file" | sed -E 's/\/+/\//g' +} + +function fix_var_slashes +{ + ONE_LOCAL_VAR=`fix_dir_slashes "$ONE_LOCAL_VAR"` + VMDIR=`fix_dir_slashes "$VMDIR"` } function fix_paths { if [ -n "$VMDIR" ]; then + SRC_PATH=`fix_dir_slashes "$SRC_PATH"` SRC_PATH=${SRC_PATH/$VMDIR/$ONE_LOCAL_VAR} + DST_PATH=`fix_dir_slashes "$DST_PATH"` DST_PATH=${DST_PATH/$VMDIR/$ONE_LOCAL_VAR} fi } @@ -55,6 +69,7 @@ function fix_paths function fix_src_path { if [ -n "$VMDIR" ]; then + SRC_PATH=`fix_dir_slashes "$SRC_PATH"` SRC_PATH=${SRC_PATH/$VMDIR/$ONE_LOCAL_VAR} fi } @@ -62,6 +77,7 @@ function fix_src_path function fix_dst_path { if [ -n "$VMDIR" ]; then + DST_PATH=`fix_dir_slashes "$DST_PATH"` DST_PATH=${DST_PATH/$VMDIR/$ONE_LOCAL_VAR} fi }