summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2015-06-07 02:07:34 +0200
committerPatrick Georgi <pgeorgi@google.com>2015-06-09 21:57:05 +0200
commit4dc1197ba3aa7bc6c4c40f09f1ad19dc0d9cbaeb (patch)
tree713048a9e19a6ca8de4c310614cc1c73031139fe
parent999ed64ac5e1a9c7b7c4f85ff08f68b8512abb83 (diff)
genbuild_h: refactor environment variable into export's
Change-Id: Ife3fb0c86fbd065fe9957bbc79b4dd1391f930b2 Signed-off-by: Alexander Couzens <lynxis@fe80.eu> Reviewed-on: http://review.coreboot.org/10448 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
-rwxr-xr-xutil/genbuild_h/genbuild_h.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/util/genbuild_h/genbuild_h.sh b/util/genbuild_h/genbuild_h.sh
index 3d25276948..84aad7ddea 100755
--- a/util/genbuild_h/genbuild_h.sh
+++ b/util/genbuild_h/genbuild_h.sh
@@ -21,6 +21,10 @@
DATE=""
GITREV=""
TIMESOURCE=""
+
+export LANG=C
+export TZ=UTC
+
if [ -d "${top}/.git" ] && [ -f "$(command -v git)" ]; then
GITREV=$(LANG= git log remotes/origin/master -1 --format=format:%h)
TIMESOURCE=git
@@ -34,10 +38,10 @@ fi
our_date() {
case $(uname) in
NetBSD|OpenBSD|DragonFly|FreeBSD)
- TZ=UTC date -r $1 $2
+ date -r $1 $2
;;
*)
- TZ=UTC date -d @$1 $2
+ date -d @$1 $2
esac
}
@@ -53,7 +57,7 @@ printf "#define COREBOOT_VERSION_TIMESTAMP $DATE\n"
printf "#define COREBOOT_ORIGIN_GIT_REVISION \"$GITREV\"\n"
printf "#define COREBOOT_EXTRA_VERSION \"%s\"\n" "$COREBOOT_EXTRA_VERSION"
-printf "#define COREBOOT_BUILD \"$(LANG= our_date "$DATE")\"\n"
+printf "#define COREBOOT_BUILD \"$(our_date "$DATE")\"\n"
printf "#define COREBOOT_BUILD_YEAR_BCD 0x$(our_date "$DATE" +%y)\n"
printf "#define COREBOOT_BUILD_MONTH_BCD 0x$(our_date "$DATE" +%m)\n"
printf "#define COREBOOT_BUILD_DAY_BCD 0x$(our_date "$DATE" +%d)\n"