aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2012-03-02 17:16:50 -0300
committerSilvio Rhatto <rhatto@riseup.net>2012-03-02 17:16:50 -0300
commit490ac9e0267a2d1674260b696c86aa8f32b99fc4 (patch)
treee5943ccb576fef759ba270bad0ee4941950e56dd
parent6470cef3e3f01e21a038b67c8221a12c8a07b5be (diff)
downloadpuppet-drupal-490ac9e0267a2d1674260b696c86aa8f32b99fc4.tar.gz
puppet-drupal-490ac9e0267a2d1674260b696c86aa8f32b99fc4.tar.bz2
Symlink handling on upgrades
-rw-r--r--templates/drupal.sh.erb11
1 files changed, 10 insertions, 1 deletions
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 .