[Pkg-zfsonlinux-devel] Bug#986374: zfs-zed: broken purge detection in postrm script

наб nabijaczleweli at nabijaczleweli.xyz
Sun Apr 4 17:29:18 BST 2021


Package: zfs-zed
Version: 2.0.3-5
Severity: normal
Tags: patch

Dear Maintainer,

Confer:
-- >8 --
Preparing to unpack .../8-zfs-zed_2.0.3-5_amd64.deb ...
Unpacking zfs-zed (2.0.3-5) over (2.0.3-2) ...
/var/lib/dpkg/info/zfs-zed.postrm: 7: [: upgrade: unexpected operator
Preparing to unpack .../9-libnettle8_3.7.2-1_amd64.deb ...
-- >8 --

Line 7 of zfs-zed.postrm reads:
  if [ "$1" == "purge" ] && [ -d "$etcd" ] ;

This is wrong (bash accepts "[[ a == b ]]", I think,
but that's neither here nor there); consider the following patch:
-- >8 --
diff --git a/debian/zfs-zed.postrm b/debian/zfs-zed.postrm
index 2c50a5027..e9aed3f4c 100644
--- a/debian/zfs-zed.postrm
+++ b/debian/zfs-zed.postrm
@@ -4,7 +4,7 @@ set -e
 zedd="/usr/lib/zfs-linux/zed.d"
 etcd="/etc/zfs/zed.d"
 
-if [ "$1" == "purge" ] && [ -d "$etcd" ] ; then
+if [ "$1" = "purge" ] && [ -d "$etcd" ] ; then
     # remove the overrides created in prerm
     find "${etcd}" -maxdepth 1 -lname '/dev/null' -delete
     # remove any dangling symlinks to old zedlets
-- >8 --

Best,
наб

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

Kernel: Linux 5.10.0-3-amd64 (SMP w/8 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages zfs-zed depends on:
ii  init-system-helpers     1.60
ii  libc6                   2.31-11
ii  libnvpair3linux         2.0.3-5
ii  libudev1                247.3-3
ii  libuuid1                2.36.1-7
ii  libuutil3linux          2.0.3-5
ii  libzfs4linux            2.0.3-5
ii  zfs-dkms [zfs-modules]  2.0.3-5
ii  zfsutils-linux          2.0.3-5

zfs-zed recommends no packages.

zfs-zed suggests no packages.

-- no debconf information
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-zfsonlinux-devel/attachments/20210404/71d80a42/attachment.sig>


More information about the Pkg-zfsonlinux-devel mailing list