From 10d88faa8b4f08d4f9a572ad22a2065cc03410b9 Mon Sep 17 00:00:00 2001 From: rhatto Date: Fri, 5 Dec 2008 02:13:19 +0000 Subject: fix on template_add git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@640 04377dda-e619-0410-9926-eae83683ac58 --- trunk/src/templatepkg | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'trunk/src/templatepkg') diff --git a/trunk/src/templatepkg b/trunk/src/templatepkg index d079902..3f0284a 100755 --- a/trunk/src/templatepkg +++ b/trunk/src/templatepkg @@ -494,17 +494,20 @@ function template_add { if templates_under_svn && [ -d "`template_files`/.svn" ]; then candidate="./`dirname $file`" - mkdir -p `template_files`/$candidate - cd `template_files`/$candidate - while true; do - if [ -d ".svn" ]; then - svn add `basename $candidate` - break - else - candidate="`basename $(pwd)`" - cd .. - fi - done + + if [ ! -d "`template_files`/$candidate/.svn" ]; then + mkdir -p `template_files`/$candidate + cd `template_files`/`dirname $candidate` + while true; do + if [ -d ".svn" ]; then + svn add `basename $candidate` + break + else + candidate="`basename $(pwd)`" + cd .. + fi + done + fi cp -a $jail/$file $destination -- cgit v1.2.3