From 5f0970a25815c17d06c0ab80ae683ceb962ccaef Mon Sep 17 00:00:00 2001 From: Bastian Blank Date: Tue, 26 Jan 2016 10:21:07 +0100 Subject: Factor out source exclude specification --- bin/ftpsync | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/bin/ftpsync b/bin/ftpsync index e8aa021..71fa4ad 100755 --- a/bin/ftpsync +++ b/bin/ftpsync @@ -468,21 +468,25 @@ STATS_TOTAL_RSYNC_TIME2=0 EXCLUDE="${EXCLUDE} --exclude=.~tmp~/" SOURCE_EXCLUDE=${SOURCE_EXCLUDE:-""} +SOURCE_EXCLUDE_EXPLICIT= ARCH_EXCLUDE=${ARCH_EXCLUDE:-""} + # Exclude architectures defined in $ARCH_EXCLUDE for ARCH in ${ARCH_EXCLUDE}; do EXCLUDE="${EXCLUDE} --exclude=binary-${ARCH}/ --exclude=installer-${ARCH}/ --exclude=Contents-${ARCH}.gz --exclude=Contents-udeb-${ARCH}.gz --exclude=Contents-${ARCH}.diff/ --exclude=arch-${ARCH}.files --exclude=arch-${ARCH}.list.gz --exclude=*_${ARCH}.deb --exclude=*_${ARCH}.udeb --exclude=*_${ARCH}.changes" if [[ ${ARCH} = source ]]; then - if [[ -z ${SOURCE_EXCLUDE} ]]; then - SOURCE_EXCLUDE=" --exclude=source/ --exclude=*.tar.gz --exclude=*.diff.gz --exclude=*.tar.bz2 --exclude=*.tar.xz --exclude=*.diff.bz2 --exclude=*.dsc " - # Over-ride the exclude=*.tar.gz above - there are some - # tar.gz files in the archive that are *not* source - # files... - SOURCE_EXCLUDE="$SOURCE_EXCLUDE --include=debian-cd_info.tar.gz --include=debian-faq.en.html.tar.gz --include=netboot.tar.gz --include=nfsroot.tar.gz --include=hd-media.tar.gz --include=dedication*.tar.gz" - fi + SOURCE_EXCLUDE_EXPLICIT=1 fi done +if [[ ${SOURCE_EXCLUDE_EXPLICIT} ]] && [[ -z ${SOURCE_EXCLUDE} ]]; then + SOURCE_EXCLUDE=" --exclude=source/ --exclude=*.tar.gz --exclude=*.diff.gz --exclude=*.tar.bz2 --exclude=*.tar.xz --exclude=*.diff.bz2 --exclude=*.dsc " + # Over-ride the exclude=*.tar.gz above - there are some + # tar.gz files in the archive that are *not* source + # files... + SOURCE_EXCLUDE="$SOURCE_EXCLUDE --include=debian-cd_info.tar.gz --include=debian-faq.en.html.tar.gz --include=netboot.tar.gz --include=nfsroot.tar.gz --include=hd-media.tar.gz --include=dedication*.tar.gz" +fi + # Hooks HOOK1=${HOOK1:-""} HOOK2=${HOOK2:-""} -- cgit v1.2.3