summaryrefslogtreecommitdiff
path: root/util/genbuild_h/genbuild_h.sh
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@google.com>2019-04-12 11:08:17 +0200
committerPatrick Georgi <pgeorgi@google.com>2019-04-12 10:19:59 +0000
commit237baa14331930e73a46a44abfe35adedc212dc3 (patch)
treeb3bdc3b29fe690b0ce698eb6b9c2e535640d06ce /util/genbuild_h/genbuild_h.sh
parent29368167b58689622a77c41cfa0aab14bd72f0ec (diff)
downloadcoreboot-237baa14331930e73a46a44abfe35adedc212dc3.tar.xz
util/genbuild_h: Allow operation with older git versions
if git log --no-show-signature is not supported, retry without. Change-Id: I9ee1f8e887cde5e4d6c5e6958f269c62572cdd53 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/32299 Reviewed-by: Subrata Banik <subrata.banik@intel.com> Reviewed-by: Werner Zeh <werner.zeh@siemens.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'util/genbuild_h/genbuild_h.sh')
-rwxr-xr-xutil/genbuild_h/genbuild_h.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/util/genbuild_h/genbuild_h.sh b/util/genbuild_h/genbuild_h.sh
index 5c45b2b1f8..bafdbc95d7 100755
--- a/util/genbuild_h/genbuild_h.sh
+++ b/util/genbuild_h/genbuild_h.sh
@@ -22,14 +22,20 @@ export LANG=C
export LC_ALL=C
export TZ=UTC0
+# $1: format string
+get_git_head_data() {
+ LANG= git log --no-show-signature -1 --format="format:$1" 2>/dev/null || \
+ LANG= git log -1 --format="format:$1"
+}
+
if [ "${BUILD_TIMELESS}" = "1" ]; then
GITREV=Timeless
TIMESOURCE="fixed"
DATE=0
elif [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]; then
- GITREV=$(LANG= git log --no-show-signature -1 --format=format:%h)
+ GITREV=$(get_git_head_data %h)
TIMESOURCE=git
- DATE=$(git log --no-show-signature --pretty=format:%ct -1)
+ DATE=$(get_git_head_data %ct)
else
GITREV=Unknown
TIMESOURCE="date"