aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2007-04-06 20:03:24 +0000
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2007-04-06 20:03:24 +0000
commit005c11c828bec5a42ca4a083cb8a38ba9beff7a3 (patch)
tree963a812d9aad44423dddf1c9d131246fe6261ee7
parent8f8b9cb92e8a557e077e77400c49193d5e84e074 (diff)
downloadsimplepkg-005c11c828bec5a42ca4a083cb8a38ba9beff7a3.tar.gz
simplepkg-005c11c828bec5a42ca4a083cb8a38ba9beff7a3.tar.bz2
some fixes
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@295 04377dda-e619-0410-9926-eae83683ac58
-rwxr-xr-xtrunk/src/jail-commit7
-rwxr-xr-xtrunk/src/jail-update3
-rwxr-xr-xtrunk/src/templatepkg6
-rwxr-xr-xtrunk/utils/convert-template-scheme23
4 files changed, 36 insertions, 3 deletions
diff --git a/trunk/src/jail-commit b/trunk/src/jail-commit
index f3d5f05..b17a529 100755
--- a/trunk/src/jail-commit
+++ b/trunk/src/jail-commit
@@ -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
diff --git a/trunk/src/jail-update b/trunk/src/jail-update
index 8cfc49a..c5a008f 100755
--- a/trunk/src/jail-update
+++ b/trunk/src/jail-update
@@ -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
diff --git a/trunk/src/templatepkg b/trunk/src/templatepkg
index 69b4510..df6467f 100755
--- a/trunk/src/templatepkg
+++ b/trunk/src/templatepkg
@@ -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
index 0000000..319d215
--- /dev/null
+++ b/trunk/utils/convert-template-scheme
@@ -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
+