prefixed_msg_init 'ensure_packages_of_tags'
prefixed_msg 'starting'
+_APT_ARG="-q -q -o 'Dpkg::Options::=--force-confnew' install"
for _TAG in $@; do
prefixed_msg_no_nl "For tag '${_TAG}', "
if [ "$(echo ${_TAG} | cut -d':' -f1)" = 'keep_if_installed' ]; then
printf 'checking if installed … '
if dpkg-query -Wf '${Package}\n' | grep '^'"${_PACKAGE}"'$' > /dev/null; then
echo 'yup, keeping!'
- apt_get_digested '-q -q -o "Dpkg::Options::=--force-confnew" install' "${_PACKAGE}"
+ apt_get_digested "${_APT_ARG} ${_PACKAGE}"
else
echo 'nope, nothing to keep.'
fi
echo 'nothing to install.'
else
echo "ensuring installation of: ${_PACKAGES}"
- apt_get_digested '-q -q -o "Dpkg::Options::=--force-confnew" install' "${_PACKAGES}"
+ apt_get_digested "${_APT_ARG} ${_PACKAGES}"
fi
done
prefixed_msg 'finished'