diff options
author | rhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58> | 2007-02-12 17:08:52 +0000 |
---|---|---|
committer | rhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58> | 2007-02-12 17:08:52 +0000 |
commit | 3d7f72ccfa6641335ffec2bc6f19cd79cade30fd (patch) | |
tree | 928eefd2beb642c2dab4be51a269f0f470de5294 /trunk/src | |
parent | 50570901c1743d507dd4ca347b161786cab608f0 (diff) | |
download | simplepkg-3d7f72ccfa6641335ffec2bc6f19cd79cade30fd.tar.gz simplepkg-3d7f72ccfa6641335ffec2bc6f19cd79cade30fd.tar.bz2 |
improving svn support in templatepkg
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@187 04377dda-e619-0410-9926-eae83683ac58
Diffstat (limited to 'trunk/src')
-rwxr-xr-x | trunk/src/templatepkg | 25 |
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 |