summaryrefslogtreecommitdiffstats
path: root/create_tarball
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2020-12-06 15:41:30 +0100
committerSlávek Banko <slavek.banko@axis.cz>2020-12-06 15:53:57 +0100
commit517a78302072e0b2a55a65a4811bc90fbba42e08 (patch)
tree27157f9a8a298e513c900d5241e0e56461cda799 /create_tarball
parent9db84075a083d851ec02917f926d44bc17e1f08e (diff)
downloadscripts-517a78302072e0b2a55a65a4811bc90fbba42e08.tar.gz
scripts-517a78302072e0b2a55a65a4811bc90fbba42e08.zip
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>
Diffstat (limited to 'create_tarball')
-rwxr-xr-xcreate_tarball2
1 files changed, 1 insertions, 1 deletions
diff --git a/create_tarball b/create_tarball
index 11bd9ee..4035d33 100755
--- a/create_tarball
+++ b/create_tarball
@@ -150,7 +150,7 @@ if [ ! -e $TARBALL_DIR/$package.tar$TAR_SUFFIX ]; then
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
+ 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 | \
tar c --no-recursion --null -T - \