Gentoo Archives: gentoo-commits

From: Michael Haubenwallner <haubi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/baselayout-prefix/files/, sys-apps/baselayout-prefix/
Date: Wed, 05 Apr 2017 14:08:01
Message-Id: 1491401240.8984aa4a29074f6040de6ff6630391ecb6925dc3.haubi@gentoo
1 commit: 8984aa4a29074f6040de6ff6630391ecb6925dc3
2 Author: Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
3 AuthorDate: Wed Apr 5 14:07:06 2017 +0000
4 Commit: Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
5 CommitDate: Wed Apr 5 14:07:20 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8984aa4a
7
8 sys-apps/baselayout-prefix: fix etc/profile in chained prefix
9
10 Package-Manager: portage-2.3.3
11
12 sys-apps/baselayout-prefix/baselayout-prefix-2.2-r5.ebuild | 11 +++++++++--
13 .../files/baselayout-2.2-prefix-chaining.patch | 12 +++++++++---
14 2 files changed, 18 insertions(+), 5 deletions(-)
15
16 diff --git a/sys-apps/baselayout-prefix/baselayout-prefix-2.2-r5.ebuild b/sys-apps/baselayout-prefix/baselayout-prefix-2.2-r5.ebuild
17 index c6f34fa6a9a..628b47af038 100644
18 --- a/sys-apps/baselayout-prefix/baselayout-prefix-2.2-r5.ebuild
19 +++ b/sys-apps/baselayout-prefix/baselayout-prefix-2.2-r5.ebuild
20 @@ -37,6 +37,9 @@ src_prepare() {
21 # but still .pc files should be found for all RDEPENDable prefixes in
22 # the chain.
23 echo "PKG_CONFIG_PATH=\"/usr/lib/pkgconfig:/usr/share/pkgconfig\"" >> etc/env.d/00basic
24 + echo "PORTAGE_OVERRIDE_EPREFIX=\"${EPREFIX}\"" >> etc/env.d/00basic
25 + echo "PORTAGE_CONFIGROOT=\"${EPREFIX}\"" >> etc/env.d/00basic
26 + echo "EPREFIX=\"${EPREFIX}\"" >> etc/env.d/00basic
27 fi
28 default
29 }
30 @@ -52,9 +55,13 @@ src_install() {
31 sed \
32 -e "/PATH=/!s:/\(etc\|usr/bin\|bin\):\"${EPREFIX}\"/\1:g" \
33 -e "/PATH=/s|\([:\"]\)/|\1${EPREFIX}/|g" \
34 - -e "/PATH=.*\/sbin/s|\"$|:/usr/sbin:/sbin\"|" \
35 - -e "/PATH=.*\/bin/s|\"$|:/usr/bin:/bin\"|" \
36 etc/profile > "${ED}"/etc/profile || die
37 + if ! use prefix-chaining; then
38 + sed \
39 + -e "/PATH=.*\/sbin/s|\"$|:/usr/sbin:/sbin\"|" \
40 + -e "/PATH=.*\/bin/s|\"$|:/usr/bin:/bin\"|" \
41 + -i "${ED}"/etc/profile || die
42 + fi
43 dodir etc/env.d
44 sed \
45 -e "s:/\(etc/env.d\|opt\|usr\):${EPREFIX}/\1:g" \
46
47 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
48 index b6b51b969a8..98e41b95bb9 100644
49 --- a/sys-apps/baselayout-prefix/files/baselayout-2.2-prefix-chaining.patch
50 +++ b/sys-apps/baselayout-prefix/files/baselayout-2.2-prefix-chaining.patch
51 @@ -1,6 +1,6 @@
52 --- baselayout-2.2/etc/profile.orig 2017-03-23 16:46:29.922123300 +0100
53 +++ baselayout-2.2/etc/profile 2017-03-23 16:58:43.578360900 +0100
54 -@@ -4,6 +4,40 @@
55 +@@ -4,6 +4,46 @@
56 # environment for login shells.
57 #
58
59 @@ -14,7 +14,13 @@
60 +# we have here, and thus it will source parents before
61 +# evaluating anything from itself.
62 +#
63 -+_ro_root=$(. /etc/make.conf && echo $READONLY_EPREFIX)
64 ++if [[ -r /etc/portage/make.conf ]]; then
65 ++ _ro_root=$(. /etc/portage/make.conf && echo $READONLY_EPREFIX)
66 ++elif [[ -r /etc/make.conf ]]; then
67 ++ _ro_root=$(. /etc/make.conf && echo $READONLY_EPREFIX)
68 ++else
69 ++ echo "Failed to read" /etc/portage/make.conf >&2
70 ++fi
71 +_ro_deps=${_ro_root#*:}
72 +_ro_root=${_ro_root%:*}
73 +if [ -n "${_ro_root}" -a -f "${_ro_root}/"etc/profile ]; then
74 @@ -41,7 +47,7 @@
75 # Load environment settings from profile.env, which is created by
76 # env-update from the files in /etc/env.d
77 if [ -e /etc/profile.env ] ; then
78 -@@ -61,3 +95,17 @@
79 +@@ -61,3 +101,17 @@
80 [ -r "$sh" ] && . "$sh"
81 done
82 unset sh