From 233795e6dc987c6cdaf51ed10a82d57532013dfe Mon Sep 17 00:00:00 2001 From: rhatto Date: Wed, 4 Apr 2007 13:08:51 +0000 Subject: templatepkg: small fix git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@220 04377dda-e619-0410-9926-eae83683ac58 --- trunk/src/templatepkg | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'trunk') diff --git a/trunk/src/templatepkg b/trunk/src/templatepkg index f0fb007..a890221 100755 --- a/trunk/src/templatepkg +++ b/trunk/src/templatepkg @@ -93,7 +93,7 @@ function check_svn_repo { function import_export_templates { - # import from or export to $BASE_CONF in svn repository + # import from or export to $BASE_CONF in a svn repository # usage: template_export local templates_folder basedir repository mode preposition @@ -211,7 +211,7 @@ function template_update { # update the template package list - components="$TEMPLATE.template $TEMPLATE.perms $TEMPLATE.d $TEMPLATE.s" + components="$TEMPLATE_BASE.template $TEMPLATE_BASE.perms $TEMPLATE_BASE.d $TEMPLATE_BASE.s" for component in $components; do if [ ! -a "$component" ]; then echo $BASENAME: template component not found: $component @@ -268,7 +268,7 @@ function template_add { # add a file in a template # usage: template_add - local info_commit + local info_commit cwd mkdir -p $TEMPLATE_BASE.d @@ -290,9 +290,13 @@ function template_add { mkdir -p $TEMPLATE_BASE.d/`dirname $candidate` cp -a $jail/$candidate $TEMPLATE_BASE.d/$candidate if use_svn && [ -d "$TEMPLATE_BASE.d/.svn" ]; then + cwd="`pwd`" cd $TEMPLATE_BASE.d svn add ./$candidate - # TODO: error checking + if [ "$?" != "0" ]; then + echo $BASENAME: error adding $candidate into the revision system + fi + cd $cwd info_commit="yes" else echo Added $jail/$candidate on $TEMPLATE_BASE.d/$candidate @@ -315,9 +319,13 @@ function template_add { destination="`echo $TEMPLATE_BASE.d/$file | sed -e 's/\/$//'`" cp -a $jail/$file $destination if use_svn && [ -d "$TEMPLATE_BASE.d/.svn" ]; then + cwd="`pwd`" cd $TEMPLATE_BASE.d svn add ./$file - # TODO: error checking + if [ "$?" != "0" ]; then + echo $BASENAME: error adding $candidate into the revision system + fi + cd $cwd echo $BASENAME: please run jail-commit to add $file into the svn repository true else -- cgit v1.2.3