From a45a50fa80e8cab66516a8d280f52ae780aa64c3 Mon Sep 17 00:00:00 2001 From: rhatto Date: Thu, 27 Nov 2008 20:18:25 +0000 Subject: fixes git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@549 04377dda-e619-0410-9926-eae83683ac58 --- trunk/lib/common.sh | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/trunk/lib/common.sh b/trunk/lib/common.sh index 3c0766c..ff92f45 100644 --- a/trunk/lib/common.sh +++ b/trunk/lib/common.sh @@ -780,26 +780,19 @@ function update_md5_checksum { if [ -z "$2" ] || [ ! -d "$1" ] || [ ! -f "$1/$2" ]; then return 1 - fi - - CWD="`pwd`" - cd $1 - - if ! echo $2 | grep -q -e "^\.\/"; then - # add ./ in front of the file name - file="./$1" - elif ! echo $2 | grep -q -e "^\."; then - # add . in front of the file name - file=".$1" else file="$1" + folder="$2" fi + CWD="`pwd`" + cd $folder + if [ ! -f CHECKSUMS.md5 ]; then gen_md5_checksums . else # remove the old entry and add a new one - sed -i "/ $(regexp_slash $file)$/d" CHECKSUMS.md5 + sed -i "/ \.*\/*$(regexp_slash $file)$/d" CHECKSUMS.md5 md5sum $file >> CHECKSUMS.md5 fi -- cgit v1.2.3