diff options
author | Mike Frysinger <vapier@chromium.org> | 2017-05-18 11:43:05 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@chromium.org> | 2017-05-19 04:13:09 +0000 |
commit | 9d11bb1b1d0ca7503b195c1de4463f1d1e1ab4d2 (patch) | |
tree | f4d1dcc48b1d0bf18599520d2972570f11e90eaf /scripts/image_signing/common_minimal.sh | |
parent | b660356d515473a81e424410ead2cdf566159406 (diff) | |
download | vboot-9d11bb1b1d0ca7503b195c1de4463f1d1e1ab4d2.tar.gz |
image_signing: unify output helpers
We have `err_die` and `die` helpers that do the same thing, but some
scripts just have to know which one to use based on their runtime.
Just unify them as the more common `die` so all scripts can use it.
Similarly, we provide info, warn, and error to dev scripts, but not
to the runtime ones. Add small stubs in common_minimal.sh so the
API is consistent.
BRANCH=None
BUG=chromium:718184
TEST=scripts still work
Change-Id: Id44fb27900c37f4e357d20817f909e4534d1c5b3
Reviewed-on: https://chromium-review.googlesource.com/507990
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: David Riley <davidriley@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Diffstat (limited to 'scripts/image_signing/common_minimal.sh')
-rw-r--r-- | scripts/image_signing/common_minimal.sh | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/scripts/image_signing/common_minimal.sh b/scripts/image_signing/common_minimal.sh index f50a3c0a..c130b918 100644 --- a/scripts/image_signing/common_minimal.sh +++ b/scripts/image_signing/common_minimal.sh @@ -38,10 +38,24 @@ load_shflags() { # Functions for debug output # ---------------------------------------------------------------------------- +# These helpers are for runtime systems. For scripts using common.sh, +# they'll get better definitions that will clobber these ones. +info() { + echo "${PROG}: INFO: $*" >&2 +} + +warn() { + echo "${PROG}: WARN: $*" >&2 +} + +error() { + echo "${PROG}: ERROR: $*" >&2 +} + # Reports error message and exit(1) # Args: error message -err_die() { - echo "ERROR: $*" 1>&2 +die() { + error "$@" exit 1 } |