From ded9307b7919a6b5b074e2e9d3394038888b8a9e Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 13 Sep 2022 14:37:59 -0700 Subject: util/getversion.sh: Fix version when not in a git repo When building with "FEATURES="test" emerge-hatch chromeos-ec" after using "cros-workon-hatch chromeos", the working directory is not a git repository (the files are just copied), so "git describe" in getversion.sh fails and the logic falls back to creating its own version number. The test in test/version.c explicitly checks for a version that begins with "v2" and has a hash length of at least 8, so update the version string from this case to match. BRANCH=none BUG=b:246424843 TEST=FEATURES="test" emerge-hatch chromeos-ec Signed-off-by: Tom Hughes Change-Id: Ie06f9edc2a228eef0162be10e1b1abe123ce6bc7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3894408 Reviewed-by: Daisuke Nojiri --- util/getversion.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/getversion.sh b/util/getversion.sh index fbc279457e..f096229db9 100755 --- a/util/getversion.sh +++ b/util/getversion.sh @@ -77,7 +77,7 @@ get_tree_version() { # Ex VCSID: 0.0.1-r1519-9b368af6a4943b90941471d0bdf7e7208788f898 if [[ -n "${VCSID}" ]]; then ghash="${VCSID##*-}" - vbase="1.1.9999-${ghash:0:7}" + vbase="v2.1.9999-${ghash:0:8}" else # then ultimately fails to "no_version" vbase="no_version" -- cgit v1.2.1