mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-22 18:50:08 +03:00
Bug #312: fix_paths is only run if VMDIR and VAR dir are different
This commit is contained in:
parent
b8812bcf18
commit
fd8b1db099
@ -45,6 +45,8 @@ function get_vmdir
|
||||
fix_var_slashes
|
||||
}
|
||||
|
||||
# Takes out uneeded slashes. Repeated and final directory slashes:
|
||||
# /some//path///somewhere/ -> /some/path/somewhere
|
||||
function fix_dir_slashes
|
||||
{
|
||||
dirname "$1/file" | sed -E 's/\/+/\//g'
|
||||
@ -58,7 +60,7 @@ function fix_var_slashes
|
||||
|
||||
function fix_paths
|
||||
{
|
||||
if [ -n "$VMDIR" ]; then
|
||||
if [ "x$ONE_LOCAL_VAR" != "x$VMDIR" ]; then
|
||||
SRC_PATH=`fix_dir_slashes "$SRC_PATH"`
|
||||
SRC_PATH=${SRC_PATH/$VMDIR/$ONE_LOCAL_VAR}
|
||||
DST_PATH=`fix_dir_slashes "$DST_PATH"`
|
||||
@ -68,7 +70,7 @@ function fix_paths
|
||||
|
||||
function fix_src_path
|
||||
{
|
||||
if [ -n "$VMDIR" ]; then
|
||||
if [ "x$ONE_LOCAL_VAR" != "x$VMDIR" ]; then
|
||||
SRC_PATH=`fix_dir_slashes "$SRC_PATH"`
|
||||
SRC_PATH=${SRC_PATH/$VMDIR/$ONE_LOCAL_VAR}
|
||||
fi
|
||||
@ -76,7 +78,7 @@ function fix_src_path
|
||||
|
||||
function fix_dst_path
|
||||
{
|
||||
if [ -n "$VMDIR" ]; then
|
||||
if [ "x$ONE_LOCAL_VAR" != "x$VMDIR" ]; then
|
||||
DST_PATH=`fix_dir_slashes "$DST_PATH"`
|
||||
DST_PATH=${DST_PATH/$VMDIR/$ONE_LOCAL_VAR}
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user