]> gitweb.fluxo.info Git - puppet-drupal.git/commitdiff
Enhancing drupal_update
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 15 Nov 2012 13:42:43 +0000 (11:42 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 15 Nov 2012 13:42:43 +0000 (11:42 -0200)
templates/drupal.sh.erb

index 06754c81f06cad0d929bbd272cfb68e2bbcf575d..990e43b1f017614a3f914fb5b23170e98e055921 100644 (file)
@@ -107,15 +107,23 @@ function drupal_update {
   local method="$1"
   local instance="$2"
   local pipe
+  local line
 
   if [ "$method" == "" ]; then
     pipe="--pipe"
   fi
 
   # See https://drupal.org/node/823146#comment-3319070
-  # Also, avoid automated core updates
-  drush -l $instance up -u 1 --pipe | grep -v -E '^drupal|Unknown|Up-to-date|Atualizado|Desconhecido|^Array$|^\($|^\)$|OK' \
-    | cut -d " " -f1 | xargs drush up -u 1 -y $pipe
+  drush -l $instance up -u 1 --pipe | \ 
+    grep -v -E 'Unknown|Up-to-date|Atualizado|Desconhecido|^Array$|^\($|^\)$|OK' | while read line ; do
+    # Avoid automated core updates
+    code="`echo $line | cut -d " " -f1`"
+    if [ "$code" == "drupal" ]; then
+      echo "Core update available: $line"
+    else
+      drush -l $instance up -y -u 1 $pipe $code
+    fi
+  done
 }
 
 # Deploy a fresh drupal tree