commit: c74e2d6e928af3c16b49710b6069b48a61c99543
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 1 22:29:50 2024 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Fri Mar 1 23:11:54 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c74e2d6e
profiles: 23.0: Prevent footguns for lack of reading comprehension
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
profiles/features/split-usr/make.defaults | 2 ++
profiles/releases/23.0/profile.bashrc | 20 ++++++++++++++++++++
2 files changed, 22 insertions(+)
diff --git a/profiles/features/split-usr/make.defaults
b/profiles/features/split-usr/make.defaults
new file mode 100644
index 000000000000..9d42deee4999
--- /dev/null
+++ b/profiles/features/split-usr/make.defaults
@@ -0,0 +1,2 @@
+# Set an environment variable so we can easily test for the profile type
+PROFILE_23_USRTYPE=split-usr
diff --git a/profiles/releases/23.0/profile.bashrc
b/profiles/releases/23.0/profile.bashrc
new file mode 100644
index 000000000000..258d9754e5bb
--- /dev/null
+++ b/profiles/releases/23.0/profile.bashrc
@@ -0,0 +1,20 @@
+if [[ "${EBUILD_PHASE}" == "setup" ]] ; then
+ if [[ ! -h "${EROOT%/}/bin" ]] && [[ "${PROFILE_23_USRTYPE}" !=
"split-usr" ]] ; then
+ eerror ""
+ eerror "Your profile is of type merged-usr, but your
directories"
+ eerror "on-disk are of type split-usr."
+ eerror "Please switch back to your last valid profile setting
and"
+ eerror "read the documentation about merged-usr and profile
changes."
+ eerror ""
+ die "ERROR: 23.0 merged-usr profile, but disk is split-usr"
+ fi
+ if [[ -h "${EROOT%/}/bin" ]] && [[ "${PROFILE_23_USRTYPE}" ==
"split-usr" ]] ; then
+ eerror ""
+ eerror "Your profile is of type split-usr, but your directories"
+ eerror "on-disk are of type merged-usr."
+ eerror "Please switch back to your last valid profile setting
and"
+ eerror "read the documentation about merged-usr and profile
changes."
+ eerror ""
+ die "ERROR: 23.0 split-usr profile, but disk is merged-usr"
+ fi
+fi