aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2012-02-29 08:26:01 -0300
committerSilvio Rhatto <rhatto@riseup.net>2012-02-29 08:26:01 -0300
commit46734d87d868467bec20d8f58450d19217c4d8f4 (patch)
treedec86a66370b0fc5928d81d5e37216ae76b59b5d
parent2ed9b368bf07789bb5c537ddbe863998ff91e8a9 (diff)
downloadpuppet-drupal-46734d87d868467bec20d8f58450d19217c4d8f4.tar.gz
puppet-drupal-46734d87d868467bec20d8f58450d19217c4d8f4.tar.bz2
Process sites just once using a hash on drupal script
-rw-r--r--templates/drupal.sh.erb6
1 files changed, 4 insertions, 2 deletions
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