From 63a683941f73f8984f613ec59c582bdbdd1868f0 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 14 Aug 2007 15:30:00 +0200 Subject: [PATCH] Pass exclude in a safe way to rsync --- ccollect.sh | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/ccollect.sh b/ccollect.sh index 58cf25b..da2a8e7 100755 --- a/ccollect.sh +++ b/ccollect.sh @@ -104,8 +104,7 @@ no_sources=0 # Create source "array" # while [ "$#" -ge 1 ]; do - eval arg=\"\$1\" - shift + eval arg=\"\$1\"; shift if [ "$NO_MORE_ARGS" = 1 ]; then eval source_${no_sources}=\"$arg\" @@ -143,9 +142,6 @@ done # also export number of sources export no_sources -echo $@, $# -exit - # # be really, really, really verbose # @@ -164,9 +160,9 @@ if [ "$ALL" = 1 ]; then # get entries from sources # cwd=$(pwd -P) - ( cd "${CSOURCES}" && ls > "${TMP}" ) + ( cd "${CSOURCES}" && ls > "${TMP}" ); ret=$? - [ "$?" -eq 0 ] || _exit_err "Listing of sources failed. Aborting." + [ "${ret}" -eq 0 ] || _exit_err "Listing of sources failed. Aborting." while read tmp; do eval source_${no_sources}=\"$tmp\" @@ -332,15 +328,13 @@ while [ "$i" -lt "$no_sources" ]; do # - insert ccollect default parameters # - insert options # - insert user options - + # # exclude list # if [ -f "${c_exclude}" ]; then - # FIXME: check how quoting at the end looks like - # perhaps our source contains spaces! - EXCLUDE="--exclude-from=$c_exclude" + set -- "$@" "--exclude-from=$c_exclude" fi #