Package: universal-ctags
Version: 0+git20200824-1.1.g15ce0a8
Severity: serious
Tags: patch
Justification: Policy 6.4

This is a clean buster container where I tested upgrading
universal-ctags:

root@1066c7b1da18:/# apt install -qy universal-ctags
Reading package lists...
Building dependency tree...
Reading state information...
The following packages will be upgraded:
  universal-ctags
1 upgraded, 0 newly installed, 0 to remove and 92 not upgraded.
Need to get 442 kB of archives.
After this operation, 311 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bullseye/main amd64 universal-ctags amd64 
0+git20200824-1 [442 kB]
Fetched 442 kB in 5s (87.9 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
(Reading database ... 8631 files and directories currently installed.)
Preparing to unpack .../universal-ctags_0+git20200824-1_amd64.deb ...
prerm called with unknown argument `upgrade'
dpkg: warning: old universal-ctags package pre-removal script subprocess 
returned error exit status 1
dpkg: trying script from the new package instead ...
dpkg: ... it looks like that went OK
Unpacking universal-ctags (0+git20200824-1) over (0+git20181215-2) ...
Setting up universal-ctags (0+git20200824-1) ...
update-alternatives: using /usr/bin/ctags-universal to provide /usr/bin/etags 
(etags) in auto mode

It seems that dpkg works around the issue somehow, but still prerm
should not exit non-zero. The script will also fail similarly when prerm
is called with "deconfigure".

The attached patch fixes both cases.

-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'testing-debug'), (500, 
'unstable'), (500, 'testing'), (1, 'experimental-debug'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: arm64

Kernel: Linux 5.10.0-5-amd64 (SMP w/4 CPU threads)
Locale: LANG=pt_BR.UTF-8, LC_CTYPE=pt_BR.UTF-8 (charmap=UTF-8), 
LANGUAGE=pt_BR:pt:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages universal-ctags depends on:
ii  libc6        2.31-10
ii  libjansson4  2.13.1-1.1
ii  libseccomp2  2.5.1-1
ii  libxml2      2.9.10+dfsg-6.3+b1
ii  libyaml-0-2  0.2.2-1

universal-ctags recommends no packages.

Versions of packages universal-ctags suggests:
ii  vim             2:8.2.2434-3
ii  vim-gtk3 [vim]  2:8.2.2434-3

-- no debconf information
From 490f13d5b473059dd873deab5f1f1b64e12f4f40 Mon Sep 17 00:00:00 2001
From: Antonio Terceiro <terce...@debian.org>
Date: Sat, 3 Apr 2021 17:05:57 -0300
Subject: [PATCH 2/2] debian/prerm: handle upgrade/removal scenarios correctly

---
 debian/prerm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/debian/prerm b/debian/prerm
index 6ebf9a2..4b4d130 100644
--- a/debian/prerm
+++ b/debian/prerm
@@ -3,12 +3,12 @@
 set -e
 
 case "$1" in
-    remove)
+    remove|deconfigure)
         update-alternatives --remove ctags /usr/bin/ctags-universal
         update-alternatives --remove etags /usr/bin/ctags-universal
     ;;
 
-    failed-upgrade)
+    upgrade|failed-upgrade)
     ;;
 
     *)
-- 
2.31.0

Attachment: signature.asc
Description: PGP signature

Reply via email to