aboutsummaryrefslogtreecommitdiff
path: root/trunk/src/templatepkg
diff options
context:
space:
mode:
Diffstat (limited to 'trunk/src/templatepkg')
-rwxr-xr-xtrunk/src/templatepkg25
1 files changed, 20 insertions, 5 deletions
diff --git a/trunk/src/templatepkg b/trunk/src/templatepkg
index 914f1aa..d2eea48 100755
--- a/trunk/src/templatepkg
+++ b/trunk/src/templatepkg
@@ -22,9 +22,9 @@ BASENAME="`basename $0`"
if [ -f "$COMMON" ]; then
source $COMMON
- eval_config `basename $0`
+ eval_config $BASENAME
else
- echo "error: file $COMMON found, check your `basename $0` installation"
+ echo "error: file $COMMON found, check your $BASENAME installation"
exit 1
fi
@@ -58,16 +58,22 @@ function usage {
echo ""
echo " in all cases (-c, -u and -a), jail-root defaults to /, if ommited"
echo ""
- exit 1
+ exit
+
+ # TODO: -i | --import
+ # -co | --checkout
+
+ # - importado o /etc/simplepkg/templates
+ # - importado apenas um template
+ # - nao importado nada
}
function template_create {
# create a new template
- # TODO: usar svn add $TEMPLATE_BASE ao inves de svn mkdir, etc?
- local template_base
+ local template_base info_commit
if [ ! -d "$TEMPLATE_BASE" ]; then
if use_svn && [ -d "`dirname $TEMPLATE_BASE`/.svn" ]; then
@@ -87,18 +93,26 @@ function template_create {
if ! svn_check $TEMPLATE.d; then
svn mkdir $TEMPLATE.d
+ info_commit="yes"
fi
if ! svn_check $TEMPLATE.s; then
svn mkdir $TEMPLATE.s
+ info_commit="yes"
fi
if ! svn_check $TEMPLATE.template; then
svn add $TEMPLATE.template
+ info_commit="yes"
fi
if ! svn_check $TEMPLATE.perms; then
svn add $TEMPLATE.perms
+ info_commit="yes"
+ fi
+
+ if [ "$info_commit" == "yes" ]; then
+ echo $BASENAME: please run jail-commit to add files under $file into the svn repository
fi
else
@@ -206,6 +220,7 @@ function template_add {
else
if [ -a "$jail/$file" ]; then
+ # TODO: use svn mkdir if needed
mkdir -p $TEMPLATE_BASE.d/`dirname $file`/
destination="`echo $TEMPLATE_BASE.d/$file | sed -e 's/\/$//'`"
cp -a $jail/$file $destination