]> gitweb.fluxo.info Git - simplepkg.git/commitdiff
templatepkg: small fixes on package_template and create_doinst
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Sat, 7 Apr 2007 19:01:21 +0000 (19:01 +0000)
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Sat, 7 Apr 2007 19:01:21 +0000 (19:01 +0000)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@311 04377dda-e619-0410-9926-eae83683ac58

trunk/src/templatepkg

index a87b361dd0e5d1d6452656f35085ebf1400920d3..64ca8703a72d5f482aa4fc5bb27e1d8947734a34 100755 (executable)
@@ -786,7 +786,7 @@ function create_doinst {
   # create a doinst.sh from a template.perms file
   # usage: create_doinst <doinst-path>
 
-  rm $1/doinst.sh
+  rm -f $1/doinst.sh
 
   if [ -s "$TEMPLATE_BASE.perms" ]; then
     echo Setting jail $1 permissions...
@@ -822,14 +822,20 @@ function package_template {
 
   if [ -z "$1" ]; then
     version="1"
+  else
+    version="$1"
   fi
 
   if [ -z "$2" ]; then
     build="1"
+  else
+    build="$2"
   fi
 
   if [ -z "$3" ]; then
     arch="noarch"
+  else
+    arch="$3"
   fi
 
   TMP=${TMP:=/tmp}
@@ -940,7 +946,7 @@ elif [ "$1" == "-t" ] || [ "$1" == "--template-edit" ]; then
 elif [ "$1" == "-p" ] || [ "$1" == "--pack" ]; then
 
   require $2
-  shift
+  shift ; shift
   package_template $*
 
 elif [ "$1" == "-h" ] || [ "$1" == "--help" ]; then