zfsonlinux/debian/libzfs6linux.preinst
Stoiko Ivanov 8b4e7cdfc6 cherry-pick usr-merge fix for libzfs6linux
moving file canonical locations from e.g. /lib to /usr/lib (usr-merge)
while renaming a package (libzfs4linux -> libzfs6linux) could result
in file deletions during upgrades. The following workaround has been
used in debian upstream.

see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1092598 for the
details.

based on commit 0431247714965007bc156fd57852689b395b2bae
https://salsa.debian.org/zfsonlinux-team/zfs/

Originally-by: Shengqi Chen <harry-chen@outlook.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2025-06-02 14:19:47 +02:00

17 lines
458 B
Bash

#!/bin/sh
set -e
if test "$1" = install -o "$1" = upgrade; then
# DEP17 P1 M8: Divert aliased files to avoid their removal deleting the
# moved ones. These diversions should be removed via postinst once
# trixie is released.
for lib in zfs_core.so.3 zfs_core.so.3.0.0; do
dpkg-divert --package libzfs6linux --no-rename --divert "/lib/#DEB_HOST_MULTIARCH#/lib$lib.usr-is-merged" --add "/lib/#DEB_HOST_MULTIARCH#/lib$lib"
done
fi
#DEBHELPER#
exit 0