# but still .pc files should be found for all RDEPENDable prefixes in
# the chain.
echo "PKG_CONFIG_PATH=\"/usr/lib/pkgconfig:/usr/share/pkgconfig\"" >> etc/env.d/00basic
+ echo "PORTAGE_OVERRIDE_EPREFIX=\"${EPREFIX}\"" >> etc/env.d/00basic
+ echo "PORTAGE_CONFIGROOT=\"${EPREFIX}\"" >> etc/env.d/00basic
+ echo "EPREFIX=\"${EPREFIX}\"" >> etc/env.d/00basic
fi
default
}
sed \
-e "/PATH=/!s:/\(etc\|usr/bin\|bin\):\"${EPREFIX}\"/\1:g" \
-e "/PATH=/s|\([:\"]\)/|\1${EPREFIX}/|g" \
- -e "/PATH=.*\/sbin/s|\"$|:/usr/sbin:/sbin\"|" \
- -e "/PATH=.*\/bin/s|\"$|:/usr/bin:/bin\"|" \
etc/profile > "${ED}"/etc/profile || die
+ if ! use prefix-chaining; then
+ sed \
+ -e "/PATH=.*\/sbin/s|\"$|:/usr/sbin:/sbin\"|" \
+ -e "/PATH=.*\/bin/s|\"$|:/usr/bin:/bin\"|" \
+ -i "${ED}"/etc/profile || die
+ fi
dodir etc/env.d
sed \
-e "s:/\(etc/env.d\|opt\|usr\):${EPREFIX}/\1:g" \
--- baselayout-2.2/etc/profile.orig 2017-03-23 16:46:29.922123300 +0100
+++ baselayout-2.2/etc/profile 2017-03-23 16:58:43.578360900 +0100
-@@ -4,6 +4,40 @@
+@@ -4,6 +4,46 @@
# environment for login shells.
#
+# we have here, and thus it will source parents before
+# evaluating anything from itself.
+#
-+_ro_root=$(. /etc/make.conf && echo $READONLY_EPREFIX)
++if [[ -r /etc/portage/make.conf ]]; then
++ _ro_root=$(. /etc/portage/make.conf && echo $READONLY_EPREFIX)
++elif [[ -r /etc/make.conf ]]; then
++ _ro_root=$(. /etc/make.conf && echo $READONLY_EPREFIX)
++else
++ echo "Failed to read" /etc/portage/make.conf >&2
++fi
+_ro_deps=${_ro_root#*:}
+_ro_root=${_ro_root%:*}
+if [ -n "${_ro_root}" -a -f "${_ro_root}/"etc/profile ]; then
# Load environment settings from profile.env, which is created by
# env-update from the files in /etc/env.d
if [ -e /etc/profile.env ] ; then
-@@ -61,3 +95,17 @@
+@@ -61,3 +101,17 @@
[ -r "$sh" ] && . "$sh"
done
unset sh