summaryrefslogtreecommitdiff
path: root/profiles/releases
diff options
context:
space:
mode:
Diffstat (limited to 'profiles/releases')
-rw-r--r--profiles/releases/23.0/profile.bashrc43
1 files changed, 40 insertions, 3 deletions
diff --git a/profiles/releases/23.0/profile.bashrc b/profiles/releases/23.0/profile.bashrc
index 6c178b086158..ae82a4b3216e 100644
--- a/profiles/releases/23.0/profile.bashrc
+++ b/profiles/releases/23.0/profile.bashrc
@@ -1,5 +1,40 @@
-if [[ "${EBUILD_PHASE}" == "setup" ]] && [[ -e "${EROOT%/}/bin" ]] ; then
- if [[ ! -h "${EROOT%/}/bin" ]] && [[ "${PROFILE_23_USRTYPE}" != "split-usr" ]] ; then
+
+__gentoo_get_disk_splitmerge() {
+ # does /bin exist? important for baselayout
+ if [[ -e "${EROOT%/}/bin" ]] ; then
+ # is /bin a symlink?
+ if [[ -h "${EROOT%/}/bin" ]] ; then
+ echo -n merged
+ else
+ echo -n split
+ fi
+ else
+ echo -n unknown
+ fi
+}
+
+__gentoo_get_profile_splitmerge() {
+ # does /etc/portage/make.profile exist and is a symlink?
+ if [[ -h "${EROOT%/}/etc/portage/make.profile" ]] ; then
+ local linktarget=$(readlink "${EROOT%/}/etc/portage/make.profile")
+
+ # 23.0 profile?
+ if [[ "${linktarget}" == */23.0* ]] ; then
+ if [[ "${linktarget}" == *split-usr* ]] ; then
+ echo -n split
+ else
+ echo -n merged
+ fi
+ else
+ echo -n unknown
+ fi
+ else
+ echo -n unknown
+ fi
+}
+
+if [[ "${EBUILD_PHASE}" == "setup" ]] ; then
+ if [[ $(__gentoo_get_disk_splitmerge) == "split" ]] && [[ $(__gentoo_get_profile_splitmerge) == "merged" ]] ; then
eerror ""
eerror "Your profile is of type merged-usr, but your directories"
eerror "on-disk are of type split-usr."
@@ -8,7 +43,7 @@ if [[ "${EBUILD_PHASE}" == "setup" ]] && [[ -e "${EROOT%/}/bin" ]] ; then
eerror ""
die "ERROR: 23.0 merged-usr profile, but disk is split-usr"
fi
- if [[ -h "${EROOT%/}/bin" ]] && [[ "${PROFILE_23_USRTYPE}" == "split-usr" ]] ; then
+ if [[ $(__gentoo_get_disk_splitmerge) == "merged" ]] && [[ $(__gentoo_get_profile_splitmerge) == "split" ]] ; then
eerror ""
eerror "Your profile is of type split-usr, but your directories"
eerror "on-disk are of type merged-usr."
@@ -18,3 +53,5 @@ if [[ "${EBUILD_PHASE}" == "setup" ]] && [[ -e "${EROOT%/}/bin" ]] ; then
die "ERROR: 23.0 split-usr profile, but disk is merged-usr"
fi
fi
+
+unset -f __gentoo_get_disk_splitmerge __gentoo_get_profile_splitmerge