1 |
commit: 743b3337644fbb3ea461d3a9137c9ac85e163f03 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Nov 5 06:50:02 2014 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Nov 29 18:28:35 2014 +0000 |
6 |
URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=743b3337 |
7 |
|
8 |
ebuild.sh: force fresh env for pkg_setup (528274) |
9 |
|
10 |
In ebuild.sh, $T/environment is loaded for most phases, but it should |
11 |
always start with a fresh environment for pkg_setup. Therefore, skip |
12 |
environment loading for pkg_setup, and force the ebuild to be sourced. |
13 |
|
14 |
This also requires a change in the config.environ method, in order |
15 |
to ensure that the calling environment is inherited by pkg_setup |
16 |
(even though $T/environment may exist). |
17 |
|
18 |
X-Gentoo-Bug: 528274 |
19 |
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=528274 |
20 |
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org> |
21 |
|
22 |
--- |
23 |
bin/ebuild.sh | 4 ++-- |
24 |
pym/portage/package/ebuild/config.py | 2 +- |
25 |
2 files changed, 3 insertions(+), 3 deletions(-) |
26 |
|
27 |
diff --git a/bin/ebuild.sh b/bin/ebuild.sh |
28 |
index 658884a..232bf44 100755 |
29 |
--- a/bin/ebuild.sh |
30 |
+++ b/bin/ebuild.sh |
31 |
@@ -501,7 +501,7 @@ fi |
32 |
export EBUILD_MASTER_PID=${BASHPID:-$(__bashpid)} |
33 |
trap 'exit 1' SIGTERM |
34 |
|
35 |
-if ! has "$EBUILD_PHASE" clean cleanrm depend && \ |
36 |
+if ! has "$EBUILD_PHASE" clean cleanrm depend setup && \ |
37 |
[ -f "${T}"/environment ] ; then |
38 |
# The environment may have been extracted from environment.bz2 or |
39 |
# may have come from another version of ebuild.sh or something. |
40 |
@@ -550,7 +550,7 @@ eval "PORTAGE_ECLASS_LOCATIONS=(${PORTAGE_ECLASS_LOCATIONS})" |
41 |
# Source the ebuild every time for FEATURES=noauto, so that ebuild |
42 |
# modifications take effect immediately. |
43 |
if ! has "$EBUILD_PHASE" clean cleanrm ; then |
44 |
- if [[ $EBUILD_PHASE = depend || ! -f $T/environment || \ |
45 |
+ if [[ $EBUILD_PHASE =~ ^(depend|setup)$ || ! -f $T/environment || \ |
46 |
-f $PORTAGE_BUILDDIR/.ebuild_changed || \ |
47 |
" ${FEATURES} " == *" noauto "* ]] ; then |
48 |
# The bashrcs get an opportunity here to set aliases that will be expanded |
49 |
|
50 |
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py |
51 |
index aca27f2..ca15f81 100644 |
52 |
--- a/pym/portage/package/ebuild/config.py |
53 |
+++ b/pym/portage/package/ebuild/config.py |
54 |
@@ -2665,7 +2665,7 @@ class config(object): |
55 |
phase = self.get('EBUILD_PHASE') |
56 |
filter_calling_env = False |
57 |
if self.mycpv is not None and \ |
58 |
- phase not in ('clean', 'cleanrm', 'depend', 'fetch'): |
59 |
+ phase not in ('clean', 'cleanrm', 'depend', 'fetch', 'setup'): |
60 |
temp_dir = self.get('T') |
61 |
if temp_dir is not None and \ |
62 |
os.path.exists(os.path.join(temp_dir, 'environment')): |