diff options
author | Mike Frysinger <vapier@chromium.org> | 2017-05-07 01:24:26 -0400 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-05-13 01:04:43 -0700 |
commit | ad16cf327e86f46a6d6e9e14e53ac31bf5b49757 (patch) | |
tree | 99cc577948646e684786044cffcfe8750dfac9f4 | |
parent | 5fa64e2eae7d9cb4e911efb721fd55f729bcb615 (diff) | |
download | vboot-ad16cf327e86f46a6d6e9e14e53ac31bf5b49757.tar.gz |
image_signing: ensure_sane_lsb-release.sh: convert to info/error helpers
This makes the output easier to follow when multiple scripts are being run.
BRANCH=None
BUG=chromium:714598
TEST=signing images still works
Change-Id: I7351e1ff63bb7e88e4449dd2718685fef7ec031d
Reviewed-on: https://chromium-review.googlesource.com/498267
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: David Riley <davidriley@chromium.org>
-rwxr-xr-x | scripts/image_signing/ensure_sane_lsb-release.sh | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/scripts/image_signing/ensure_sane_lsb-release.sh b/scripts/image_signing/ensure_sane_lsb-release.sh index 3fd1bae7..9e5a179d 100755 --- a/scripts/image_signing/ensure_sane_lsb-release.sh +++ b/scripts/image_signing/ensure_sane_lsb-release.sh @@ -25,7 +25,8 @@ lsbequals() { local expectval="$3" local realval=$(lsbval "$lsbfile" $key) if [ "$realval" != "$expectval" ]; then - echo "$key mismatch. Expected '$expectval', image contains '$realval'" + error "${key} mismatch. Expected '${expectval}'," \ + "image contains '${realval}'" return 1 fi return 0 @@ -53,7 +54,7 @@ check_keyval_in_list() { shift done # If we get here, it wasn't found - echo "$lsbkey: Value '$lsbval' was not recognized" + error "${lsbkey}: Value '${lsbval}' was not recognized" return 1 } @@ -76,22 +77,22 @@ lsb_syntaxcheck() { badlines=$(grep -Ev '^[A-Z][A-Z_]*=([[:graph:]][[:print:]]*)?$' "$lsbfile") if [ -n "$badlines" ]; then syntaxbad=1 - echo "$lsbfile: Some lines seem non-well-formed:" - echo "$badlines" + error "${lsbfile}: Some lines seem non-well-formed:" + error "${badlines}" fi # Checks for a lines exceeding a reasonable overall length. badlines=$(grep -E '^.{255}' "$lsbfile") if [ -n "$badlines" ]; then syntaxbad=1 - echo "$lsbfile: Some lsb-release lines seem unreasonably long:" - echo "$badlines" + error "${lsbfile}: Some lsb-release lines seem unreasonably long:" + error "${badlines}" fi # Overall file size check: size=$(ls -sk "$lsbfile" | cut -d ' ' -f 1) if [ $size -gt 4 ]; then syntaxbad=1 - echo "$lsbfile: This file exceeds 4kb" + error "${lsbfile}: This file exceeds 4kb" fi return $syntaxbad } @@ -116,9 +117,8 @@ main() { configfile="$2" fi # Either way, load test-expectations data from config. - echo -n "Loading config from $configfile... " + info "Loading config from ${configfile}" . "$configfile" || return 1 - echo "Done." local rootfs=$(make_temp_dir) mount_image_partition_ro "$image" 3 "$rootfs" |