From 9af844e5b118009fb25424f5785758712ddee479 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Fri, 10 Sep 2010 16:44:25 +0200 Subject: [PATCH] bug #312: changes to fix_path in nfs tm commands --- src/tm_mad/tm_common.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 }