summaryrefslogtreecommitdiffstats
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
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>
-rwxr-xr-xdebian/rules2
-rwxr-xr-xdebian/zutils.postrm3
-rwxr-xr-xdebian/zutils.preinst30
3 files changed, 31 insertions, 4 deletions
diff --git a/debian/rules b/debian/rules
index c401a4b..1085be4 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,7 +6,7 @@ include /usr/share/dpkg/buildtools.mk
dh ${@}
override_dh_auto_configure:
- dh_auto_configure -- --exec-prefix=/ CXX=$(CXX)
+ dh_auto_configure -- CXX=$(CXX)
override_dh_auto_install:
dh_auto_install -- DESTDIR=$(CURDIR)/debian/zutils
diff --git a/debian/zutils.postrm b/debian/zutils.postrm
index b9df41b..e9ad406 100755
--- a/debian/zutils.postrm
+++ b/debian/zutils.postrm
@@ -6,7 +6,8 @@ case "${1}" in
remove)
for FILE in zcat zcmp zdiff zegrep zfgrep zgrep
do
- dpkg-divert --package zutils --quiet --remove --rename --divert /bin/${FILE}.gzip /bin/${FILE}
+ dpkg-divert --package zutils --quiet --remove --rename --divert "/usr/bin/$FILE.gzip" "/usr/bin/$FILE"
+ dpkg-divert --package zutils --quiet --remove --rename --divert "/bin/$FILE.gzip.usr-is-merged" "/bin/$FILE"
dpkg-divert --package zutils --quiet --remove --rename --divert /usr/share/man/man1/${FILE}.gzip.1.gz /usr/share/man/man1/${FILE}.1.gz
done
;;
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)
;;