Merge remote-tracking branch 'origin/fix-issue-128-incexc' into dev
Fix and improve handling of INCLIST and EXCLIST
This commit is contained in:
commit
4fbb5ed190
2 changed files with 12 additions and 5 deletions
|
|
@ -208,6 +208,9 @@ INCLIST=( "/home/foobar_user_name/Documents/" )
|
||||||
# "/**Icon?" \
|
# "/**Icon?" \
|
||||||
# "/**.AppleDouble" \
|
# "/**.AppleDouble" \
|
||||||
# )
|
# )
|
||||||
|
#
|
||||||
|
# If you don't want to exclude anything, use EXCLIST=()
|
||||||
|
#
|
||||||
# Simpler example with one location. Adapt it to your needs.
|
# Simpler example with one location. Adapt it to your needs.
|
||||||
|
|
||||||
EXCLIST=( "/home/foobar_user_name/Documents/foobar-to-exclude" )
|
EXCLIST=( "/home/foobar_user_name/Documents/foobar-to-exclude" )
|
||||||
|
|
|
||||||
|
|
@ -563,7 +563,7 @@ include_exclude()
|
||||||
OLDIFS=$IFS
|
OLDIFS=$IFS
|
||||||
IFS=$(echo -en "\t\n")
|
IFS=$(echo -en "\t\n")
|
||||||
|
|
||||||
# Exlcude device files?
|
# Exclude device files?
|
||||||
if [ ! -z "${EXDEVICEFILES}" ] && [ "${EXDEVICEFILES}" -ne 0 ]; then
|
if [ ! -z "${EXDEVICEFILES}" ] && [ "${EXDEVICEFILES}" -ne 0 ]; then
|
||||||
TMP=" --exclude-device-files"
|
TMP=" --exclude-device-files"
|
||||||
EXCLUDE=${EXCLUDE}${TMP}
|
EXCLUDE=${EXCLUDE}${TMP}
|
||||||
|
|
@ -571,14 +571,18 @@ include_exclude()
|
||||||
|
|
||||||
for include in "${INCLIST[@]}"
|
for include in "${INCLIST[@]}"
|
||||||
do
|
do
|
||||||
TMP=" --include='$include'"
|
if [[ -n "$include" ]]; then
|
||||||
INCLUDE=${INCLUDE}${TMP}
|
TMP=" --include='$include'"
|
||||||
|
INCLUDE=${INCLUDE}${TMP}
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
for exclude in "${EXCLIST[@]}"
|
for exclude in "${EXCLIST[@]}"
|
||||||
do
|
do
|
||||||
TMP=" --exclude '$exclude'"
|
if [[ -n "$exclude" ]]; then
|
||||||
EXCLUDE=${EXCLUDE}${TMP}
|
TMP=" --exclude '$exclude'"
|
||||||
|
EXCLUDE=${EXCLUDE}${TMP}
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Include/Exclude globbing filelist
|
# Include/Exclude globbing filelist
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue