Revision 9af844e5 src/tm_mad/tm_common.sh

View differences:

src/tm_mad/tm_common.sh
42 42
function get_vmdir
43 43
{
44 44
    VMDIR=`grep '^VM_DIR=' $ONE_LOCAL_VAR/config | cut -d= -f2`
45
    fix_var_slashes
46
}
47

  
48
function fix_dir_slashes
49
{
50
    dirname "$1/file" | sed -E 's/\/+/\//g'
51
}
52

  
53
function fix_var_slashes
54
{
55
    ONE_LOCAL_VAR=`fix_dir_slashes "$ONE_LOCAL_VAR"`
56
    VMDIR=`fix_dir_slashes "$VMDIR"`
45 57
}
46 58

  
47 59
function fix_paths
48 60
{
49 61
    if [ -n "$VMDIR" ]; then
62
        SRC_PATH=`fix_dir_slashes "$SRC_PATH"`
50 63
        SRC_PATH=${SRC_PATH/$VMDIR/$ONE_LOCAL_VAR}
64
        DST_PATH=`fix_dir_slashes "$DST_PATH"`
51 65
        DST_PATH=${DST_PATH/$VMDIR/$ONE_LOCAL_VAR}
52 66
    fi
53 67
}
......
55 69
function fix_src_path
56 70
{
57 71
    if [ -n "$VMDIR" ]; then
72
        SRC_PATH=`fix_dir_slashes "$SRC_PATH"`
58 73
        SRC_PATH=${SRC_PATH/$VMDIR/$ONE_LOCAL_VAR}
59 74
    fi
60 75
}
......
62 77
function fix_dst_path
63 78
{
64 79
    if [ -n "$VMDIR" ]; then
80
        DST_PATH=`fix_dir_slashes "$DST_PATH"`
65 81
        DST_PATH=${DST_PATH/$VMDIR/$ONE_LOCAL_VAR}
66 82
    fi
67 83
}

Also available in: Unified diff