]> gitweb.fluxo.info Git - simplepkg.git/commitdiff
templatepkg: -a fixed
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Wed, 4 Apr 2007 19:53:35 +0000 (19:53 +0000)
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Wed, 4 Apr 2007 19:53:35 +0000 (19:53 +0000)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@233 04377dda-e619-0410-9926-eae83683ac58

trunk/src/templatepkg

index b0afb3bc145d1178ef3dec8aaacfcddb0101c381..c537a525ea50de715a93ae16a0b17c1f72920c60 100755 (executable)
@@ -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