ensure_packages_of_tags() {
prefixed_msg_init 'ensure_packages_of_tags'
+ # shellcheck disable=SC2089
local APT_ARG="-q -q -o 'Dpkg::Options::=--force-confnew' install"
local TAG
- for TAG in "$@"; do
+ # shellcheck disable=SC2068
+ for TAG in $@; do
prefixed_msg_no_nl "For tag '${TAG}', "
local TEST
TEST=$(echo "${TAG}" | cut -d':' -f1)
- # TODO get rid of this one
+ # TODO get rid of this one
if [ "${TEST}" = 'keep_if_installed' ]; then
local PACKAGE
PACKAGE=$(echo "${TAG}" | cut -d':' -f2)
printf 'checking if installed … '
if dpkg-query -Wf '${Package}\n' | grep '^'"${PACKAGE}"'$' > /dev/null; then
echo 'yup, keeping!'
- apt_digested "${APT_ARG}" "${PACKAGE}"
+ # shellcheck disable=SC2090,SC2086
+ apt_digested ${APT_ARG} ${PACKAGE}
else
echo 'nope, nothing to keep.'
fi
echo 'nothing to install.'
else
echo "ensuring installation of: ${PACKAGES}"
- apt_digested "${APT_ARG}" "${PACKAGES}"
+ # shellcheck disable=SC2090,SC2086
+ apt_digested ${APT_ARG} ${PACKAGES}
fi
done
prefixed_msg_exit