Gentoo Archives: gentoo-portage-dev

From: Brian Dolbec <dolsen@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH] Make the USE variable readonly (bug 325009)
Date: Tue, 28 Apr 2015 20:52:58
Message-Id: 20150428135252.0eab75e6.dolsen@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH] Make the USE variable readonly (bug 325009) by Zac Medico
1 On Sun, 26 Apr 2015 14:14:09 -0700
2 Zac Medico <zmedico@g.o> wrote:
3
4 > This requires the EBUILD_FORCE_TEST code from dyn_test to execute
5 > before USE is declared readonly.
6 >
7 > X-Gentoo-Bug: 325009
8 > X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=325009
9 > ---
10 > bin/ebuild.sh | 10 +++++++++-
11 > bin/phase-functions.sh | 9 +--------
12 > 2 files changed, 10 insertions(+), 9 deletions(-)
13 >
14 > diff --git a/bin/ebuild.sh b/bin/ebuild.sh
15 > index b6b3723..4e26f87 100755
16 > --- a/bin/ebuild.sh
17 > +++ b/bin/ebuild.sh
18 > @@ -1,5 +1,5 @@
19 > #!/bin/bash
20 > -# Copyright 1999-2013 Gentoo Foundation
21 > +# Copyright 1999-2015 Gentoo Foundation
22 > # Distributed under the terms of the GNU General Public License v2
23 >
24 > PORTAGE_BIN_PATH="${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"
25
26
27 Anthony brought up about PORTAGE_PYM_PATH, I see above the same for
28 PORTAGE_BIN_PATH, having the OLD install location hardcoded into the
29 path. I know it is not relevent to this patch. But noting it here
30 anyway.
31
32
33
34 > @@ -746,6 +746,14 @@ else
35 > declare -r ED EPREFIX EROOT
36 > fi
37 >
38 > + # If ${EBUILD_FORCE_TEST} == 1 and USE came from
39 > ${T}/environment
40 > + # then it might not have USE=test like it's supposed to here.
41 > + if [[ ${EBUILD_PHASE} == test && ${EBUILD_FORCE_TEST} == 1 &&
42 > + test =~ ${PORTAGE_IUSE} ]] && ! has test ${USE} ;
43 > then
44 > + export USE="${USE} test"
45 > + fi
46 > + declare -r USE
47 > +
48 > if [[ -n $EBUILD_SH_ARGS ]] ; then
49 > (
50 > # Don't allow subprocesses to inherit the
51 > pipe which diff --git a/bin/phase-functions.sh
52 > b/bin/phase-functions.sh index 2743e27..7bf4d63 100644
53 > --- a/bin/phase-functions.sh
54 > +++ b/bin/phase-functions.sh
55 > @@ -1,5 +1,5 @@
56 > #!/bin/bash
57 > -# Copyright 1999-2013 Gentoo Foundation
58 > +# Copyright 1999-2015 Gentoo Foundation
59 > # Distributed under the terms of the GNU General Public License v2
60 >
61 > # Hardcoded bash lists are needed for backward compatibility with
62 > @@ -489,13 +489,6 @@ __dyn_test() {
63 > elif [[ ${EBUILD_FORCE_TEST} != 1 ]] && ! has test
64 > ${FEATURES} ; then __vecho ">>> Test phase [not enabled]:
65 > ${CATEGORY}/${PF}" else
66 > - # If ${EBUILD_FORCE_TEST} == 1 and USE came from
67 > ${T}/environment
68 > - # then it might not have USE=test like it's supposed
69 > to here.
70 > - if [[ ${EBUILD_FORCE_TEST} == 1 && test =~
71 > ${PORTAGE_IUSE} ]] && \
72 > - ! has test ${USE} ; then
73 > - export USE="${USE} test"
74 > - fi
75 > -
76 > local save_sp=${SANDBOX_PREDICT}
77 > addpredict /
78 > __ebuild_phase pre_src_test
79
80
81 Looks good
82 --
83 Brian Dolbec <dolsen>