From: Silvio Rhatto Date: Fri, 2 Mar 2012 20:16:50 +0000 (-0300) Subject: Symlink handling on upgrades X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=490ac9e0267a2d1674260b696c86aa8f32b99fc4;p=puppet-drupal.git Symlink handling on upgrades --- diff --git a/templates/drupal.sh.erb b/templates/drupal.sh.erb index f2596ab..cd633c8 100644 --- a/templates/drupal.sh.erb +++ b/templates/drupal.sh.erb @@ -162,7 +162,16 @@ function drupal_upgrade { cd $BASE/drupal-$new # Copy files - cp -Rp ../drupal-$old/{.htaccess,favicon.ico,files/,sites/} . &> /dev/null + for file in .htaccess favicon.ico files sites; do + if [ ! -h "../drupal-$old/$file" ]; then + cp -a ../drupal-$old/$file . &> /dev/null + else + # Symlink handling + ln -sf $file `readlink ../drupal-$old/$file` + fi + done + + # Extra folder for extra_folder in $extra_folders; do if [ -d ../drupal-$old/$extra_folder ]; then cp -Rp ../drupal-$old/$extra_folder .