diff options
author | Craig Hesling <hesling@chromium.org> | 2020-01-31 11:13:03 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-02-01 01:22:28 +0000 |
commit | 7656ae617e8874366425388aeef5b1e7689c56c3 (patch) | |
tree | 94976c6535d66743bb6c65a2e539b8b655526c70 | |
parent | 228bbe7fa88cd5c57956d57429b2b792a2e44370 (diff) | |
download | chrome-ec-7656ae617e8874366425388aeef5b1e7689c56c3.tar.gz |
nocturne_fp/hatch_fp: Fix getversion without private
Public builds do not have the private directory, thus they
cannot have a valid private version tag.
Without this fix, the following errors were emitted during build
and the build VERSION would have an invalid private version tag
appended to it:
./util/getversion.sh: line 114: pushd: ./private: No such file or directory
./util/getversion.sh: line 124: popd: directory stack empty
The invalid version would end up being the same git version as the root
repository, since the pushd fails.
An alternative would be to detect that the directory did not exist
and add a does-not-exist private VERSION tag, but I feel that that
simply degrades/taints a public build. Furthermore, other boards
may want a missing directory to cause an build error/warning.
BRANCH=nocturne,hatch
BUG=none
TEST=BOARD=nocturne_fp ./util/getversion.sh
# Observe the #define VERSION line
TEST=BOARD=hatch_fp ./util/getversion.sh
# Observe the #define VERSION line
TEST=make BOARD=nocturne_fp
TEST=make BOARD=hatch_fp
Change-Id: I242e19d35f34599639dee7e74ffd4199f6b34c89
Signed-off-by: Craig Hesling <hesling@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2032789
-rwxr-xr-x | util/getversion.sh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/util/getversion.sh b/util/getversion.sh index 913c0894ec..80428856fd 100755 --- a/util/getversion.sh +++ b/util/getversion.sh @@ -104,7 +104,9 @@ main() { dir_list+=( ../../third_party/tpm2 ../../third_party/cryptoc ) ;; (*_fp) - dir_list+=( ./private ) + if [[ -d ./private ]]; then + dir_list+=( ./private ) + fi ;; esac |