Merge remote-tracking branch 'origin/fix-issue-128-incexc' into dev

Fix and improve handling of INCLIST and EXCLIST
This commit is contained in:
zertrin 2016-09-03 15:41:56 +02:00
commit 4fbb5ed190
2 changed files with 12 additions and 5 deletions

View file

@ -208,6 +208,9 @@ INCLIST=( "/home/foobar_user_name/Documents/" )
# "/**Icon?" \
# "/**.AppleDouble" \
# )
#
# If you don't want to exclude anything, use EXCLIST=()
#
# Simpler example with one location. Adapt it to your needs.
EXCLIST=( "/home/foobar_user_name/Documents/foobar-to-exclude" )

View file

@ -563,7 +563,7 @@ include_exclude()
OLDIFS=$IFS
IFS=$(echo -en "\t\n")
# Exlcude device files?
# Exclude device files?
if [ ! -z "${EXDEVICEFILES}" ] && [ "${EXDEVICEFILES}" -ne 0 ]; then
TMP=" --exclude-device-files"
EXCLUDE=${EXCLUDE}${TMP}
@ -571,14 +571,18 @@ include_exclude()
for include in "${INCLIST[@]}"
do
TMP=" --include='$include'"
INCLUDE=${INCLUDE}${TMP}
if [[ -n "$include" ]]; then
TMP=" --include='$include'"
INCLUDE=${INCLUDE}${TMP}
fi
done
for exclude in "${EXCLIST[@]}"
do
TMP=" --exclude '$exclude'"
EXCLUDE=${EXCLUDE}${TMP}
if [[ -n "$exclude" ]]; then
TMP=" --exclude '$exclude'"
EXCLUDE=${EXCLUDE}${TMP}
fi
done
# Include/Exclude globbing filelist