summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorCraig Hesling <hesling@chromium.org>2020-12-30 21:28:18 -0800
committerCommit Bot <commit-bot@chromium.org>2021-01-05 20:36:40 +0000
commitca6ea0d3564b1066f9cc3b18931f782dd4596b66 (patch)
tree32136e22c475d4cb2a7def7d57e834b707156ce9 /util
parentf5de8999009643f9bca889fe2d4448c360736d86 (diff)
downloadchrome-ec-ca6ea0d3564b1066f9cc3b18931f782dd4596b66.tar.gz
util/compare_build.sh: Auto set --private default
Set the default state of the --private flag to reflect the current build configuration. All that means is if the private directory exists, enable private directory linking by default. Remove the short form of --private (-p), since shflags lib implements the short flags to imply the inverse of whatever the default value is. This would be quite confusing in this case, where the default changes based on the presence of the private directory. BRANCH=none BUG=b:176500425 TEST=# With private dir ./util/compare_build.sh -h # --private should be (default: true) move private private-move ./util/compare_build.sh -h # --private should be (default: false) Change-Id: I3221935d1e140cd3a871ee23aabe0f4a0dff3975 Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2605734
Diffstat (limited to 'util')
-rwxr-xr-xutil/compare_build.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/util/compare_build.sh b/util/compare_build.sh
index c1e7856f31..ab8ff6fcee 100755
--- a/util/compare_build.sh
+++ b/util/compare_build.sh
@@ -38,6 +38,11 @@
. /usr/share/misc/shflags
+FLAGS_PRIVATE_DEFAULT="${FLAGS_FALSE}"
+if [[ -d private ]]; then
+ FLAGS_PRIVATE_DEFAULT="${FLAGS_TRUE}"
+fi
+
DEFINE_string 'boards' "nocturne_fp" 'Boards to build (all, fp, stm32, hatch)' \
'b'
DEFINE_string 'ref1' "HEAD" 'Git reference (commit, branch, etc)'
@@ -51,8 +56,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'
+DEFINE_boolean 'private' "${FLAGS_PRIVATE_DEFAULT}" \
+ 'Link the private repo/dir into test build source tree.'
# Usage: assoc-add-keys <associate_array_name> [item1 [item2...]]
assoc-add-keys() {
@@ -195,6 +200,7 @@ printf "%s\n" "${BOARDS[@]}" | sort | column
# Symbolically linked directories
LINKS=( )
if [[ "${FLAGS_private}" == "${FLAGS_TRUE}" ]]; then
+ echo "# Requesting private directory link"
LINKS+=( private )
fi