From b20979334cc28c345b2b72da30c3591fb5c85882 Mon Sep 17 00:00:00 2001 From: Lyndon Brown Date: Sat, 2 May 2020 13:43:22 +0100 Subject: [PATCH] caching: output error on invalid action param for bootstrap, the check is moved to the case statement for greater robustness, and for consistency with other scripts. Gbp-Dch: Ignore --- scripts/build/bootstrap_cache | 10 +++++----- scripts/build/chroot_cache | 5 +++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/build/bootstrap_cache b/scripts/build/bootstrap_cache index d8e9607aa..1c3c7ff25 100755 --- a/scripts/build/bootstrap_cache +++ b/scripts/build/bootstrap_cache @@ -21,11 +21,6 @@ USAGE="${PROGRAM} {restore|save} [--force]" _ACTION="${1}" shift -if ! In_list "${_ACTION}" restore save; then - Echo_error "Invalid action parameter" - exit 1 -fi - # Processing arguments and configuration files Init_config_data "${@}" @@ -98,4 +93,9 @@ case "${_ACTION}" in # Creating stage file Create_stagefile "${STAGE_FILE}" ;; + + *) + Echo_error "Invalid action parameter: '${_ACTION}'" + Usage --fail + ;; esac diff --git a/scripts/build/chroot_cache b/scripts/build/chroot_cache index 73a9f62d2..451cda1e0 100755 --- a/scripts/build/chroot_cache +++ b/scripts/build/chroot_cache @@ -76,4 +76,9 @@ case "${_ACTION}" in # Creating stage file Create_stagefile "${STAGE_FILE}" ;; + + *) + Echo_error "Invalid action parameter: '${_ACTION}'" + Usage --fail + ;; esac