summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Helmut Grohne <[email protected]>2024-08-01 12:20:00 +0200
committerLibravatar Santiago Vila <[email protected]>2024-08-01 12:26:37 +0200
commite3b12aade13ee30d29f79ec173b5cc4763e4636a (patch)
treecaf5e7d96004bc5418d68fa6585c57eb9d77ae1a
parent34a8a4d648362b15fad9f4ffa283e3a52c7f6b9e (diff)
downloadbase-files-e3b12aade13ee30d29f79ec173b5cc4763e4636a.tar.gz
base-files-e3b12aade13ee30d29f79ec173b5cc4763e4636a.zip
Tighten the merged-/usr preinst check. Closes: #1076491.
Diffstat (limited to '')
-rw-r--r--debian/preinst20
1 files changed, 16 insertions, 4 deletions
diff --git a/debian/preinst b/debian/preinst
index b657de5..3e8b0cd 100644
--- a/debian/preinst
+++ b/debian/preinst
@@ -2,17 +2,29 @@
set -e
if [ "$1" = "install" ] || [ "$1" = "upgrade" ]; then
+ msg=
for d in bin lib lib32 lib64 libo32 lib64 sbin; do
- if [ -d "$DPKG_ROOT/$d" ] && [ ! -L "$DPKG_ROOT/$d" ]; then
+ if [ -L "$DPKG_ROOT/$d" ]; then
+ if [ "$(readlink "$DPKG_ROOT/$d")" != "usr/$d" ]; then
+ msg="/$d is a symbolic link and not pointing at usr/$d exactly"
+ elif [ ! -d "$DPKG_ROOT/usr/$d" ]; then
+ msg="/$d is a dangling symbolic link"
+ fi
+ msg2="This is an unexpected situation. Cannot proceed with the upgrade"
+ elif [ -d "$DPKG_ROOT/$d" ]; then
+ msg="/$d is a directory, but should be a symbolic link"
+ msg2="Please install the usrmerge package to convert this system to merged-/usr"
+ fi
+ if [ -n "$msg" ]; then
cat <<EOF
******************************************************************************
*
-* The base-files package cannot be installed because this system has a
-* split /usr.
+* The base-files package cannot be installed because
+* $msg.
*
-* Please install the usrmerge package to convert this system to merged-/usr.
+* $msg2.
*
* For more information please read https://wiki.debian.org/UsrMerge.
*