home · contact · privacy
Fix.
authorChristian Heller <c.heller@plomlompom.de>
Mon, 5 May 2025 22:37:47 +0000 (00:37 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Mon, 5 May 2025 22:37:47 +0000 (00:37 +0200)
bookworm/scripts/lib/apt_get_digested
bookworm/scripts/lib/ensure_packages_of_tags

index ca65f5c3676970b147f7062510b41797f9a64246..4288d6e015d34d5777a33da44e51200394609180 100644 (file)
@@ -67,7 +67,7 @@ DEBIAN_FRONTEND=noninteractive apt-get -y $1 2>&1 | while read _LINE; do
         printf ' %s' "${_COMPRESSED_ITEM}"
     fi
 done
-printf '\r\n\n'
+printf '\r\n'
 
 prefixed_msg_exit
 }
index d70fd321680a9eb585e372a468bb1e7ab89859e2..8218228a2bc363c4a0db86f534423b04e51e3137 100644 (file)
@@ -5,6 +5,7 @@ ensure_packages_of_tags() {
 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
@@ -12,7 +13,7 @@ for _TAG in $@; do
         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
@@ -28,7 +29,7 @@ for _TAG in $@; do
         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'