home · contact · privacy
Fix.
authorChristian Heller <c.heller@plomlompom.de>
Thu, 1 May 2025 02:33:22 +0000 (04:33 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 1 May 2025 02:33:22 +0000 (04:33 +0200)
bookworm/scripts/lib/apt_get_edited

index 839e82d8ef01a5c23022f06ba8d9d8de82c15fa6..5d77d51d407edaf1a3528aaacf7490d6718c7de8 100644 (file)
@@ -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