Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Cc: Zac Medico <zmedico@g.o>
Subject: [gentoo-portage-dev] [PATCH] Make the USE variable readonly (bug 325009)
Date: Sun, 26 Apr 2015 21:14:36
Message-Id: 1430082849-25101-1-git-send-email-zmedico@gentoo.org
1 This requires the EBUILD_FORCE_TEST code from dyn_test to execute
2 before USE is declared readonly.
3
4 X-Gentoo-Bug: 325009
5 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=325009
6 ---
7 bin/ebuild.sh | 10 +++++++++-
8 bin/phase-functions.sh | 9 +--------
9 2 files changed, 10 insertions(+), 9 deletions(-)
10
11 diff --git a/bin/ebuild.sh b/bin/ebuild.sh
12 index b6b3723..4e26f87 100755
13 --- a/bin/ebuild.sh
14 +++ b/bin/ebuild.sh
15 @@ -1,5 +1,5 @@
16 #!/bin/bash
17 -# Copyright 1999-2013 Gentoo Foundation
18 +# Copyright 1999-2015 Gentoo Foundation
19 # Distributed under the terms of the GNU General Public License v2
20
21 PORTAGE_BIN_PATH="${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"
22 @@ -746,6 +746,14 @@ else
23 declare -r ED EPREFIX EROOT
24 fi
25
26 + # If ${EBUILD_FORCE_TEST} == 1 and USE came from ${T}/environment
27 + # then it might not have USE=test like it's supposed to here.
28 + if [[ ${EBUILD_PHASE} == test && ${EBUILD_FORCE_TEST} == 1 &&
29 + test =~ ${PORTAGE_IUSE} ]] && ! has test ${USE} ; then
30 + export USE="${USE} test"
31 + fi
32 + declare -r USE
33 +
34 if [[ -n $EBUILD_SH_ARGS ]] ; then
35 (
36 # Don't allow subprocesses to inherit the pipe which
37 diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
38 index 2743e27..7bf4d63 100644
39 --- a/bin/phase-functions.sh
40 +++ b/bin/phase-functions.sh
41 @@ -1,5 +1,5 @@
42 #!/bin/bash
43 -# Copyright 1999-2013 Gentoo Foundation
44 +# Copyright 1999-2015 Gentoo Foundation
45 # Distributed under the terms of the GNU General Public License v2
46
47 # Hardcoded bash lists are needed for backward compatibility with
48 @@ -489,13 +489,6 @@ __dyn_test() {
49 elif [[ ${EBUILD_FORCE_TEST} != 1 ]] && ! has test ${FEATURES} ; then
50 __vecho ">>> Test phase [not enabled]: ${CATEGORY}/${PF}"
51 else
52 - # If ${EBUILD_FORCE_TEST} == 1 and USE came from ${T}/environment
53 - # then it might not have USE=test like it's supposed to here.
54 - if [[ ${EBUILD_FORCE_TEST} == 1 && test =~ ${PORTAGE_IUSE} ]] && \
55 - ! has test ${USE} ; then
56 - export USE="${USE} test"
57 - fi
58 -
59 local save_sp=${SANDBOX_PREDICT}
60 addpredict /
61 __ebuild_phase pre_src_test
62 --
63 2.3.5

Replies