]> gitweb.fluxo.info Git - simplepkg.git/commitdiff
Cleanup and bugfix for #94 and #95 (2)
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Sun, 30 Aug 2009 23:38:25 +0000 (23:38 +0000)
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Sun, 30 Aug 2009 23:38:25 +0000 (23:38 +0000)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@813 04377dda-e619-0410-9926-eae83683ac58

trunk/Makefile
trunk/lib/common.sh
trunk/src/createpkg

index 7055dc9b9093fc3af7a75d8df47c904147c02822..766414f4383bede609c5bf0140d7092f37cdc97b 100644 (file)
@@ -15,7 +15,8 @@
 #
 
 PACKAGE = simplepkg
-VERSION = $(shell echo '$$Rev$$' | sed -e 's/[^0-9]//g')_svn
+#VERSION = $(shell echo '$$Rev$$' | sed -e 's/[^0-9]//g')_svn
+VERSION = 812_teste5
 BUILD = 1rha
 PREFIX = /usr
 INSTALL = /usr/bin/install
index f05b2760cf0e4c2648b075285140915bdc5e0cc4..ea4130d7c75778dbd42bf120c0350a768489b1a7 100644 (file)
@@ -60,7 +60,7 @@ function pkg_ext_sed {
   # list all possible package extensions
   # sed regexp version
 
-  echo "($(pkg_ext $1))" | sed -e 's/ /\\|/g'
+  echo "\($(pkg_ext $1)\)" | sed -e 's/ /\\|/g'
 
 }
 
@@ -69,7 +69,7 @@ function pkg_ext_find {
   # list all possible package extensions
   # find expr version
 
-  local match
+  local match exts
 
   if [ ! -z "$1" ]; then
     match="$1"
@@ -77,7 +77,8 @@ function pkg_ext_find {
     match="*"
   fi
 
-  echo "($(pkg_ext $match))" | sed -e 's/ / -or -name /g'
+  exts="`echo "$(pkg_ext $match)" | sed -e 's/ / -or -name /g'`"
+  echo "( -name $exts )"
 
 }
 
@@ -1381,18 +1382,18 @@ function gen_meta {
     file="$1"
   fi
 
-  if [ "`echo $file | grep -E "(.*{1,})\-(.*[\.\-].*[\.\-].*).$(pkg_ext_grep)[ ]{0,}$"`" == "" ]; then
+  if [ "`echo $file | grep -E \"(.*{1,})\-(.*[\.\-].*[\.\-].*).$(pkg_ext_grep)[ ]{0,}$\"`" == "" ]; then
     return
   fi
 
-  NAME=$(echo $file | sed -re "s/(.*\/)(.*.$(pkg_ext_sed))$/\2/")
-  LOCATION=$(echo $file | sed -re "s/(.*)\/(.*.$(pkg_ext_sed))$/\1/")
+  NAME=$(basename $file)
+  LOCATION=$(dirname $file)
   SIZE=$( expr `gunzip -l $file | tail -n 1 | awk '{ print $1 }'` / 1024 )
   USIZE=$( expr `gunzip -l $file | tail -n 1 | awk '{ print $2 }'` / 1024 )
   REQUIRED=$(tar xzfO $file install/slack-required 2>/dev/null | grep -v -e "^#" | xargs -r -iZ echo -n "Z," | sed -e "s/,$//")
   CONFLICTS=$(tar xzfO $file install/slack-conflicts 2>/dev/null | grep -v -e "^#" | xargs -r -iZ echo -n "Z," | sed -e "s/,$//")
   SUGGESTS=$(tar xzfO $file install/slack-suggests 2>/dev/null | grep -v -e "^#" | xargs -r )
-  METAFILE="$(strip_pkg_exp $NAME).meta"
+  METAFILE="$(strip_pkg_ext $NAME).meta"
 
   echo "PACKAGE NAME:  $NAME" > $LOCATION/$METAFILE
 
@@ -1413,7 +1414,7 @@ function gen_meta {
   echo "" >> $LOCATION/$METAFILE
   echo "Created metafile for `basename $file`"
 
-  ( cd `dirname $file` && svn_add `strip_pkg_exp $file`.meta )
+  ( cd `dirname $file` && svn_add `strip_pkg_ext $file`.meta )
 
 }
 
index 65af714069e38cb333ad2f949b6f30b9a8d8e301..584e2e7f8d02e0b920ec8915b59b77f8c197a79c 100644 (file)
@@ -451,7 +451,7 @@ function remove_old_package_data {
 
     else
       # Using -mindepth 2 so it doesn't delete the new package
-      find $makepkg_repos -mindepth 2 $(package_ext_find $PACKAGE-*-*-*) -exec rm {} 2>/dev/null \;
+      find $makepkg_repos -mindepth 2 $(pkg_ext_find $PACKAGE-*-*-*) -exec rm {} 2>/dev/null \;
       find $makepkg_repos -mindepth 2 -name "$PACKAGE-*-*-*.meta" -exec rm {} 2>/dev/null \;
       find $makepkg_repos -mindepth 2 -name "$PACKAGE-*-*-*.*.asc" -exec rm {} 2>/dev/null \;
       find $makepkg_repos -name "$PACKAGE.slack-required" -exec rm {} 2>/dev/null \;
@@ -486,7 +486,7 @@ function update_metadata {
 
     found_patch="no"
 
-    for file in `find patches/ $(package_ext_find $PACKAGE-*-*-*)`; do
+    for file in `find patches/ $(pkg_ext_find $PACKAGE-*-*-*)`; do
       found_patch="yes"
       update_md5_checksum $makepkg_repos/patches patches/$SUBFOLDER/$PKG_NAME
     done
@@ -513,7 +513,7 @@ function list_packages {
 
   for repository in $repositories; do
     echo "Packages from $repository..."
-    find $repository $(package_ext_find)
+    find $repository $(pkg_ext_find)
   done
 
 }
@@ -539,7 +539,7 @@ function remove_package {
 
       cd $repository
 
-      for file in `find . $(package_ext_find $package-*-*-*) -o -name "$package-*-*-*.meta" -o -name "$package-*-*-*.*.asc"`; do
+      for file in `find . $(pkg_ext_find $package-*-*-*) -o -name "$package-*-*-*.meta" -o -name "$package-*-*-*.*.asc"`; do
         svn_del $file
         if [ -e "CHECKSUMS.md5" ] && echo $file | grep -q -E -e "$(pkg_ext_grep)$"; then
           # remove md5 information