diff options
Diffstat (limited to 'trunk')
-rw-r--r-- | trunk/lib/common.sh | 17 |
1 files 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 |