create_tarball: Create one .tdescminfo file containing all the data,

including the git repository date, instead of individual .tdescm* files.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/2/head
Slávek Banko 5 years ago
parent 065e9e0936
commit 5c39eb0954
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -144,14 +144,16 @@ fi
echo "Package name: $package"
if [ ! -e $TARBALL_DIR/$package.tar.$TAR_SUFFIX ]; then
echo "Creating tarball in $TARBALL_DIR."
echo $MODULE > .tdescmmodule
echo $branch-$(git rev-parse HEAD) > .tdescmrevision
trap "rm $TARBALL_DIR/tar-$$; rm .tdescmmodule .tdescmrevision; exit 1" INT
echo "# TDE SCM module information" > .tdescminfo
echo "Name: $MODULE" >> .tdescminfo
echo "Revision: $branch-$(git rev-parse HEAD)" >> .tdescminfo
git log -1 --pretty=format:"DateTime: %cd%n" --date=format:"%m/%d/%Y %H:%M" >> .tdescminfo
trap "rm $TARBALL_DIR/tar-$$; rm .tdescminfo; exit 1" INT
tar c --owner=root --group=users --exclude .git --exclude .gitmodules --transform "s|^\.\(/\|$\)|$package\1|" ./ | \
$COMPRESS -9 >$TARBALL_DIR/tar-$$ && \
mv $TARBALL_DIR/tar-$$ $TARBALL_DIR/$package.tar.$TAR_SUFFIX || \
rm $TARBALL_DIR/tar-$$
rm .tdescmmodule .tdescmrevision
rm .tdescminfo
else
echo "Unchanged tarball in $TARBALL_DIR."
exit 2

Loading…
Cancel
Save