* [gentoo-portage-dev] [PATCH] ebuild.sh: force fresh env for pkg_setup (528274)
@ 2014-11-05 6:51 Zac Medico
2014-11-05 7:07 ` [gentoo-portage-dev] [PATCH v2] " Zac Medico
0 siblings, 1 reply; 3+ messages in thread
From: Zac Medico @ 2014-11-05 6:51 UTC (permalink / raw
To: gentoo-portage-dev; +Cc: Zac Medico
In ebuild.sh, $T/environment is loaded for most phases, but it should
always start with a fresh environment for pkg_setup. Therefore, skip
environment loading for pkg_setup.
X-Gentoo-Bug: 528274
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=528274
---
bin/ebuild.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 658884a..1cd029e 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -501,7 +501,7 @@ fi
export EBUILD_MASTER_PID=${BASHPID:-$(__bashpid)}
trap 'exit 1' SIGTERM
-if ! has "$EBUILD_PHASE" clean cleanrm depend && \
+if ! has "$EBUILD_PHASE" clean cleanrm depend setup && \
[ -f "${T}"/environment ] ; then
# The environment may have been extracted from environment.bz2 or
# may have come from another version of ebuild.sh or something.
--
2.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-portage-dev] [PATCH v2] ebuild.sh: force fresh env for pkg_setup (528274)
2014-11-05 6:51 [gentoo-portage-dev] [PATCH] ebuild.sh: force fresh env for pkg_setup (528274) Zac Medico
@ 2014-11-05 7:07 ` Zac Medico
2014-11-27 20:39 ` [gentoo-portage-dev] [PATCH v3] " Zac Medico
0 siblings, 1 reply; 3+ messages in thread
From: Zac Medico @ 2014-11-05 7:07 UTC (permalink / raw
To: gentoo-portage-dev; +Cc: Zac Medico
In ebuild.sh, $T/environment is loaded for most phases, but it should
always start with a fresh environment for pkg_setup. Therefore, skip
environment loading for pkg_setup.
This also requires a change in the config.environ method, in order
to ensure that the calling environment is inherited by pkg_setup
(even though $T/environment may exist).
X-Gentoo-Bug: 528274
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=528274
---
This updated patch adds the config.environ fix.
bin/ebuild.sh | 2 +-
pym/portage/package/ebuild/config.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 658884a..1cd029e 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -501,7 +501,7 @@ fi
export EBUILD_MASTER_PID=${BASHPID:-$(__bashpid)}
trap 'exit 1' SIGTERM
-if ! has "$EBUILD_PHASE" clean cleanrm depend && \
+if ! has "$EBUILD_PHASE" clean cleanrm depend setup && \
[ -f "${T}"/environment ] ; then
# The environment may have been extracted from environment.bz2 or
# may have come from another version of ebuild.sh or something.
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py
index 2ceb122..5b706f2 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -2655,7 +2655,7 @@ class config(object):
phase = self.get('EBUILD_PHASE')
filter_calling_env = False
if self.mycpv is not None and \
- phase not in ('clean', 'cleanrm', 'depend', 'fetch'):
+ phase not in ('clean', 'cleanrm', 'depend', 'fetch', 'setup'):
temp_dir = self.get('T')
if temp_dir is not None and \
os.path.exists(os.path.join(temp_dir, 'environment')):
--
2.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-portage-dev] [PATCH v3] ebuild.sh: force fresh env for pkg_setup (528274)
2014-11-05 7:07 ` [gentoo-portage-dev] [PATCH v2] " Zac Medico
@ 2014-11-27 20:39 ` Zac Medico
0 siblings, 0 replies; 3+ messages in thread
From: Zac Medico @ 2014-11-27 20:39 UTC (permalink / raw
To: gentoo-portage-dev; +Cc: Zac Medico
In ebuild.sh, $T/environment is loaded for most phases, but it should
always start with a fresh environment for pkg_setup. Therefore, skip
environment loading for pkg_setup, and force the ebuild to be sourced.
This also requires a change in the config.environ method, in order
to ensure that the calling environment is inherited by pkg_setup
(even though $T/environment may exist).
X-Gentoo-Bug: 528274
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=528274
---
PATCH v3 fixes ebuild.sh to force the ebuild to be sourced for
pkg_setup.
bin/ebuild.sh | 4 ++--
pym/portage/package/ebuild/config.py | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 658884a..232bf44 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -501,7 +501,7 @@ fi
export EBUILD_MASTER_PID=${BASHPID:-$(__bashpid)}
trap 'exit 1' SIGTERM
-if ! has "$EBUILD_PHASE" clean cleanrm depend && \
+if ! has "$EBUILD_PHASE" clean cleanrm depend setup && \
[ -f "${T}"/environment ] ; then
# The environment may have been extracted from environment.bz2 or
# may have come from another version of ebuild.sh or something.
@@ -550,7 +550,7 @@ eval "PORTAGE_ECLASS_LOCATIONS=(${PORTAGE_ECLASS_LOCATIONS})"
# Source the ebuild every time for FEATURES=noauto, so that ebuild
# modifications take effect immediately.
if ! has "$EBUILD_PHASE" clean cleanrm ; then
- if [[ $EBUILD_PHASE = depend || ! -f $T/environment || \
+ if [[ $EBUILD_PHASE =~ ^(depend|setup)$ || ! -f $T/environment || \
-f $PORTAGE_BUILDDIR/.ebuild_changed || \
" ${FEATURES} " == *" noauto "* ]] ; then
# The bashrcs get an opportunity here to set aliases that will be expanded
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py
index aca27f2..ca15f81 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -2665,7 +2665,7 @@ class config(object):
phase = self.get('EBUILD_PHASE')
filter_calling_env = False
if self.mycpv is not None and \
- phase not in ('clean', 'cleanrm', 'depend', 'fetch'):
+ phase not in ('clean', 'cleanrm', 'depend', 'fetch', 'setup'):
temp_dir = self.get('T')
if temp_dir is not None and \
os.path.exists(os.path.join(temp_dir, 'environment')):
--
2.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-11-27 20:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-05 6:51 [gentoo-portage-dev] [PATCH] ebuild.sh: force fresh env for pkg_setup (528274) Zac Medico
2014-11-05 7:07 ` [gentoo-portage-dev] [PATCH v2] " Zac Medico
2014-11-27 20:39 ` [gentoo-portage-dev] [PATCH v3] " Zac Medico
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox