aboutsummaryrefslogtreecommitdiff
path: root/trunk/lib/common.sh
diff options
context:
space:
mode:
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2008-11-27 20:18:25 +0000
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2008-11-27 20:18:25 +0000
commita45a50fa80e8cab66516a8d280f52ae780aa64c3 (patch)
treee4f05855e8bc72fb2005761978f1ce759d3085f5 /trunk/lib/common.sh
parentda801f1272e8ca3e7f3333cdf32550b68696400d (diff)
downloadsimplepkg-a45a50fa80e8cab66516a8d280f52ae780aa64c3.tar.gz
simplepkg-a45a50fa80e8cab66516a8d280f52ae780aa64c3.tar.bz2
fixes
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@549 04377dda-e619-0410-9926-eae83683ac58
Diffstat (limited to 'trunk/lib/common.sh')
-rw-r--r--trunk/lib/common.sh17
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