home · contact · privacy
Fix.
authorChristian Heller <c.heller@plomlompom.de>
Tue, 6 May 2025 02:31:38 +0000 (04:31 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Tue, 6 May 2025 02:31:38 +0000 (04:31 +0200)
bookworm/scripts/lib/apt_get_digested

index 2a88b5380adce4cf50ace2d26fb60be32ad1e8ac..8171822c4437ace1423d872409fb283fca4ea5c5 100644 (file)
@@ -6,6 +6,7 @@ prefixed_msg_init 'apt_get_digested'
 
 abort_if_command_unknown calc
 
+_FINISH_LINE='apt_get_digested FINISH_LINE'
 _SEDS=\
 '|\(Reading database \.\.\. .*|IGNORE
 |Generation complete.|IGNORE
@@ -32,10 +33,14 @@ update-alternatives: providing in auto mode:|update-alternatives: using ([[:prin
 
 _LAST_PREFIX=''
 _STARTED_PRINTING=
-DEBIAN_FRONTEND=noninteractive apt-get -y $1 2>&1 | while read _LINE; do
+DEBIAN_FRONTEND=noninteractive apt-get -y; echo "${_FINISH_LINE}" $1 2>&1 | while read _LINE; do
     _LINE=$(printf '%s' "${_LINE}" | tr -d '\r')
     if [ -z "${_LINE}" ]; then
         continue
+    elif [ "${_LINE}" = "${_FINISH_LINE}" ]; then
+        test ! -z "${_STARTED_PRINTING}" && printf '\n'
+        printf '\r'
+        break
     fi
     _COMPRESSED_ITEM=''
     for _SED in $(printf '%s' "${_SEDS}" | sed 's/ /#WHITESPACE#/g'); do
@@ -71,8 +76,6 @@ DEBIAN_FRONTEND=noninteractive apt-get -y $1 2>&1 | while read _LINE; do
     fi
     _STARTED_PRINTING=1    
 done
-test ! -z "${_STARTED_PRINTING}" && printf '\n'
-printf '\r'
 
 prefixed_msg_exit
 }