diff options
author | Craig Hesling <hesling@chromium.org> | 2020-08-14 13:46:28 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-08-21 20:46:15 +0000 |
commit | 4cffb921d9f5b13b0d3ab494741c09bfa73811c0 (patch) | |
tree | f8bd02550a7129851d793480aef25278a93adc3c /util/compare_build.sh | |
parent | 0d808ad532e668f2c69387ce9b0c7ad4c75814e7 (diff) | |
download | chrome-ec-4cffb921d9f5b13b0d3ab494741c09bfa73811c0.tar.gz |
compare_build.sh: Add private directory handling
This allows compare_build.sh to use private libs
if available.
BRANCH=none
BUG=none
TEST=# Ensure that you have an ec checkout that has a broken
# public build, but working private build.
./compare_build.sh -p
# This will only work if private was accessible
Signed-off-by: Craig Hesling <hesling@chromium.org>
Change-Id: Id5e2d1afe474e0175dbba2cddfd84de7c895a927
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2357870
Diffstat (limited to 'util/compare_build.sh')
-rwxr-xr-x | util/compare_build.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/util/compare_build.sh b/util/compare_build.sh index eb763ca4a6..ffe6cab0e5 100755 --- a/util/compare_build.sh +++ b/util/compare_build.sh @@ -51,6 +51,8 @@ DEFINE_integer 'jobs' "-1" 'Number of jobs to pass to make' 'j' # refs at the same time. Use the -o flag. DEFINE_boolean 'oneref' "${FLAGS_FALSE}" \ 'Build only one set of boards at a time. This limits mem.' 'o' +DEFINE_boolean 'private' "${FLAGS_FALSE}" \ + 'Link the private repo/dir into test build source tree.' 'p' # Usage: assoc-add-keys <associate_array_name> [item1 [item2...]] assoc-add-keys() { @@ -190,6 +192,12 @@ fi echo "# Board Selection:" printf "%s\n" "${BOARDS[@]}" | sort | column +# Symbolically linked directories +LINKS=( ) +if [[ "${FLAGS_private}" == "${FLAGS_TRUE}" ]]; then + LINKS+=( private ) +fi + ########################################################################## # Runtime # ########################################################################## @@ -203,6 +211,7 @@ cat > "${TMP_DIR}/Makefile" <<HEREDOC ORIGIN ?= $(realpath .) CRYPTOC_DIR ?= $(realpath ../../third_party/cryptoc) BOARDS ?= ${BOARDS[*]} +LINKS ?= ${LINKS[*]} .PHONY: all all: build-${OLD_REF} build-${NEW_REF} @@ -210,6 +219,9 @@ all: build-${OLD_REF} build-${NEW_REF} ec-%: git clone --quiet --no-checkout \$(ORIGIN) \$@ git -C \$@ checkout --quiet \$(@:ec-%=%) +ifneq (\$(LINKS),) + ln -s \$(addprefix \$(ORIGIN)/,\$(LINKS)) \$@ +endif build-%: ec-% \$(MAKE) --no-print-directory -C \$(@:build-%=ec-%) \\ |