]> gitweb.fluxo.info Git - simplepkg.git/commitdiff
some fixes
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Fri, 6 Apr 2007 20:03:24 +0000 (20:03 +0000)
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Fri, 6 Apr 2007 20:03:24 +0000 (20:03 +0000)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@295 04377dda-e619-0410-9926-eae83683ac58

trunk/src/jail-commit
trunk/src/jail-update
trunk/src/templatepkg
trunk/utils/convert-template-scheme [new file with mode: 0755]

index f3d5f05113d61094bf19f50a14fc25e122b8d879..b17a529c607e73de2fee9afd83da94f2a37b6f85 100755 (executable)
@@ -123,7 +123,8 @@ function do_commit {
   fi
 
   search_template $template --update
-  if [ "$?" == "0" ]; then
+  if [ "$?" == "0" ] || ! echo $TEMPLATE_UPDATE_LIST | grep -q " `dirname $TEMPLATE_BASE` "; then
+    TEMPLATE_UPDATE_LIST="$TEMPLATE_UPDATE_LIST `dirname $TEMPLATE_BASE` " # the end space is important
     if [ "$jailpath" == "/" ]; then
       echo Updating main installation...
     else
@@ -137,6 +138,8 @@ function do_commit {
 
 }
 
+TEMPLATE_UPDATE_LIST=""
+
 if [ "$1" == "--help" ]; then
   usage
 elif [ "$1" == "--all" ]; then
@@ -147,7 +150,7 @@ elif [ ! -z "$1" ]; then
   do_commit $1 $2
   template_svn_commit `dirname $TEMPLATE_BASE`
 else
-  if [ -f $JAIL_LIST ]; then
+  if [ -e $JAIL_LIST ]; then
     for jailpath in `cat $JAIL_LIST`; do
       do_commit $jailpath
     done
index 8cfc49af636a80c3ac1e239d7aec5f2b045f69b5..c5a008fc5a114914207223c75ef1644a2dda3017 100755 (executable)
@@ -50,6 +50,9 @@ search_template $template_name --update
 if [ "$?" != "0" ]; then
   echo $BASENAME: template $template_name not found
   exit 1
+elif [ ! -d "$1" ]; then
+  echo $BASENAME: jail $1 not found
+  exit 1
 fi
 
 update_template_files
index 69b4510b1935941fd28437b0f9d86d52c2f15c60..df6467fb48075353716812828e14cc17f246416b 100755 (executable)
@@ -86,7 +86,9 @@ function usage {
   echo ""
   exit
 
-  # TODO: opcao para apagar script de pos-instalacao
+  # TODO: opcao para apagar script de pos-instalacao ou integrar no -d
+  # TODO: opcao para criar um pacote a partir de um template
+  # TODO: TEMPLATE_FOLDER
 
 }
 
@@ -567,6 +569,8 @@ function template_list {
   # list templates
   # usage: template_list [template_name]
 
+  # TODO: considerar outros valores de TEMPLATE_STORAGE_STYLE
+
   local list basedir template
 
   if echo $1 | grep -q "/" || [ ! -z "$1" ]; then
diff --git a/trunk/utils/convert-template-scheme b/trunk/utils/convert-template-scheme
new file mode 100755 (executable)
index 0000000..319d215
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash
+#
+# script for converting simplepkg templates
+# to the 0.5 own-folder format
+#
+
+cwd="/etc/simplepkg"
+cd $cwd
+
+for file in `ls *.template`; do
+  cd $cwd  
+  template="`echo $file | cut -d . -f 1`"
+  mkdir templates/$template
+  mv $template.d templates/$template/
+  mv $template.s templates/$templates/
+  mv $template.template templates/$template/
+  cd templates/$template/$template.s
+  # optional step
+  # if [ "$template" != "vserver" ]; then
+  #   ln -sf ../../../defaults/templatesvserver/vserver.s/vserver.sh
+  # fi
+done
+