summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLyndon Brown <jnqnfe@gmail.com>2020-05-02 13:43:22 +0100
committerLyndon Brown <jnqnfe@gmail.com>2020-05-02 14:04:12 +0100
commitb20979334cc28c345b2b72da30c3591fb5c85882 (patch)
treee9f9ecbbae747624773cf878d9245becf51732d5
parentda1fab116139150db562eb2c104dea55b7535a33 (diff)
downloadvyos-live-build-b20979334cc28c345b2b72da30c3591fb5c85882.tar.gz
vyos-live-build-b20979334cc28c345b2b72da30c3591fb5c85882.zip
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
-rwxr-xr-xscripts/build/bootstrap_cache10
-rwxr-xr-xscripts/build/chroot_cache5
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