summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2022-09-13 14:37:59 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-09-14 21:53:54 +0000
commitded9307b7919a6b5b074e2e9d3394038888b8a9e (patch)
treedb1bb6959f7a14268b2336210c930e453a9583b9
parent24a1cee59942b595f459d69c2aa2f97d37b268df (diff)
downloadchrome-ec-ded9307b7919a6b5b074e2e9d3394038888b8a9e.tar.gz
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 <tomhughes@chromium.org> Change-Id: Ie06f9edc2a228eef0162be10e1b1abe123ce6bc7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3894408 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
-rwxr-xr-xutil/getversion.sh2
1 files changed, 1 insertions, 1 deletions
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"