summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-12-20 10:08:54 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-12-20 10:09:34 +0000
commitcf2a54b393b367576a87e77bc85ee58c3d624ad5 (patch)
tree4fec14ea4705ec00005e751cc890306fcd5c19d6
parentReleasing debian version 20211009-21. (diff)
downloadbfh-metapackages-cf2a54b393b367576a87e77bc85ee58c3d624ad5.tar.xz
bfh-metapackages-cf2a54b393b367576a87e77bc85ee58c3d624ad5.zip
Applying patch from Helmut Grohne <helmut@subdivi.de> to duplicate diversion via DEP17 M18 (Closes: #1055509).
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
-rwxr-xr-xdebian/bfh-container.postrm6
-rwxr-xr-xdebian/bfh-container.preinst28
2 files changed, 29 insertions, 5 deletions
diff --git a/debian/bfh-container.postrm b/debian/bfh-container.postrm
index ec69346..0af1095 100755
--- a/debian/bfh-container.postrm
+++ b/debian/bfh-container.postrm
@@ -6,12 +6,12 @@ case "${1}" in
remove)
for FILE in halt poweroff reboot shutdown coldreboot
do
- dpkg-divert --package bfh-container --quiet --remove --rename --divert /lib/container/divert/${FILE}.orig /sbin/${FILE}
+ dpkg-divert --package bfh-container --quiet --remove --rename --divert "/lib/container/divert/${FILE}.orig.usr-is-merged" "/sbin/${FILE}"
done
- for FILE in pm-hibernate pm-suspend pm-suspend-hybrid
+ for FILE in halt poweroff reboot shutdown coldreboot pm-hibernate pm-suspend pm-suspend-hybrid
do
- dpkg-divert --package bfh-container --quiet --remove --rename --divert /lib/container/divert/${FILE}.orig /usr/sbin/${FILE}
+ dpkg-divert --package bfh-container --quiet --remove --rename --divert "/usr/lib/container/divert/${FILE}.orig" "/usr/sbin/${FILE}"
done
;;
diff --git a/debian/bfh-container.preinst b/debian/bfh-container.preinst
index 335d160..3bf584f 100755
--- a/debian/bfh-container.preinst
+++ b/debian/bfh-container.preinst
@@ -8,12 +8,36 @@ case "${1}" in
for FILE in halt poweroff reboot shutdown coldreboot
do
- dpkg-divert --package bfh-container --quiet --add --rename --divert /lib/container/divert/${FILE}.orig /sbin/${FILE}
+ TRUENAMEUSR=$(dpkg-divert --truename "/usr/sbin/$FILE")
+ TRUENAMEALIAS=$(dpkg-divert --truename "/sbin/$FILE")
+ RENAME_FLAG=--no-rename
+ if test "$TRUENAMEUSR" = "/usr/sbin/$FILE"; then
+ if test "$TRUENAMEALIAS" = "/sbin/$FILE"; then
+ RENAME_FLAG=--rename
+ fi
+ dpkg-divert --package bfh-container --quiet --add "$RENAME_FLAG" --divert "/usr/lib/container/divert/$FILE.orig" "/usr/sbin/$FILE"
+ fi
+ # DEP17 M18 duplicated diversion. Can be removed after trixie.
+ if test "$TRUENAMEALIAS" = "/sbin/$FILE"; then
+ dpkg-divert --package bfh-container --quiet --add "$RENAME_FLAG" --divert "/lib/container/divert/$FILE.orig.usr-is-merged" "/sbin/$FILE"
+ elif test "$TRUENAMEALIAS" != "/lib/container/divert/$FILE.orig.usr-is-merged"; then
+ dpkg-divert --package bfh-container --quiet --remove --no-rename "/sbin/$FILE"
+ dpkg-divert --package bfh-container --quiet --add --no-rename --divert "/lib/container/divert/$FILE.orig.usr-is-merged" "/sbin/$FILE"
+ if test -e "$TRUENAMEALIAS" || test -h "$TRUENAMEALIAS"; then
+ mv "$TRUENAMEALIAS" "/lib/container/divert/$FILE.orig.usr-is-merged"
+ fi
+ fi
done
for FILE in pm-hibernate pm-suspend pm-suspend-hybrid
do
- dpkg-divert --package bfh-container --quiet --add --rename --divert /lib/container/divert/${FILE}.orig /usr/sbin/${FILE}
+ TRUENAMEUSR=$(dpkg-divert --truename "/usr/sbin/$FILE")
+ if test "$TRUENAMEUSR" = "/lib/container/divert/$FILE.orig"; then
+ dpkg-divert --package bfh-container --quiet --remove --no-rename "/usr/sbin/$FILE"
+ dpkg-divert --package bfh-container --quiet --add --no-rename --divert "/usr/lib/container/divert/$FILE.orig" "/usr/sbin/$FILE"
+ else
+ dpkg-divert --package bfh-container --quiet --add --rename --divert "/usr/lib/container/divert/$FILE.orig" "/usr/sbin/$FILE"
+ fi
done
;;