summaryrefslogtreecommitdiffstats
path: root/debian/zutils.preinst
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-03-06 06:17:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-03-06 06:17:42 +0000
commitfb1e6c581d89893dd24f615f8af48e9dbe38d57c (patch)
tree8278beec9b7140a5b760117861df1df84888d038 /debian/zutils.preinst
parentReleasing debian version 1.13-1. (diff)
downloadzutils-fb1e6c581d89893dd24f615f8af48e9dbe38d57c.tar.xz
zutils-fb1e6c581d89893dd24f615f8af48e9dbe38d57c.zip
Applying patch from Helmut Grohne <helmut@subdivi.de> to duplicate diversion via DEP17 M18 (Closes: #1059534).
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-xdebian/zutils.preinst30
1 files changed, 28 insertions, 2 deletions
diff --git a/debian/zutils.preinst b/debian/zutils.preinst
index dde1340..61b5109 100755
--- a/debian/zutils.preinst
+++ b/debian/zutils.preinst
@@ -2,16 +2,42 @@
set -e
+# DEP17 M18: Duplicate diversion in aliased location /bin.
+
case "${1}" in
install)
for FILE in zcat zcmp zdiff zegrep zfgrep zgrep
do
- dpkg-divert --package zutils --quiet --add --rename --divert /bin/${FILE}.gzip /bin/${FILE}
+ dpkg-divert --package zutils --quiet --add --rename --divert "/usr/bin/$FILE.gzip" "/usr/bin/$FILE"
+ dpkg-divert --package zutils --quiet --add --rename --divert "/bin/$FILE.gzip.usr-is-merged" "/bin/$FILE"
dpkg-divert --package zutils --quiet --add --rename --divert /usr/share/man/man1/${FILE}.gzip.1.gz /usr/share/man/man1/${FILE}.1.gz
done
;;
- abort-upgrade|upgrade)
+ upgrade)
+ for FILE in zcat zcmp zdiff zegrep zfgrep zgrep
+ do
+ TRUENAME=$(dpkg-divert --truename "/usr/bin/$FILE")
+ if test "$TRUENAME" = "/usr/bin/$FILE.usr-is-merged"; then
+ # gzip.preinst duplicated the diversion for us
+ dpkg-divert --package zutils --quiet --remove --no-rename --divert "/usr/bin/$FILE.usr-is-merged" "/usr/bin/$FILE"
+ dpkg-divert --package zutils --quiet --remove --no-rename "/bin/$FILE"
+ dpkg-divert --package zutils --quiet --add --no-rename --divert "/usr/bin/$FILE.gzip" "/usr/bin/$FILE"
+ dpkg-divert --package zutils --quiet --add --no-rename --divert "/bin/$TOOL.gzip.usr-is-merged" "/bin/$TOOL"
+ elif test "$TRUENAME" != "/usr/bin/$FILE.gzip"; then
+ dpkg-divert --package zutils --quiet --add --no-rename --divert "/usr/bin/$FILE.gzip" "/usr/bin/$FILE"
+ TRUENAME=$(dpkg-divert --truename "/bin/$FILE")
+ if test "$TRUENAME" != "/bin/$FILE.gzip.usr-is-merged"; then
+ dpkg-divert --package zutils --quiet --remove --no-rename "/bin/$FILE"
+ dpkg-divert --package zutils --quiet --add --no-rename --divert "/bin/$FILE.gzip.usr-is-merged" "/bin/$FILE"
+ if test -e "$DPKG_ROOT$TRUENAME" -o -h "$DPKG_ROOT$TRUENAME"; then
+ mv "$DPKG_ROOT$TRUENAME" "$DPKG_ROOT/bin/$FILE.gzip.usr-is-merged"
+ fi
+ fi
+ fi
+ done
+ ;;
+ abort-upgrade)
;;