create_tarball: Convert to UTC the date of the last commit,

which is written to '.tdescminfo'.

Because formatting a date using 'git log' does not return results in UTC,
the unix timestamp is used for git log, and conversion to UTC is done
using 'date'.

It addresses time zone independence to ensure a reproducible build.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/3/head
Slávek Banko 4 years ago
parent 9db84075a0
commit 517a783020
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -150,7 +150,7 @@ if [ ! -e $TARBALL_DIR/$package.tar$TAR_SUFFIX ]; then
echo "# TDE SCM module information" > .tdescminfo echo "# TDE SCM module information" > .tdescminfo
echo "Name: $MODULE" >> .tdescminfo echo "Name: $MODULE" >> .tdescminfo
echo "Revision: $branch-$(git rev-parse HEAD)" >> .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 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 trap "rm $TARBALL_DIR/tar-$$; rm .tdescminfo; exit 1" INT
find ./ -print0 | LC_ALL=C sort -z | \ find ./ -print0 | LC_ALL=C sort -z | \
tar c --no-recursion --null -T - \ tar c --no-recursion --null -T - \

Loading…
Cancel
Save