summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorLyndon Brown <jnqnfe@gmail.com>2020-04-28 16:23:26 +0100
committerLyndon Brown <jnqnfe@gmail.com>2020-05-02 14:59:12 +0100
commit2d4b2c9e76dbb3a6625c2e550a0e9b5fd241785f (patch)
tree8895c52cd6f91d642bc3b58bc3f04e81d352e17b /scripts
parent2d7ff4934d721f38ac5274c866e44e20d3bda2e8 (diff)
downloadvyos-live-build-2d4b2c9e76dbb3a6625c2e550a0e9b5fd241785f.tar.gz
vyos-live-build-2d4b2c9e76dbb3a6625c2e550a0e9b5fd241785f.zip
clean: improve arg handling
- detect lack of options using actual arg count rather than first arg being an empty string. - fix string splitting issues by looping properly on "${@}" - tidier Gbp-Dch: Ignore
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build/clean10
1 files changed, 3 insertions, 7 deletions
diff --git a/scripts/build/clean b/scripts/build/clean
index 32a198399..786046ac0 100755
--- a/scripts/build/clean
+++ b/scripts/build/clean
@@ -39,17 +39,13 @@ fi
Remove_lockfile
-if [ -z "${1}" ]
-then
- ARGUMENTS="--all"
-else
- ARGUMENTS="${@}"
+if [ $# -eq 0 ]; then
+ set -- "--all"
fi
STAGEFILES_DIR="$(Stagefiles_dir)"
-for ARGUMENT in ${ARGUMENTS}
-do
+for ARGUMENT in "${@}"; do
case "${ARGUMENT}" in
--all)
"${0}" noauto --chroot