From f72bbe3b31163b9908ab59cc1d295080090ad439 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sun, 6 Dec 2020 15:41:30 +0100 Subject: [PATCH] create_tarball: Convert to UTC the date of the last commit, which is written to '.tdescminfo'. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 (cherry picked from commit 517a78302072e0b2a55a65a4811bc90fbba42e08) --- create_tarball | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/create_tarball b/create_tarball index f771739..081ac90 100755 --- a/create_tarball +++ b/create_tarball @@ -157,7 +157,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 - \