Package: apticron
Version: 1.2.3+nmu1
Severity: normal

>From 1181855699a4cf14c8d8ed17ba0eb81403f93eeb Mon Sep 17 00:00:00 2001
From: Jonathan Kamens <j...@kamens.us>
Date: Tue, 23 Mar 2021 15:58:45 -0400
Subject: [PATCH] Fix NOTIFY_HOLDS=0 behavior with multiarch

When using multiarch, the output of `dpkg --get-selections` appends
the system's base architecture to the ends of some packages names, but
the output of `apt-get -q -y -s dist-upgrade` does not, with the
result that when NOTIFY_HOLDS=0 some packages don't get filtered out
of the output when they should be.

Fix this by stripping the system's base architecture from package
names in the `dpkg` output so they can be correctly filtered out of
the `apt-get` output.
---
 apticron | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/apticron b/apticron
index dcce1f6..aba64e7 100755
--- a/apticron
+++ b/apticron
@@ -129,7 +129,7 @@ done
 
 # workaround to handle apt-get installing packages hold by aptitude. See 
#137771.
 APTITUDE_HOLDS=`grep "^State: 2" -B 3 /var/lib/aptitude/pkgstates 2>/dev/null 
|grep "^Package: .*$" |cut -d" " -f 2`
-DSELECT_HOLDS=`dpkg --get-selections |grep "hold$" |cut -f1`
+DSELECT_HOLDS=`dpkg --get-selections |grep "hold$" |cut -f1 |sed -e "s/:$(dpkg 
--print-architecture)$//"`
 
 if [ "$NOTIFY_HOLDS" = "0" ]; then
        # packages hold by aptitude don't go to the upgrading candidates list
-- 
2.30.2

Reply via email to