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(-) (limited to 'handlers') 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 From 5ea13f4c240cf4c8c9f96dc424a5a14acc709f51 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 13 Apr 2012 00:31:03 -0300 Subject: Using @SED@ for #3882 --- handlers/rsync.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'handlers') diff --git a/handlers/rsync.in b/handlers/rsync.in index a77da2a..ad8e64f 100644 --- a/handlers/rsync.in +++ b/handlers/rsync.in @@ -277,7 +277,7 @@ function eval_config { mv=move_files fi - excludes=`echo "$exclude" | sed -e 's/^/--exclude=/g' -e 's/ / --exclude=/g'` + excludes=`echo "$exclude" | @SED@ 's/^/--exclude=/g' -e 's/ / --exclude=/g'` } -- cgit v1.2.3 From 39bb9e605f04665f8d838be442d9224745959872 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 13 Apr 2012 09:58:18 -0300 Subject: Trying additional quoting on excludes (upstream #3882) --- handlers/rsync.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'handlers') diff --git a/handlers/rsync.in b/handlers/rsync.in index ad8e64f..3108b37 100644 --- a/handlers/rsync.in +++ b/handlers/rsync.in @@ -277,7 +277,7 @@ function eval_config { mv=move_files fi - excludes=`echo "$exclude" | @SED@ 's/^/--exclude=/g' -e 's/ / --exclude=/g'` + excludes=`echo "$exclude" | @SED@ "s/^/--exclude='/g" -e "s/ /' --exclude='/g" -e "s/$/'/"` } -- cgit v1.2.3