Gentoo Archives: gentoo-commits

From: Michael Haubenwallner <haubi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-portage/prefix-chain-setup/files/, app-portage/prefix-chain-setup/
Date: Mon, 27 Mar 2017 13:24:01
Message-Id: 1490621008.b873ddc1c6c82e33092204bdd5472f48e16495d9.haubi@gentoo
1 commit: b873ddc1c6c82e33092204bdd5472f48e16495d9
2 Author: Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
3 AuthorDate: Mon Mar 27 13:23:28 2017 +0000
4 Commit: Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
5 CommitDate: Mon Mar 27 13:23:28 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b873ddc1
7
8 app-portage/prefix-chain-setup: bump, lookup functions.sh and make.conf
9
10 Package-Manager: portage-2.3.3
11
12 .../prefix-chain-setup/files/prefix-chain-setup.in | 51 +++++++++++++++-------
13 ...0.4-r5.ebuild => prefix-chain-setup-0.5.ebuild} | 1 +
14 2 files changed, 37 insertions(+), 15 deletions(-)
15
16 diff --git a/app-portage/prefix-chain-setup/files/prefix-chain-setup.in b/app-portage/prefix-chain-setup/files/prefix-chain-setup.in
17 index 1d2f9b11a5d..dacb48318df 100644
18 --- a/app-portage/prefix-chain-setup/files/prefix-chain-setup.in
19 +++ b/app-portage/prefix-chain-setup/files/prefix-chain-setup.in
20 @@ -11,7 +11,22 @@ PORT_TMPDIR=
21 #
22 # get ourselfs the functions.sh script for ebegin/eend/etc.
23 #
24 -. "${PARENT_EPREFIX}"/sbin/functions.sh
25 +for f in \
26 + /lib/gentoo/functions.sh \
27 + /etc/init.d/functions.sh \
28 + /sbin/functions.sh \
29 +; do
30 + if [[ -r ${PARENT_EPREFIX}${f} ]]; then
31 + . "${PARENT_EPREFIX}${f}"
32 + f=found
33 + break
34 + fi
35 +done
36 +
37 +if [[ ${f} != found ]]; then
38 + echo "Cannot find Gentoo functions, aborting." >&2
39 + exit 1
40 +fi
41
42 for arg in "$@"; do
43 case "${arg}" in
44 @@ -64,7 +79,7 @@ eend_exit() {
45 ebegin "creating directory structure"
46 (
47 set -e
48 - mkdir -p "${CHILD_EPREFIX}"/etc
49 + mkdir -p "${CHILD_EPREFIX}"/etc/portage
50 mkdir -p "${CHILD_EPREFIX}"/var/log
51 )
52 eend_exit $?
53 @@ -82,13 +97,13 @@ ebegin "creating make.conf"
54 echo "CFLAGS=\"$(portageq envvar CFLAGS)\""
55 echo "CXXFLAGS=\"$(portageq envvar CXXFLAGS)\""
56 echo "MAKEOPTS=\"$(portageq envvar MAKEOPTS)\""
57 - niceness=$(portageq envvar PORTAGE_NICENESS)
58 + niceness=$(portageq envvar PORTAGE_NICENESS || true)
59 [[ -n ${niceness} ]] &&
60 echo "PORTAGE_NICENESS=\"${niceness}\""
61 echo "USE=\"prefix-chaining\""
62 echo
63 echo "# Mirrors from parent prefix."
64 - echo "GENTOO_MIRRORS=\"$(portageq envvar GENTOO_MIRRORS)\""
65 + echo "GENTOO_MIRRORS=\"$(portageq envvar GENTOO_MIRRORS || true)\""
66 echo
67 echo "#"
68 echo "# Below comes the chained-prefix setup. Only change things"
69 @@ -99,7 +114,7 @@ ebegin "creating make.conf"
70 echo "# all that is possible"
71 echo "#"
72 echo "PORTDIR=\"$(portageq envvar PORTDIR)\""
73 - echo "SYNC=\"$(portageq envvar SYNC)\""
74 + echo "SYNC=\"$(portageq envvar SYNC || true)\""
75 if test -z "${PORT_TMPDIR}"; then
76 case "${CHILD_PROFILE}" in
77 *winnt*) echo "PORTAGE_TMPDIR=/var/tmp" ;;
78 @@ -111,10 +126,15 @@ ebegin "creating make.conf"
79 echo "READONLY_EPREFIX=\"${PARENT_EPREFIX}:DEPEND\""
80
81 if test "${DO_SOURCES}" == "yes"; then
82 - # don't fail if nothing found
83 - egrep "^source .*" "${PARENT_EPREFIX}/etc/make.conf" 2>/dev/null || true
84 + # don't fail if nothing found
85 + for f in /etc/portage/make.conf /etc/make.conf; do
86 + if [[ -r ${PARENT_EPREFIX}${f} ]]; then
87 + egrep "^source .*" "${PARENT_EPREFIX}${f}" 2>/dev/null || true
88 + break;
89 + fi
90 + done
91 fi
92 -) > "${CHILD_EPREFIX}"/etc/make.conf
93 +) > "${CHILD_EPREFIX}"/etc/portage/make.conf
94 eend_exit $?
95
96 #
97 @@ -122,7 +142,7 @@ eend_exit $?
98 #
99 ebegin "creating make.profile"
100 (
101 - ln -s "${CHILD_PROFILE}" "${CHILD_EPREFIX}/etc/make.profile"
102 + ln -s "${CHILD_PROFILE}" "${CHILD_EPREFIX}/etc/portage/make.profile"
103 )
104 eend_exit $?
105
106 @@ -131,7 +151,7 @@ eend_exit $?
107 #
108 ebegin "adjusting permissions"
109 (
110 - chmod 644 "${CHILD_EPREFIX}"/etc/make.conf
111 + chmod 644 "${CHILD_EPREFIX}"/etc/portage/make.conf
112 )
113 eend_exit $?
114
115 @@ -142,22 +162,23 @@ ebegin "installing required basic packages"
116 (
117 # this -pv is there to avoid the global update output, which is
118 # there on the first emerge run. (thus, just cosmetics).
119 - EPREFIX="${CHILD_EPREFIX}" emerge -p1qO baselayout > /dev/null 2>&1
120 + PORTAGE_CONFIGROOT="${CHILD_EPREFIX}" EPREFIX="${CHILD_EPREFIX}" emerge -p1qO baselayout-prefix > /dev/null 2>&1
121
122 - EPREFIX="${CHILD_EPREFIX}" emerge -1qO baselayout prefix-chain-utils
123 + set -e
124 + PORTAGE_CONFIGROOT="${CHILD_EPREFIX}" EPREFIX="${CHILD_EPREFIX}" emerge -1qO gentoo-functions baselayout-prefix prefix-chain-utils
125
126 # merge with the parent's chost. this forces the use of the parent
127 # compiler, which generally would be illegal - this is an exception.
128 # This is required for example on winnt, because the wrapper has to
129 # be able to use/resolve symlinks, etc. native winnt binaries miss that
130 # ability, but interix binaries don't.
131 - EPREFIX="${CHILD_EPREFIX}" CHOST="${PARENT_CHOST}" emerge -1qO gcc-config
132 + PORTAGE_CONFIGROOT="${CHILD_EPREFIX}" EPREFIX="${CHILD_EPREFIX}" CHOST="${PARENT_CHOST}" emerge -1qO gcc-config
133
134 # select the chain wrapper profile from gcc-config
135 env -i "$(type -P bash)" "${CHILD_EPREFIX}"/usr/bin/gcc-config 1
136
137 # do this _AFTER_ selecting the correct compiler!
138 - EPREFIX="${CHILD_EPREFIX}" emerge -1qO libtool
139 + PORTAGE_CONFIGROOT="${CHILD_EPREFIX}" EPREFIX="${CHILD_EPREFIX}" emerge -1qO libtool
140 )
141 eend_exit $?
142
143 @@ -165,6 +186,6 @@ eend_exit $?
144 # wow, all ok :)
145 #
146 ewarn
147 -ewarn "all done. don't forget to tune ${CHILD_EPREFIX}/etc/make.conf."
148 +ewarn "all done. don't forget to tune ${CHILD_EPREFIX}/etc/portage/make.conf."
149 ewarn "to enter the new prefix, run \"${CHILD_EPREFIX}/startprefix\"."
150 ewarn
151
152 diff --git a/app-portage/prefix-chain-setup/prefix-chain-setup-0.4-r5.ebuild b/app-portage/prefix-chain-setup/prefix-chain-setup-0.5.ebuild
153 similarity index 87%
154 rename from app-portage/prefix-chain-setup/prefix-chain-setup-0.4-r5.ebuild
155 rename to app-portage/prefix-chain-setup/prefix-chain-setup-0.5.ebuild
156 index 21ead2f506b..1285b03d119 100644
157 --- a/app-portage/prefix-chain-setup/prefix-chain-setup-0.4-r5.ebuild
158 +++ b/app-portage/prefix-chain-setup/prefix-chain-setup-0.5.ebuild
159 @@ -18,5 +18,6 @@ RDEPEND=""
160 src_install() {
161 cp "${FILESDIR}"/prefix-chain-setup.in "${T}"/prefix-chain-setup
162 eprefixify "${T}"/prefix-chain-setup
163 + sed -e "s,@GENTOO_PORTAGE_CHOST@,${CHOST}," -i "${T}"/prefix-chain-setup
164 dobin "${T}"/prefix-chain-setup
165 }