From: Silvio Rhatto Date: Wed, 29 Feb 2012 11:26:01 +0000 (-0300) Subject: Process sites just once using a hash on drupal script X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=46734d87d868467bec20d8f58450d19217c4d8f4;p=puppet-drupal.git Process sites just once using a hash on drupal script --- diff --git a/templates/drupal.sh.erb b/templates/drupal.sh.erb index d95844d..cfe48c0 100644 --- a/templates/drupal.sh.erb +++ b/templates/drupal.sh.erb @@ -65,8 +65,10 @@ function drupal_iterate { # Issue updates for drupal in $drupals; do if [ -e "$drupal/settings.php" ]; then - # Ignore symlinks so sites are updated just once - if [ ! -h "$drupal" ] || [ ! -h "`readlink $drupal`" ]; then + hash="sha1sum $drupal/settings.php" + # Process sites just once, avoiding symlinks + if echo $settings_hash | grep -q $hash; then + settings_hash="$settings_hash-$hash" if [ "$1" != "cron" ]; then echo "Processing $drupal..." fi