From 3962e5b8bf5df81ae89e0a05f8163a1636e51ad3 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Thu, 1 May 2025 04:33:22 +0200 Subject: [PATCH] Fix. --- bookworm/scripts/lib/apt_get_edited | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bookworm/scripts/lib/apt_get_edited b/bookworm/scripts/lib/apt_get_edited index 839e82d..5d77d51 100644 --- a/bookworm/scripts/lib/apt_get_edited +++ b/bookworm/scripts/lib/apt_get_edited @@ -11,7 +11,7 @@ _SEDS=\ |Unpacking [[:print:]]+ \([[:print:]]+\)( over \([[:print:]]+\))? \.\.\.|IGNORE Adding diversion(s):|Adding '"'"'diversion of ([[:print:]]+) to ([[:print:]]+) by ([[:print:]]+)'"'"'| \3:[\1 → \2] Created symlink(s):|Created symlink '"'"'([[:print:]]+)'"'"' → '"'"'([[:print:]]+)'"'"'\.| [\1 → \2] -Dependencies:|([[:print:]]+) depends on ([[:print:]]+)( \([>=]+ [[:print:]]+\))?\.|[\2 → \1] +FOLLOW_PREFIX|([[:print:]]+) depends on ([[:print:]]+)( \([>=]+ [[:print:]]+\))?\.|[\2 → \1] Installing new version of config file(s):|Installing new version of config file ([[:print:]]+) \.\.\.|\1 Processing triggers for:|Processing triggers for ([[:print:]]+) \([[:print:]]+\) \.\.\.|\1 Purging configuration files:|Purging configuration files for ([[:print:]]+) \([[:print:]]+\) \.\.\.|\1 @@ -23,7 +23,8 @@ Setting up:|Setting up ([[:print:]]+) \([[:print:]]+\) \.\.\.|\1 Updating to current default:|Updating ([[:print:]]+) to current default.|\1 disabled or static unit, so not starting:|([[:print:]]+) is a disabled or a static unit, not starting it\.|\1 disabled or static unit not running, so not starting:|([[:print:]]+) is a disabled or a static unit not running, not starting it\.|\1 -dpkg warning: unable to delete old directories (not empty):|dpkg: warning: unable to delete old directory '"'"'([[:print:]]+)'"'"': Directory not empty|\1 +BECOME_NEXT_PREFIX|dpkg: ([[:print:]]+) dependency problems, but removing anyway as you requested:|dpkg warns: despite dependency problems, removing \1 – dependencies: +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)]' _LAST_PREFIX='' @@ -40,6 +41,12 @@ DEBIAN_FRONTEND=noninteractive apt-get -y $1 2>&1 | while read _LINE; do _REPLACEMENT=$(printf '%s' "${_WHITESPACED}" | cut -d'|' -f3) if printf '%s' "${_LINE}" | grep -E "${_PATTERN}" > /dev/null; then _COMPRESSED_ITEM=$(printf '%s' "${_LINE}" | sed -E "s|${_PATTERN}|${_REPLACEMENT}|") + if [ "${_PREFIX}" = "BECOME_NEXT_PREFIX" ]; then + _LEADER_PREFIX="${_COMPRESSED_ITEM}" + _COMPRESSED_ITEM=IGNORE + elif [ "${_PREFIX}" = "FOLLOW_PREFIX" ]; then + _PREFIX="${_LEADER_PREFIX}" + fi break fi done -- 2.30.2