summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Haubenwallner <haubi@gentoo.org>2017-04-05 16:07:06 +0200
committerMichael Haubenwallner <haubi@gentoo.org>2017-04-05 16:07:20 +0200
commit8984aa4a29074f6040de6ff6630391ecb6925dc3 (patch)
tree8e80cf06d7490bb7952f5458e3f177e7e93d315b /sys-apps/baselayout-prefix
parentmedia-libs/libebur128-1.2.0-r1: add alpha keyword (diff)
downloadgentoo-8984aa4a29074f6040de6ff6630391ecb6925dc3.tar.gz
gentoo-8984aa4a29074f6040de6ff6630391ecb6925dc3.tar.bz2
gentoo-8984aa4a29074f6040de6ff6630391ecb6925dc3.zip
sys-apps/baselayout-prefix: fix etc/profile in chained prefix
Package-Manager: portage-2.3.3
Diffstat (limited to 'sys-apps/baselayout-prefix')
-rw-r--r--sys-apps/baselayout-prefix/baselayout-prefix-2.2-r5.ebuild11
-rw-r--r--sys-apps/baselayout-prefix/files/baselayout-2.2-prefix-chaining.patch12
2 files changed, 18 insertions, 5 deletions
diff --git a/sys-apps/baselayout-prefix/baselayout-prefix-2.2-r5.ebuild b/sys-apps/baselayout-prefix/baselayout-prefix-2.2-r5.ebuild
index c6f34fa6a9a6..628b47af038e 100644
--- a/sys-apps/baselayout-prefix/baselayout-prefix-2.2-r5.ebuild
+++ b/sys-apps/baselayout-prefix/baselayout-prefix-2.2-r5.ebuild
@@ -37,6 +37,9 @@ src_prepare() {
# 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
}
@@ -52,9 +55,13 @@ src_install() {
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" \
diff --git a/sys-apps/baselayout-prefix/files/baselayout-2.2-prefix-chaining.patch b/sys-apps/baselayout-prefix/files/baselayout-2.2-prefix-chaining.patch
index b6b51b969a8e..98e41b95bb91 100644
--- a/sys-apps/baselayout-prefix/files/baselayout-2.2-prefix-chaining.patch
+++ b/sys-apps/baselayout-prefix/files/baselayout-2.2-prefix-chaining.patch
@@ -1,6 +1,6 @@
--- 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.
#
@@ -14,7 +14,13 @@
+# 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
@@ -41,7 +47,7 @@
# 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