Pass exclude in a safe way to rsync
This commit is contained in:
parent
c042479097
commit
63a683941f
1 changed files with 5 additions and 11 deletions
14
ccollect.sh
14
ccollect.sh
|
@ -104,8 +104,7 @@ no_sources=0
|
||||||
# Create source "array"
|
# Create source "array"
|
||||||
#
|
#
|
||||||
while [ "$#" -ge 1 ]; do
|
while [ "$#" -ge 1 ]; do
|
||||||
eval arg=\"\$1\"
|
eval arg=\"\$1\"; shift
|
||||||
shift
|
|
||||||
|
|
||||||
if [ "$NO_MORE_ARGS" = 1 ]; then
|
if [ "$NO_MORE_ARGS" = 1 ]; then
|
||||||
eval source_${no_sources}=\"$arg\"
|
eval source_${no_sources}=\"$arg\"
|
||||||
|
@ -143,9 +142,6 @@ done
|
||||||
# also export number of sources
|
# also export number of sources
|
||||||
export no_sources
|
export no_sources
|
||||||
|
|
||||||
echo $@, $#
|
|
||||||
exit
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# be really, really, really verbose
|
# be really, really, really verbose
|
||||||
#
|
#
|
||||||
|
@ -164,9 +160,9 @@ if [ "$ALL" = 1 ]; then
|
||||||
# get entries from sources
|
# get entries from sources
|
||||||
#
|
#
|
||||||
cwd=$(pwd -P)
|
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
|
while read tmp; do
|
||||||
eval source_${no_sources}=\"$tmp\"
|
eval source_${no_sources}=\"$tmp\"
|
||||||
|
@ -338,9 +334,7 @@ while [ "$i" -lt "$no_sources" ]; do
|
||||||
# exclude list
|
# exclude list
|
||||||
#
|
#
|
||||||
if [ -f "${c_exclude}" ]; then
|
if [ -f "${c_exclude}" ]; then
|
||||||
# FIXME: check how quoting at the end looks like
|
set -- "$@" "--exclude-from=$c_exclude"
|
||||||
# perhaps our source contains spaces!
|
|
||||||
EXCLUDE="--exclude-from=$c_exclude"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in a new issue