summaryrefslogtreecommitdiff
path: root/lib/mdate-sh
diff options
context:
space:
mode:
authorReiner Herrmann <reiner@reiner-h.de>2017-09-15 11:43:53 +0200
committerMathieu Lirzin <mthl@gnu.org>2017-09-15 12:00:33 +0200
commit7c25c996d1c7c212a5981aa0e9c4434b6f33f7b8 (patch)
treeb6d90ab8539de910daa2fd1dd3900c119ea4a1e9 /lib/mdate-sh
parent333b98f2d108111e9a99e7ede17de7f0a1adba03 (diff)
downloadautomake-7c25c996d1c7c212a5981aa0e9c4434b6f33f7b8.tar.gz
mdate-sh: Ensure reproducible time output
This change fixes automake bug#20314. 'mdate-sh' pretty-prints the modification time of a file. But it's output can vary depending on the timezone of the caller. Someone in timezone GMT-12 will get a different result (day) than someone in timezone GMT+12. As this output is also used to create/update stamp files, which influence the further build process, the build result can vary. * lib/mdate-sh: Set 'TZ' to UTC which ensures reproducible output. * NEWS: Announce bug fix. Copyright-paperwork-exempt: yes
Diffstat (limited to 'lib/mdate-sh')
-rwxr-xr-xlib/mdate-sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/mdate-sh b/lib/mdate-sh
index f80075c04..b6a116f92 100755
--- a/lib/mdate-sh
+++ b/lib/mdate-sh
@@ -1,7 +1,7 @@
#!/bin/sh
# Get modification time of a file or directory and pretty-print it.
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2017-09-15.09; # UTC
# Copyright (C) 1995-2017 Free Software Foundation, Inc.
# written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
@@ -74,6 +74,10 @@ export LC_ALL
LC_TIME=C
export LC_TIME
+# Use UTC to get reproducible result.
+TZ=UTC
+export TZ
+
# GNU ls changes its time format in response to the TIME_STYLE
# variable. Since we cannot assume 'unset' works, revert this
# variable to its documented default.