diff --git a/src/image_mad/remotes/fs/mv b/src/image_mad/remotes/fs/mv index efebe2a455..28cf682d1c 100755 --- a/src/image_mad/remotes/fs/mv +++ b/src/image_mad/remotes/fs/mv @@ -54,8 +54,11 @@ http://*) *) log "Moving local image $SRC to the image repository" - exec_and_log "mv -f $SRC $DST" \ - "Could not move $SRC to $DST" + if [ \( -L $SRC \) -a \( "`$READLINK $SRC`" = "$DST" \) ] ; then + log "Not moving files to image repo, they are the same" + else + exec_and_log "mv -f $SRC $DST" "Could not move $SRC to $DST" + fi ;; esac diff --git a/src/mad/sh/scripts_common.sh b/src/mad/sh/scripts_common.sh index 2af7a3105c..6cfaec0477 100755 --- a/src/mad/sh/scripts_common.sh +++ b/src/mad/sh/scripts_common.sh @@ -32,6 +32,7 @@ SED=/bin/sed SSH=/usr/bin/ssh SUDO=/usr/bin/sudo WGET=/usr/bin/wget +READLINK=/bin/readlink # Used for log messages SCRIPT_NAME=`basename $0`