From c8112f3130f9fc583a13ff14f7c5fa517fde640b Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Tue, 6 May 2025 05:18:15 +0200 Subject: [PATCH] Fix. --- bookworm/scripts/lib/apt_get_digested | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bookworm/scripts/lib/apt_get_digested b/bookworm/scripts/lib/apt_get_digested index 67cbccb..e0542f1 100644 --- a/bookworm/scripts/lib/apt_get_digested +++ b/bookworm/scripts/lib/apt_get_digested @@ -31,6 +31,11 @@ BECOME_NEXT_PREFIX|dpkg: ([[:print:]]+): dependency problems, but removing anywa dpkg warns: unable to delete old directories (not empty):|dpkg: warning: unable to delete old directory '"'"'([[:print:]]+)'"'"': Directory not empty|\1 update-alternatives: providing in auto mode:|update-alternatives: using ([[:print:]]+) to provide ([[:print:]]+) \(([[:print:]]+)\) in auto mode| [\1 → \2 (\3)]' +print_nl_if_started_printing() { + if [ ! -z "${_STARTED_PRINTING}" ]; then + printf '\n' + fi +} _LAST_PREFIX='' _STARTED_PRINTING= eval "DEBIAN_FRONTEND=noninteractive apt-get -y $1; echo ${_FINISH_LINE}" 2>&1 | while read _LINE; do @@ -38,7 +43,7 @@ eval "DEBIAN_FRONTEND=noninteractive apt-get -y $1; echo ${_FINISH_LINE}" 2>&1 | if [ -z "${_LINE}" ]; then continue elif [ "${_LINE}" = "${_FINISH_LINE}" ]; then - test ! -z "${_STARTED_PRINTING}" && printf '\n' + print_nl_if_started_printing printf '\r' break fi @@ -62,12 +67,12 @@ eval "DEBIAN_FRONTEND=noninteractive apt-get -y $1; echo ${_FINISH_LINE}" 2>&1 | if [ "${_COMPRESSED_ITEM}" = "IGNORE" ]; then continue elif [ -z "${_COMPRESSED_ITEM}" ]; then - test ! -z "${_STARTED_PRINTING}" && printf '\n' + print_nl_if_started_printing printf '\r%s' "${_LINE}" _LAST_PREFIX='' else if [ "${_PREFIX}" != "${_LAST_PREFIX}" ]; then - test ! -z "${_STARTED_PRINTING}" && printf '\n' + print_nl_if_started_printing printf '\r' prefixed_msg_no_nl "${_PREFIX}" _LAST_PREFIX="${_PREFIX}" -- 2.30.2