[coreboot-gerrit] New patch to review for coreboot: genbuild_h: git builds: Make date(1) lang, locale, and timezone independent

Denis 'GNUtoo' Carikli (GNUtoo@no-log.org) gerrit at coreboot.org
Tue Feb 21 10:00:23 CET 2017


Denis 'GNUtoo' Carikli (GNUtoo at no-log.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18415

-gerrit

commit b7be3832388021b4932579035192d77bbc1049d1
Author: Denis 'GNUtoo' Carikli <GNUtoo at no-log.org>
Date:   Tue Feb 21 08:38:08 2017 +0100

    genbuild_h: git builds: Make date(1) lang, locale, and timezone independent
    
    Without that fix, when building from git, computers on
    different timezone will produce a different COREBOOT_BUILD
    and COREBOOT_COMPILE_TIME defines in the cbfs revision file.
    
    For instance when building the following revision:
      d96669e9db mainboard/google/reef: Increase PL1 sampling period
    On a computer set to UTC, it will produce the following:
      #define COREBOOT_BUILD "Sat Feb 11 13:58:51 UTC 2017"
      #define COREBOOT_COMPILE_TIME "13:58:51"
    But with a computer set to CET, it will look different:
      #define COREBOOT_BUILD "Sat Feb 11 14:58:51 CET 2017"
      #define COREBOOT_COMPILE_TIME "14:58:51"
    
    Change-Id: If67db4aaa5e72d58e149d34f8d230c42cf503e33
    Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo at no-log.org>
---
 util/genbuild_h/genbuild_h.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/util/genbuild_h/genbuild_h.sh b/util/genbuild_h/genbuild_h.sh
index 044d901..2625a6e 100755
--- a/util/genbuild_h/genbuild_h.sh
+++ b/util/genbuild_h/genbuild_h.sh
@@ -41,10 +41,10 @@ fi
 our_date() {
 case $(uname) in
 NetBSD|OpenBSD|DragonFly|FreeBSD|Darwin)
-	date -r $1 $2
+	LANG= LC_ALL=C TZ=UTC date -r $1 $2
 	;;
 *)
-	date -d @$1 $2
+	LANG= LC_ALL=C TZ=UTC date -u -d @$1 $2
 esac
 }
 



More information about the coreboot-gerrit mailing list