]> gitweb.fluxo.info Git - simplepkg.git/commitdiff
fixes
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Thu, 27 Nov 2008 20:18:25 +0000 (20:18 +0000)
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Thu, 27 Nov 2008 20:18:25 +0000 (20:18 +0000)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@549 04377dda-e619-0410-9926-eae83683ac58

trunk/lib/common.sh

index 3c0766c1a5b2c5f1b82716d476ecdc7c3415940a..ff92f45c093f105e449d8c6da761e73b8dc337a6 100644 (file)
@@ -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