Package: debhelper Version: 13.3.4 Severity: normal Tags: patch Recently we decided to ship two binary versions of squid, one compiled with gnutls and the other with openssl, as the code provides different features depending with what is compiled.
I decided to produce two binary packages conflicting with each other, squid and squid-openssl but that provide the same service squid.service The problem comes when we purge one that is removed when the other is installed, I see the problem on the automatic added sections of the postrm script. I have filled a bug on squid explaining the problem (#984880) and tried to explain this here: https://lists.debian.org/debian-mentors/2021/03/msg00022.html The problem is with both dh_installinit and dh_installsystemd, I have prepared a patch based on the dh_apparmor's code which does have checks for this. I don't know debhelper's code, and even tough this patch works ok for me, the plural of #UNITFILES# makes me think that it can have several files on it wich would make my patch fail on this case, I hope the patch gives you the idea of what would be needed. Fixing this bug would be needed to fix bug #984880 on squid for Bullseye, I don't know if it is possible to have a fix for this on debhelper or if we should try to woraround this on squid's postrm script, I hope that you can have a look at this and let me know. Regards. -- System Information: Debian Release: bullseye/sid APT prefers testing APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (101, 'experimental') Architecture: amd64 (x86_64) Kernel: Linux 5.10.0-4-amd64 (SMP w/4 CPU threads) Kernel taint flags: TAINT_WARN, TAINT_FIRMWARE_WORKAROUND, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE Locale: LANG=gl_ES.UTF-8, LC_CTYPE=gl_ES.UTF-8 (charmap=UTF-8), LANGUAGE not set Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled Versions of packages debhelper depends on: ii autotools-dev 20180224.1+nmu1 ii dh-autoreconf 20 ii dh-strip-nondeterminism 1.11.0-1 ii dpkg 1.20.7.1 ii dpkg-dev 1.20.7.1 ii dwz 0.13+20210201-1 ii file 1:5.39-3 ii libdebhelper-perl 13.3.4 ii libdpkg-perl 1.20.7.1 ii man-db 2.9.4-2 ii perl 5.32.1-3 ii po-debconf 1.0.21+nmu1 debhelper recommends no packages. Versions of packages debhelper suggests: ii dh-make 2.202003 -- no debconf information
diff --git a/autoscripts/postrm-init b/autoscripts/postrm-init index 1c292982..acd7dc76 100644 --- a/autoscripts/postrm-init +++ b/autoscripts/postrm-init @@ -1,3 +1,3 @@ -if [ "$1" = "purge" ] ; then +if [ "$1" = "purge" ] && ! [ -e "/etc/init.d/#SCRIPT#" ]; then update-rc.d #SCRIPT# remove >/dev/null fi diff --git a/autoscripts/postrm-systemd b/autoscripts/postrm-systemd index d95013b6..3850e016 100644 --- a/autoscripts/postrm-systemd +++ b/autoscripts/postrm-systemd @@ -4,7 +4,8 @@ if [ "$1" = "remove" ]; then fi fi -if [ "$1" = "purge" ]; then +UNITFILES=#UNITFILES# +if [ "$1" = "purge" ] && ! [ -e "/lib/systemd/system/$UNITFILES" ]; then if [ -x "/usr/bin/deb-systemd-helper" ]; then deb-systemd-helper purge #UNITFILES# >/dev/null || true deb-systemd-helper unmask #UNITFILES# >/dev/null || true