From 02750d0400c3c75be6e6f68d0d35f1edfdbafd46 Mon Sep 17 00:00:00 2001 From: Felix Singer Date: Sun, 17 Oct 2021 15:43:21 +0200 Subject: util/crossgcc/buildgcc: Use pre-set CROSSGCC_VERSION if possible For reproducibility, a version string is appended to the version of the tools used in the cross-toolchain. Currently, git is used to determine that version string at runtime of this script. There are cases, where it's not possible to determine that version string, e.g. when a release tarball is used, and if so, the version string is just `v_`. Thus, allow pre-setting the variable `CROSSGCC_VERSION`. Change-Id: I888ccd877c93436b5e033528c43bd8667b8d2f10 Signed-off-by: Felix Singer Reviewed-on: https://review.coreboot.org/c/coreboot/+/58396 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber --- util/crossgcc/buildgcc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc index a3d9cad4bb..ab8cba444e 100755 --- a/util/crossgcc/buildgcc +++ b/util/crossgcc/buildgcc @@ -16,7 +16,9 @@ cd "$(dirname "$0")" || exit 1 -CROSSGCC_VERSION="$(git log -n 1 --pretty=%cd --date=short .)_$(git log -n 1 --pretty=%h .)" +if [ -z "$CROSSGCC_VERSION" ]; then + CROSSGCC_VERSION="$(git log -n 1 --pretty=%cd --date=short .)_$(git log -n 1 --pretty=%h .)" +fi # default settings PACKAGE=GCC -- cgit v1.2.3