diff options
-rwxr-xr-x | trunk/src/templatepkg | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/trunk/src/templatepkg b/trunk/src/templatepkg index e337849..3b77b97 100755 --- a/trunk/src/templatepkg +++ b/trunk/src/templatepkg @@ -170,12 +170,16 @@ function template_create { local template_base info_commit orig_template if [ ! -d "`dirname $TEMPLATE_BASE`" ]; then + + echo Creating template `basename $TEMPLATE_BASE`... + if use_svn && [ -d "`dirname $TEMPLATE_BASE`/.svn" ]; then cd `dirname $TEMPLATE_BASE` svn mkdir `dirname $TEMPLATE_BASE` else mkdir -p `dirname $TEMPLATE_BASE` fi + else echo $BASENAME: template `basename $TEMPLATE_BASE` already exists exit 1 @@ -208,6 +212,10 @@ function template_create { info_commit="yes" fi + elif use_svn && [ -d "$BASE_CONF/templates/.svn" ]; then + cd $BASE_CONF/templates + svn add `basename $TEMPLATE_BASE` + info_commit="yes" else mkdir $TEMPLATE_BASE.{d,s} fi @@ -231,8 +239,8 @@ function template_create { if use_svn && [ -d "$orig_template/.svn" ]; then rsync -av --exclude=.svn $orig_template/$ROOT.d/ $TEMPLATE_BASE.d/ - cd `dirname $TEMPLATE_BASE` - svn add $TEMPLATE_BASE.d/* + cd $BASE_CONF/templates + svn add `basename $TEMPLATE_BASE` info_commit="yes" else rsync -av $orig_template/$ROOT.d/ $TEMPLATE_BASE.d/ |