From b9948b3ae90bc47897071afdbf48f26ef67083a7 Mon Sep 17 00:00:00 2001 From: rhatto Date: Wed, 17 Dec 2008 16:27:50 +0000 Subject: createpkg: package signature; simplaret: enhanced signature checking git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@669 04377dda-e619-0410-9926-eae83683ac58 --- trunk/lib/common.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'trunk/lib') 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 + + 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 + +} -- cgit v1.2.3