diff options
Diffstat (limited to 'trunk/lib/common.sh')
-rw-r--r-- | trunk/lib/common.sh | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/trunk/lib/common.sh b/trunk/lib/common.sh index 56b506f..dad6471 100644 --- a/trunk/lib/common.sh +++ b/trunk/lib/common.sh @@ -687,7 +687,7 @@ function svn_copy { fi # copy file - if [ "$(cd $(dirname $orig) ; pwd)" != "$(cd $(dirname $dest) ; pwd)" ]; then + if is_the_same $orig $(dirname $dest); then cp $orig/$file $dest fi @@ -1318,3 +1318,17 @@ function regexp_slash { } +function is_the_same { + + # check if two files are in fact the same + # usage: is_the_same <path1> <path2> + + if [ -e "$1" ] && [ -e "$2" ] && \ + [ "`stat -c '%d' $1`" == "`stat -c '%d' $2`" ] && \ + [ "`stat -c '%i' $1`" == "`stat -c '%i' $2`" ]; then + return 0 + else + return 1 + fi + +} |