home · contact · privacy
Fix.
authorChristian Heller <c.heller@plomlompom.de>
Mon, 5 May 2025 23:16:45 +0000 (01:16 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Mon, 5 May 2025 23:16:45 +0000 (01:16 +0200)
bookworm/scripts/lib/apt_get_digested

index 887a00458ebb47a152cbde085e5f3524b4ecca99..5f919b343e8af09dc24a9bbb2213829a333c9aa3 100644 (file)
@@ -31,6 +31,7 @@ dpkg warns: unable to delete old directories (not empty):|dpkg: warning: unable
 update-alternatives: providing in auto mode:|update-alternatives: using ([[:print:]]+) to provide ([[:print:]]+) \(([[:print:]]+)\) in auto mode| [\1 → \2 (\3)]'
 
 _LAST_PREFIX=''
+_STARTED_PRINTING=
 DEBIAN_FRONTEND=noninteractive apt-get -y $1 2>&1 | while read _LINE; do
     _LINE=$(printf '%s' "${_LINE}" | tr -d '\r')
     if [ -z "${_LINE}" ]; then
@@ -56,16 +57,19 @@ DEBIAN_FRONTEND=noninteractive apt-get -y $1 2>&1 | while read _LINE; do
     if [ "${_COMPRESSED_ITEM}" = "IGNORE" ]; then
         continue
     elif [ -z "${_COMPRESSED_ITEM}" ]; then
+        test ! -z "${_STARTED_PRINTING}" && printf '\n'
+        printf '\r%s' "${_LINE}"
         _LAST_PREFIX=''
-        printf '\n\r%s' "${_LINE}"
     else
         if [ "${_PREFIX}" != "${_LAST_PREFIX}" ]; then
-            printf '\n\r'
+            test ! -z "${_STARTED_PRINTING}" && printf '\n'
+            printf '\r'
             prefixed_msg_no_nl "${_PREFIX}"
             _LAST_PREFIX="${_PREFIX}"
         fi
         printf ' %s' "${_COMPRESSED_ITEM}"
     fi
+    _STARTED_PRINTING=1    
 done
 printf '\r'