]> gitweb.fluxo.info Git - puppet-drupal.git/commitdiff
Process sites just once using a hash on drupal script
authorSilvio Rhatto <rhatto@riseup.net>
Wed, 29 Feb 2012 11:26:01 +0000 (08:26 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Wed, 29 Feb 2012 11:26:01 +0000 (08:26 -0300)
templates/drupal.sh.erb

index d95844d0c61602b02053e5a0a31aea83ef49c3e9..cfe48c075db116c2be40b89fcbdc279261fdc1bd 100644 (file)
@@ -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