Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/32299 )
Change subject: util/genbuild_h: Allow operation with older git versions ......................................................................
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 --- M util/genbuild_h/genbuild_h.sh 1 file changed, 8 insertions(+), 2 deletions(-)
Approvals: build bot (Jenkins): Verified Werner Zeh: Looks good to me, approved Subrata Banik: Looks good to me, approved
diff --git a/util/genbuild_h/genbuild_h.sh b/util/genbuild_h/genbuild_h.sh index 5c45b2b..bafdbc9 100755 --- a/util/genbuild_h/genbuild_h.sh +++ b/util/genbuild_h/genbuild_h.sh @@ -22,14 +22,20 @@ 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"