summaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorLyndon Brown <jnqnfe@gmail.com>2020-04-01 09:29:52 +0100
committerRaphaƫl Hertzog <hertzog@debian.org>2020-04-23 09:38:01 +0000
commit11836c0c18b07f4bd1ea22a2163875975f3e6816 (patch)
treea3534b7d09a538fecec2379fdba0a7c6a12247a2 /functions
parentf6a50b6db204fa1a6d0ae8b371c4108911aed0eb (diff)
downloadvyos-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-xfunctions/aliases.sh9
-rwxr-xr-xfunctions/conffile.sh3
-rwxr-xr-xfunctions/packagelists.sh3
-rwxr-xr-xfunctions/stagefile.sh2
-rwxr-xr-xfunctions/wrapper.sh4
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
}