]> gitweb.fluxo.info Git - puppet-drupal.git/commitdiff
Symlink handling on upgrades
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 2 Mar 2012 20:16:50 +0000 (17:16 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 2 Mar 2012 20:16:50 +0000 (17:16 -0300)
templates/drupal.sh.erb

index f2596abf340ae5e9bbe608b0d4ec8ab75c4487e3..cd633c8ec34dd747b52dfee93050518480715c24 100644 (file)
@@ -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 .