Gentoo Archives: gentoo-commits

From: Fabian Groffen <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/prefix:master commit in: scripts/
Date: Thu, 03 Jan 2019 09:24:17
Message-Id: 1546507433.6987586f278fd5eb1683fa7e49d75dd7016278fb.grobian@gentoo
1 commit: 6987586f278fd5eb1683fa7e49d75dd7016278fb
2 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jan 3 09:21:08 2019 +0000
4 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
5 CommitDate: Thu Jan 3 09:23:53 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=6987586f
7
8 scripts/bootstrap-prefix: ensure USE is picked up in stage3
9
10 Portage seems to ignore USE= environment for build dependencies in a
11 different location. Since we need this to be respected in order to
12 avoid many cycles, temporarily encode the requested USE-flags in
13 use.mask and use.force. We use the profiles/ location which should get
14 wiped out hereafter, but also remove the files used whilst emerging to
15 reduce the risk of leaving this behind in someone's setup.
16
17 Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
18
19 scripts/bootstrap-prefix.sh | 24 +++++++++++++++++++++---
20 1 file changed, 21 insertions(+), 3 deletions(-)
21
22 diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
23 index d393c4d498..9f4f1bbb38 100755
24 --- a/scripts/bootstrap-prefix.sh
25 +++ b/scripts/bootstrap-prefix.sh
26 @@ -1452,6 +1452,22 @@ do_emerge_pkgs() {
27 done
28 myuse=( ${myuse} )
29
30 + # Portage seems to ignore USE= for build dependencies. Since
31 + # that's what we're more or less doing all the time, encode the
32 + # USE-flags in profiles/use.mask and profiles/use.force which
33 + # normally do not exist.
34 + rm -f "${EPREFIX}"/usr/portage/profiles/use.{mask,force}
35 + for use in "${myuse[@]}" ; do
36 + case "${use}" in
37 + -*) echo "${use#-}" \
38 + >> "${EPREFIX}"/usr/portage/profiles/use.mask
39 + ;;
40 + *) echo "${use}" \
41 + >> "${EPREFIX}"/usr/portage/profiles/use.force
42 + ;;
43 + esac
44 + done
45 +
46 # Disable the STALE warning because the snapshot frequently gets stale.
47 #
48 # Need need to spam the user about news until the emerge -e system
49 @@ -1472,6 +1488,7 @@ do_emerge_pkgs() {
50 emerge -v --oneshot --root-deps ${opts} "${pkg}"
51 )
52 [[ $? -eq 0 ]] || return 1
53 + rm -f "${EPREFIX}"/usr/portage/profiles/use.{mask,force}
54
55 case ${pkg},${CHOST} in
56 app-shells/bash,*-cygwin*)
57 @@ -1663,7 +1680,7 @@ bootstrap_stage3() {
58 # PORTAGE_OVERRIDE_EPREFIX as BROOT is needed.
59 PREROOTPATH="${ROOT}"$(echo /{,tmp/}{usr/,}{,lib/llvm/{10,9,8,7,6,5}/}{s,}bin | sed "s, ,:${ROOT},g") \
60 EPREFIX="${ROOT}" PORTAGE_TMPDIR="${PORTAGE_TMPDIR}" \
61 - PORTAGE_OVERRIDE_EPREFIX="$(rapx "${ROOT}" "${ROOT}/tmp")" \
62 + PORTAGE_OVERRIDE_EPREFIX="$(rapx "${ROOT}" "${ROOT}"/tmp)" \
63 FEATURES="${FEATURES} force-prefix $(rapx "" stacked-prefix)" \
64 EMERGE_LOG_DIR="${ROOT}"/var/log \
65 do_emerge_pkgs "$@"
66 @@ -1816,7 +1833,7 @@ bootstrap_stage3() {
67 app-admin/eselect
68 $( [[ ${CHOST} == *-cygwin* ]] && echo sys-libs/cygwin-crypt )
69 )
70 - # for grep we need to do a little workaround as we use llvm-3.4
71 + # for grep we need to do a little workaround as we might use llvm-3.4
72 # here, which doesn't necessarily grok the system headers on newer
73 # OSX, confusing the buildsystem
74 ac_cv_c_decl_report=warning \
75 @@ -1824,7 +1841,8 @@ bootstrap_stage3() {
76 emerge_pkgs "" "${pkgs[@]}" || return 1
77
78 if [[ ! -x "${ROOT}"/sbin/openrc-run ]]; then
79 - echo "We need openrc-run at ${ROOT}/sbin to merge rsync." > "${ROOT}"/sbin/openrc-run
80 + echo "We need openrc-run at ${ROOT}/sbin to merge rsync." \
81 + > "${ROOT}"/sbin/openrc-run
82 chmod +x "${ROOT}"/sbin/openrc-run
83 fi