This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=57e084a52e1ede33b7914c3e0357311ac370a186

commit 57e084a52e1ede33b7914c3e0357311ac370a186
Author: Guillem Jover <guil...@debian.org>
AuthorDate: Mon Feb 7 18:18:03 2022 +0100

    debian: Warn in postinst about merged-/usr-via-aliased-dirs breakage
    
    dpkg does not, and has never supported this filesystem layout even less
    so the way it has been deployed as it bypasses dpkg entirely. It can
    cause file loss, file overwrites, unexpected query results, among other
    things, while being very insidious to detect if one is not aware. Adding
    support for it would be rather infeasible and gets in the way of features
    that have been on the works for some time now.
---
 debian/dpkg.postinst | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/debian/dpkg.postinst b/debian/dpkg.postinst
index efa879c20..f19ddaff1 100644
--- a/debian/dpkg.postinst
+++ b/debian/dpkg.postinst
@@ -3,10 +3,24 @@
 
 set -e
 
+PROGNAME=dpkg
+
 . /usr/share/dpkg/sh/dpkg-error.sh
 
 setup_colors
 
+check_merged_usr_via_aliased_dirs()
+{
+  for d in /bin /sbin /lib /lib32 /libo32 /libx32 /lib64; do
+    linkname="$(readlink $DPKG_ROOT$d || true)"
+    if [ "$linkname" = "usr$d" ] || [ "$linkname" = "/usr$d" ]; then
+      warning "System unsupported due to merged-usr-via-aliased-dirs."
+      warning "See <https://wiki.debian.org/Teams/Dpkg/FAQ#broken-usrmerge>."
+      break
+    fi
+  done
+}
+
 # Version 1.21.0 had bogus handling of DPKG_ADMINDIR in update-alternatives,
 # and misplaced them, fix them up.
 fixup_misplaced_alternatives()
@@ -55,6 +69,8 @@ fixup_misplaced_alternatives()
 case "$1" in
 configure)
   fixup_misplaced_alternatives
+
+  check_merged_usr_via_aliased_dirs
   ;;
 abort-upgrade|abort-deconfigure|abort-remove)
   ;;

-- 
Dpkg.Org's dpkg

Reply via email to