Commit 59e95123 authored by Andreas Tille's avatar Andreas Tille
Browse files

More reliable usage of Files-Excluded

parent e69cf627
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ mv ${ONAME} ${TARDIR}
rm -rf ${TARDIR}/.git
# Remove according to "Files-Excluded"
# Its a bit tricky since '*' needs to be escaped ...
for excl in $(grep "^Files-Excluded" ${COPYRIGHT} | sed -e 's/^Files-Excluded: *//' -e 's/\*/\\*/g') ; do find . -path "$(echo $excl | sed 's/^\\//')" -delete ; done
for excl in $(grep "^Files-Excluded" ${COPYRIGHT} | sed -e 's/^Files-Excluded: */ /' -e 's/ \*/ \\*/g') ; do find . -path "$(echo $excl | sed 's/^\\//')" | xargs rm -rf ; done

GZIP="--best --no-name" tar --owner=root --group=root --mode=a+rX -caf "$NAME"_"$VERSION".orig.tar.${COMPRESS} "${TARDIR}"
rm -rf ${TARDIR}