diff options
author | Lyndon Brown <jnqnfe@gmail.com> | 2020-04-01 09:29:52 +0100 |
---|---|---|
committer | Raphaƫl Hertzog <hertzog@debian.org> | 2020-04-23 09:38:01 +0000 |
commit | 11836c0c18b07f4bd1ea22a2163875975f3e6816 (patch) | |
tree | a3534b7d09a538fecec2379fdba0a7c6a12247a2 /functions | |
parent | f6a50b6db204fa1a6d0ae8b371c4108911aed0eb (diff) | |
download | vyos-live-build-11836c0c18b07f4bd1ea22a2163875975f3e6816.tar.gz vyos-live-build-11836c0c18b07f4bd1ea22a2163875975f3e6816.zip |
fix $@ parameter expansion issues
$@ when unquoted is subject to further word splitting. this fixes a bunch
of instances where it was incorrectly being used unquoted.
Gbp-Dch: Short
Diffstat (limited to 'functions')
-rwxr-xr-x | functions/aliases.sh | 9 | ||||
-rwxr-xr-x | functions/conffile.sh | 3 | ||||
-rwxr-xr-x | functions/packagelists.sh | 3 | ||||
-rwxr-xr-x | functions/stagefile.sh | 2 | ||||
-rwxr-xr-x | functions/wrapper.sh | 4 |
5 files changed, 8 insertions, 13 deletions
diff --git a/functions/aliases.sh b/functions/aliases.sh index bf77e4284..e899b1e60 100755 --- a/functions/aliases.sh +++ b/functions/aliases.sh @@ -20,10 +20,8 @@ In_list () shift local ITEM - for ITEM in ${@} - do - if [ "${NEEDLE}" = "${ITEM}" ] - then + for ITEM in "${@}"; do + if [ "${NEEDLE}" = "${ITEM}" ]; then return 0 fi done @@ -34,8 +32,7 @@ In_list () Truncate () { local FILE - for FILE in ${@} - do + for FILE in "${@}"; do if [ ! -L ${FILE} ] then : > ${FILE} diff --git a/functions/conffile.sh b/functions/conffile.sh index ceb11ea06..f6a68b154 100755 --- a/functions/conffile.sh +++ b/functions/conffile.sh @@ -17,8 +17,7 @@ Get_conffiles () FILES="${LB_CONFIG}" else local FILE - for FILE in ${@} - do + for FILE in "${@}"; do FILES="${FILES} ${FILE} ${FILE}.${LB_ARCHITECTURES} ${FILE}.${DISTRIBUTION}" FILES="${FILES} config/$(echo ${PROGRAM} | sed -e 's|^lb_||')" FILES="${FILES} config/$(echo ${PROGRAM} | sed -e 's|^lb_||').${ARCHITECTURE}" diff --git a/functions/packagelists.sh b/functions/packagelists.sh index ad31f4909..e44a51b64 100755 --- a/functions/packagelists.sh +++ b/functions/packagelists.sh @@ -26,8 +26,7 @@ Expand_packagelist () local _LB_NESTED=0 local _LB_ENABLED=1 - for _LB_SEARCH_PATH in ${@} - do + for _LB_SEARCH_PATH in "${@}"; do if [ -e "${_LB_SEARCH_PATH}/${_LB_LIST_NAME}" ] then _LB_LIST_LOCATION="${_LB_SEARCH_PATH}/${_LB_LIST_NAME}" diff --git a/functions/stagefile.sh b/functions/stagefile.sh index 40a1e2518..3c3468851 100755 --- a/functions/stagefile.sh +++ b/functions/stagefile.sh @@ -74,7 +74,7 @@ Require_stagefiles () local FILE local MISSING="" local MISSING_COUNT=0 - for FILE in ${@}; do + for FILE in "${@}"; do if [ ! -f ".build/${FILE}" ]; then MISSING_COUNT=$(( $MISSING_COUNT + 1 )) MISSING="${MISSING:+$MISSING }${FILE}" diff --git a/functions/wrapper.sh b/functions/wrapper.sh index e96e1ac4e..6abb5909f 100755 --- a/functions/wrapper.sh +++ b/functions/wrapper.sh @@ -16,11 +16,11 @@ Apt () case "${LB_APT}" in apt|apt-get) - Chroot ${CHROOT} apt-get ${APT_OPTIONS} ${@} + Chroot ${CHROOT} apt-get ${APT_OPTIONS} "${@}" ;; aptitude) - Chroot ${CHROOT} aptitude ${APTITUDE_OPTIONS} ${@} + Chroot ${CHROOT} aptitude ${APTITUDE_OPTIONS} "${@}" ;; esac } |