From aa8d0f864830036e12e52696243c05df76d678e2 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 12 Apr 2012 21:29:57 -0300 Subject: Quoting $exclude and $excludes and avoiding a for loop on $exclude to not expand wildcards in beforehand (upstream #3882) --- handlers/rsync.in | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/handlers/rsync.in b/handlers/rsync.in index e253c5c..a77da2a 100644 --- a/handlers/rsync.in +++ b/handlers/rsync.in @@ -277,9 +277,7 @@ function eval_config { mv=move_files fi - for path in $exclude; do - excludes="$excludes --exclude=$path" - done + excludes=`echo "$exclude" | sed -e 's/^/--exclude=/g' -e 's/ / --exclude=/g'` } @@ -1113,8 +1111,8 @@ for SECTION in $include; do set_dest info "Syncing $SECTION on $dest_path..." - debug $nice $rsync "${rsync_options[@]}" $filelist_flag $excludes $batch_option $orig $dest_path - $nice $rsync "${rsync_options[@]}" $filelist_flag $excludes $batch_option $orig $dest_path | tee -a $log + debug $nice $rsync "${rsync_options[@]}" $filelist_flag "$excludes" $batch_option $orig $dest_path + $nice $rsync "${rsync_options[@]}" $filelist_flag "$excludes" $batch_option $orig $dest_path | tee -a $log if [ "$?" != "0" ]; then fatal "Rsync error when trying to transfer $SECTION" -- cgit v1.2.3