summaryrefslogtreecommitdiffstats
path: root/debian/zutils.preinst
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 12:58:25 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 12:58:25 +0000
commitf8b544ad8eef4c7cfea133073d7360cb4e44ddf3 (patch)
tree7d9d190039f70569d87e655b4ac9ecc0e5f5ae4a /debian/zutils.preinst
parentAdding upstream version 1.13. (diff)
downloadzutils-f8b544ad8eef4c7cfea133073d7360cb4e44ddf3.tar.xz
zutils-f8b544ad8eef4c7cfea133073d7360cb4e44ddf3.zip
Adding debian version 1.13-2.debian/1.13-2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-xdebian/zutils.preinst59
1 files changed, 59 insertions, 0 deletions
diff --git a/debian/zutils.preinst b/debian/zutils.preinst
new file mode 100755
index 0000000..3fa0faf
--- /dev/null
+++ b/debian/zutils.preinst
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+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 "/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
+ ;;
+
+ upgrade)
+ for FILE in zcat zcmp zdiff zegrep zfgrep zgrep
+ do
+ TRUENAME=$(dpkg-divert --truename "/usr/bin/${FILE}")
+
+ if [ "${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/${FILE}.gzip.usr-is-merged" "/bin/${FILE}"
+ elif [ "${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 [ "${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 [ -e "${DPKG_ROOT}${TRUENAME}" ] || [ -h "${DPKG_ROOT}${TRUENAME}" ]
+ then
+ mv "${DPKG_ROOT}${TRUENAME}" "${DPKG_ROOT}/bin/${FILE}.gzip.usr-is-merged"
+ fi
+ fi
+ fi
+ done
+ ;;
+ abort-upgrade)
+
+ ;;
+
+ *)
+ echo "preinst called with unknown argument \`${1}'" >&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0