]> gitweb.fluxo.info Git - simplepkg.git/commitdiff
templatepkg: small fix
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Wed, 4 Apr 2007 13:08:51 +0000 (13:08 +0000)
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Wed, 4 Apr 2007 13:08:51 +0000 (13:08 +0000)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@220 04377dda-e619-0410-9926-eae83683ac58

trunk/src/templatepkg

index f0fb007c8a66afd163e2ee3d202c792d924a3ea0..a8902217856fcb8bb8101a0f4a0a951c6be3b48d 100755 (executable)
@@ -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 svn repository
   # usage: template_export <import|export> <repository>
 
   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 <jail-root> <file>
 
-  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