]> gitweb.fluxo.info Git - backupninja.git/commitdiff
Mangle rsync_options just after all other options were evaluated (#3702)
authorSilvio Rhatto <rhatto@riseup.net>
Sat, 24 Dec 2011 13:35:06 +0000 (11:35 -0200)
committerintrigeri <intrigeri@boum.org>
Sat, 31 Dec 2011 21:05:50 +0000 (22:05 +0100)
ChangeLog
handlers/rsync.in

index e1ac76d485a5a7e9e2b56a1ff11b1b89d72206c7..fa319b82c0ae46d808e9c9d990ecda0d79debeb3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@ version 1.0 -- UNRELEASED
     handler changes
        rysnc:
         . Fix numericids option (Redmine#3691).
+        . Mangle $rsync_options just afterwards (Redmine#3702).
        dup:
         . Make the .dup generated by ninjahelper more consistent with
           example.dup.
index 45b9b31f5d6409dfaf162316ae93913723b61842..a17afbdf223d1d8677967e54126b7d141016f9d6 100644 (file)
@@ -893,7 +893,7 @@ function set_rsync_options {
 
   if [ "$from" == "local" ] || [ "$dest" == "local" ]; then
     # rsync options for local sources or destinations
-    rsync_options=($rsync_options)
+    true
   fi
 
   if [ "$from" == "remote" ] || [ "$dest" == "remote" ]; then
@@ -912,8 +912,6 @@ function set_rsync_options {
       remote_rsync="$remote_rsync --fake-super"
     fi
 
-    rsync_options=($rsync_options --rsync-path="$remote_rsync")
-
     if [ "$protocol" == "ssh" ]; then
       if [ ! -e "$id_file" ]; then
         fatal "SSH Identity file $id_file not found"
@@ -927,6 +925,14 @@ function set_rsync_options {
 
   fi
 
+  # Mangle rsync_options so we can use quotes after all other
+  # options were evaluated.
+  if [ "$from" == "local" ] && [ "$dest" == "local" ]; then
+    rsync_options=($rsync_options)
+  else
+    rsync_options=($rsync_options --rsync-path="$remote_rsync")
+  fi
+
   include_vservers
 
 }