]> gitweb.fluxo.info Git - puppet-drupal.git/commitdiff
Adding drupal_check_not_existing to drupal script
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 28 Oct 2011 15:24:50 +0000 (13:24 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 28 Oct 2011 15:24:50 +0000 (13:24 -0200)
templates/drupal.sh.erb

index 7963dcf582a8099b106af3dc193bd89310ce78c1..8ac6b9e74996aa43359e55b860cbed73a817c4a8 100644 (file)
@@ -40,6 +40,14 @@ function drupal_check_existing {
   fi  
 }
 
+# Check for non existing installations
+function drupal_check_not_existing {
+  if [ ! -e "$BASE/drupal-$1" ]; then
+    echo "Folder $BASE/drupal-$1 does not exist, skipping"
+    exit 1
+  fi  
+}
+
 # Iterate through all drupal instances
 function drupal_iterate {
   for version in $SERIES; do
@@ -104,7 +112,7 @@ function drupal_deploy {
   fi
 }
 
-# Upgrade a drupal instance using upstream source.
+# Upgrade a drupal instance using upstream source
 function drupal_upgrade {
   if [ "$#" != "2" ]; then
     echo "Usage: `basename $0` upgrade <old_version> <new_version>"
@@ -124,6 +132,7 @@ function drupal_upgrade {
   fi
 
   drupal_check_existing $new
+  drupal_check_not_existing $old
   
   # Set drupal series
   if [ "$new_major" == "4" ]; then