summaryrefslogtreecommitdiff
path: root/util/compare_build.sh
diff options
context:
space:
mode:
authorCraig Hesling <hesling@chromium.org>2020-05-07 09:45:16 -0700
committerCommit Bot <commit-bot@chromium.org>2020-05-07 21:36:26 +0000
commit1de8e9ef3dbb09eed0ec6837fad124e169ea1c8e (patch)
tree3a2bf0a8e2395c84a45678307c799666844e8c44 /util/compare_build.sh
parent0f0aff93d0d47654f47187321858e955fae9d4a7 (diff)
downloadchrome-ec-1de8e9ef3dbb09eed0ec6837fad124e169ea1c8e.tar.gz
compare_build.sh: Fix chip boards-with parsing
This fixes board expansions that use the boards-with search feature. The boards-with function outputs a newline separated list, while the static board expansions emit a space separated list. This allows read to tokenize either format. BRANCH=none BUG=none TEST=./util/compare_build.sh -bstm32f4 TEST=./util/compare_build.sh -bfp Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: Iebf4309fc7ea2ba66a637a5446aa283552ef67c8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2187951 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Diffstat (limited to 'util/compare_build.sh')
-rwxr-xr-xutil/compare_build.sh5
1 files changed, 2 insertions, 3 deletions
diff --git a/util/compare_build.sh b/util/compare_build.sh
index 43cd4b2649..eb763ca4a6 100755
--- a/util/compare_build.sh
+++ b/util/compare_build.sh
@@ -129,6 +129,7 @@ parse-boards() {
# Parse boards selection
local b name name_arr=( )
for b; do
+ # Remove + or - prefix
name="$(sed -E 's/^(-|\+)//' <<<"${b}")"
# Check for a valid board
if [[ "${BOARDS_VALID[${name}]}" != "${name}" ]]; then
@@ -139,15 +140,13 @@ parse-boards() {
if [[ -n "${BOARD_GROUPS[${name}]}" ]]; then
name="${BOARD_GROUPS[${name}]}"
fi
- read -r -a name_arr <<< "${name}"
+ read -d "" -r -a name_arr <<< "${name}"
# Process addition or deletion
case "${b}" in
-*)
- # shellcheck disable=SC2086
assoc-rm-keys boards "${name_arr[@]}"
;;
+*|*)
- # shellcheck disable=SC2086
assoc-add-keys boards "${name_arr[@]}"
;;
esac