summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2021-12-29 01:51:39 +0100
committerSlávek Banko <slavek.banko@axis.cz>2021-12-29 01:54:19 +0100
commit63362e50371eecbc0a35a00811f97804017b3f3d (patch)
tree159487c9906c12ea5ee2faf4666cf5ba89a4a699
parentd45dd62365049b0425e617df1e2d2a7f1d83bc14 (diff)
downloadscripts-r14.0.12.tar.gz
scripts-r14.0.12.zip
create_tarball: Fix excluded items processing.r14.0.12
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 eecedb7d6141478bebff53ad3e5f0f822e34595e)
-rwxr-xr-xcreate_tarball7
1 files changed, 4 insertions, 3 deletions
diff --git a/create_tarball b/create_tarball
index 62abb6d..166cf0d 100755
--- a/create_tarball
+++ b/create_tarball
@@ -152,13 +152,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-$$