From 8e8be427abc7c0391d2454f5f189b2a99882ad10 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 23 Sep 2017 05:36:44 -0400 Subject: image_signing: fix under quoting of channel If the channel is missing or has whitespace, the test triggers errors in the script because the test command has bad quoting. BUG=None TEST=script no longer fails on an empty lsb-release BRANCH=None Change-Id: Ic2e6ab91ca4ec10c298d122aee1f7f7236b52bf2 Reviewed-on: https://chromium-review.googlesource.com/680059 Commit-Ready: Mike Frysinger Tested-by: Mike Frysinger Reviewed-by: David Riley --- scripts/image_signing/ensure_sane_lsb-release.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts/image_signing') diff --git a/scripts/image_signing/ensure_sane_lsb-release.sh b/scripts/image_signing/ensure_sane_lsb-release.sh index 007ded0f..d86eacb3 100755 --- a/scripts/image_signing/ensure_sane_lsb-release.sh +++ b/scripts/image_signing/ensure_sane_lsb-release.sh @@ -148,7 +148,8 @@ main() { local boardvar=$(get_boardvar_from_lsb_release "${rootfs}") channel=$(lsbval $lsb CHROMEOS_RELEASE_TRACK) # For a canary or dogfood channel, appid maybe a different default value. - if [ $channel = 'canary-channel' ] || [ $channel = 'dogfood-channel' ]; then + if [[ "${channel}" == 'canary-channel' || + "${channel}" == 'dogfood-channel' ]]; then eval "expected_appid=\"\$expected_appid_${channel%\-channel}\"" else eval "expected_appid=\"\$expected_appid_$boardvar\"" -- cgit v1.2.1