create_tarball: Fix excluded items processing.

The list of items to the tarball package is now passed as output from
find and therefore does not work using --exclude option for tar. Items
that is desirable to exclude are now removed from the list using grep.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit eecedb7d61)
v3.5.13-sru
Slávek Banko 3 years ago
parent 0992dec16c
commit 33cafd4f12
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -159,13 +159,14 @@ if [ ! -e $TARBALL_DIR/$package.tar$TAR_SUFFIX ]; then
echo "Revision: $branch-$(git rev-parse HEAD)" >> .tdescminfo
date +"DateTime: %m/%d/%Y %H:%M" -u -d "@$(git log -1 --pretty=format:"%ct")" >> .tdescminfo
trap "rm $TARBALL_DIR/tar-$$; rm .tdescminfo; exit 1" INT
find ./ -print0 | LC_ALL=C sort -z | \
find ./ | LC_ALL=C sort | \
egrep -v '(^|/)(\.git|\.gitmodules)(/|$)' | tr "\n" "\0" | \
tar c --no-recursion --null -T - \
--mode=u+rw,go=rX,a-s \
--owner=root --group=users \
--mtime "@$(git log -1 --pretty=format:"%ct")" \
--owner=root --group=users --exclude .git --exclude .gitmodules \
--pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime \
--transform "s|^\.\(/\|$\)|$package\1|" ./ | \
--transform "s|^\.\(/\|$\)|$package\1|" | \
$COMPRESS -9 >$TARBALL_DIR/tar-$$ && \
mv $TARBALL_DIR/tar-$$ $TARBALL_DIR/$package.tar$TAR_SUFFIX || \
rm $TARBALL_DIR/tar-$$

Loading…
Cancel
Save