From 8fa377e4e48c2a64cc229cb1d901637f7a90e1e1 Mon Sep 17 00:00:00 2001 From: rhatto Date: Wed, 4 Apr 2007 19:53:35 +0000 Subject: templatepkg: -a fixed git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@233 04377dda-e619-0410-9926-eae83683ac58 --- trunk/src/templatepkg | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/trunk/src/templatepkg b/trunk/src/templatepkg index b0afb3b..c537a52 100755 --- a/trunk/src/templatepkg +++ b/trunk/src/templatepkg @@ -297,7 +297,7 @@ function template_add { cd $cwd info_commit="yes" else - echo Added `slash $jail/$candidate` on $TEMPLATE_BASE.d/$candidate + echo Added `slash $jail/$candidate` on `slash $TEMPLATE_BASE.d/$candidate` fi fi done @@ -311,23 +311,38 @@ function template_add { exit 1 fi else + if [ -a "$jail/$file" ]; then - mkdir -p $TEMPLATE_BASE.d/`dirname $file`/ destination="`echo $TEMPLATE_BASE.d/$file | sed -e 's/\/$//'`" - cp -a $jail/$file $destination + if use_svn && [ -d "$TEMPLATE_BASE.d/.svn" ]; then + + if ! svn_check $TEMPLATE_BASE.d/`dirname $file`; then + mkdir -p $TEMPLATE_BASE.d/`dirname $file`/ + svn add $TEMPLATE_BASE.d/`dirname $file`/ + fi + + cp -a $jail/$file $destination + cwd="`pwd`" cd $TEMPLATE_BASE.d svn add ./$file + if [ "$?" != "0" ]; then echo $BASENAME: error adding `slash $candidate` into the revision system + else + echo $BASENAME: please run jail-commit to add `slash $file` into the svn repository fi + cd $cwd - echo $BASENAME: please run jail-commit to add `slash $file` into the svn repository - true + else - echo Added `slash $jail/$file` on $destination + + mkdir -p $TEMPLATE_BASE.d/`dirname $file`/ + cp -a $jail/$file $destination + echo Added `slash $jail/$file` on `slash $destination` + fi else -- cgit v1.2.3