public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-portage-dev] [PATCH] Make the USE variable readonly (bug 325009)
@ 2015-04-26 21:14 Zac Medico
  2015-04-28 20:52 ` Brian Dolbec
  2015-06-23 11:40 ` [gentoo-portage-dev] " Michael Haubenwallner
  0 siblings, 2 replies; 3+ messages in thread
From: Zac Medico @ 2015-04-26 21:14 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Zac Medico

This requires the EBUILD_FORCE_TEST code from dyn_test to execute
before USE is declared readonly.

X-Gentoo-Bug: 325009
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=325009
---
 bin/ebuild.sh          | 10 +++++++++-
 bin/phase-functions.sh |  9 +--------
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index b6b3723..4e26f87 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 PORTAGE_BIN_PATH="${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"
@@ -746,6 +746,14 @@ else
 		declare -r ED EPREFIX EROOT
 	fi
 
+	# If ${EBUILD_FORCE_TEST} == 1 and USE came from ${T}/environment
+	# then it might not have USE=test like it's supposed to here.
+	if [[ ${EBUILD_PHASE} == test && ${EBUILD_FORCE_TEST} == 1 &&
+		test =~ ${PORTAGE_IUSE} ]] && ! has test ${USE} ; then
+		export USE="${USE} test"
+	fi
+	declare -r USE
+
 	if [[ -n $EBUILD_SH_ARGS ]] ; then
 		(
 			# Don't allow subprocesses to inherit the pipe which
diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 2743e27..7bf4d63 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # Hardcoded bash lists are needed for backward compatibility with
@@ -489,13 +489,6 @@ __dyn_test() {
 	elif [[ ${EBUILD_FORCE_TEST} != 1 ]] && ! has test ${FEATURES} ; then
 		__vecho ">>> Test phase [not enabled]: ${CATEGORY}/${PF}"
 	else
-		# If ${EBUILD_FORCE_TEST} == 1 and USE came from ${T}/environment
-		# then it might not have USE=test like it's supposed to here.
-		if [[ ${EBUILD_FORCE_TEST} == 1 && test =~ ${PORTAGE_IUSE} ]] && \
-			! has test ${USE} ; then
-			export USE="${USE} test"
-		fi
-
 		local save_sp=${SANDBOX_PREDICT}
 		addpredict /
 		__ebuild_phase pre_src_test
-- 
2.3.5



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [gentoo-portage-dev] [PATCH] Make the USE variable readonly (bug 325009)
  2015-04-26 21:14 [gentoo-portage-dev] [PATCH] Make the USE variable readonly (bug 325009) Zac Medico
@ 2015-04-28 20:52 ` Brian Dolbec
  2015-06-23 11:40 ` [gentoo-portage-dev] " Michael Haubenwallner
  1 sibling, 0 replies; 3+ messages in thread
From: Brian Dolbec @ 2015-04-28 20:52 UTC (permalink / raw
  To: gentoo-portage-dev

On Sun, 26 Apr 2015 14:14:09 -0700
Zac Medico <zmedico@gentoo.org> wrote:

> This requires the EBUILD_FORCE_TEST code from dyn_test to execute
> before USE is declared readonly.
> 
> X-Gentoo-Bug: 325009
> X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=325009
> ---
>  bin/ebuild.sh          | 10 +++++++++-
>  bin/phase-functions.sh |  9 +--------
>  2 files changed, 10 insertions(+), 9 deletions(-)
> 
> diff --git a/bin/ebuild.sh b/bin/ebuild.sh
> index b6b3723..4e26f87 100755
> --- a/bin/ebuild.sh
> +++ b/bin/ebuild.sh
> @@ -1,5 +1,5 @@
>  #!/bin/bash
> -# Copyright 1999-2013 Gentoo Foundation
> +# Copyright 1999-2015 Gentoo Foundation
>  # Distributed under the terms of the GNU General Public License v2
>  
>  PORTAGE_BIN_PATH="${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"


Anthony brought up about PORTAGE_PYM_PATH, I see above the same for
PORTAGE_BIN_PATH, having the OLD install location hardcoded into the
path.  I know it is not relevent to this patch.  But noting it here
anyway.



> @@ -746,6 +746,14 @@ else
>  		declare -r ED EPREFIX EROOT
>  	fi
>  
> +	# If ${EBUILD_FORCE_TEST} == 1 and USE came from
> ${T}/environment
> +	# then it might not have USE=test like it's supposed to here.
> +	if [[ ${EBUILD_PHASE} == test && ${EBUILD_FORCE_TEST} == 1 &&
> +		test =~ ${PORTAGE_IUSE} ]] && ! has test ${USE} ;
> then
> +		export USE="${USE} test"
> +	fi
> +	declare -r USE
> +
>  	if [[ -n $EBUILD_SH_ARGS ]] ; then
>  		(
>  			# Don't allow subprocesses to inherit the
> pipe which diff --git a/bin/phase-functions.sh
> b/bin/phase-functions.sh index 2743e27..7bf4d63 100644
> --- a/bin/phase-functions.sh
> +++ b/bin/phase-functions.sh
> @@ -1,5 +1,5 @@
>  #!/bin/bash
> -# Copyright 1999-2013 Gentoo Foundation
> +# Copyright 1999-2015 Gentoo Foundation
>  # Distributed under the terms of the GNU General Public License v2
>  
>  # Hardcoded bash lists are needed for backward compatibility with
> @@ -489,13 +489,6 @@ __dyn_test() {
>  	elif [[ ${EBUILD_FORCE_TEST} != 1 ]] && ! has test
> ${FEATURES} ; then __vecho ">>> Test phase [not enabled]:
> ${CATEGORY}/${PF}" else
> -		# If ${EBUILD_FORCE_TEST} == 1 and USE came from
> ${T}/environment
> -		# then it might not have USE=test like it's supposed
> to here.
> -		if [[ ${EBUILD_FORCE_TEST} == 1 && test =~
> ${PORTAGE_IUSE} ]] && \
> -			! has test ${USE} ; then
> -			export USE="${USE} test"
> -		fi
> -
>  		local save_sp=${SANDBOX_PREDICT}
>  		addpredict /
>  		__ebuild_phase pre_src_test


Looks good
-- 
Brian Dolbec <dolsen>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [gentoo-portage-dev] Re: [PATCH] Make the USE variable readonly (bug 325009)
  2015-04-26 21:14 [gentoo-portage-dev] [PATCH] Make the USE variable readonly (bug 325009) Zac Medico
  2015-04-28 20:52 ` Brian Dolbec
@ 2015-06-23 11:40 ` Michael Haubenwallner
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Haubenwallner @ 2015-06-23 11:40 UTC (permalink / raw
  To: gentoo-portage-dev

On 04/26/2015 11:14 PM, Zac Medico wrote:
> This requires the EBUILD_FORCE_TEST code from dyn_test to execute
> before USE is declared readonly.
> 
> X-Gentoo-Bug: 325009
> X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=325009
> ---

> --- a/bin/ebuild.sh
> +++ b/bin/ebuild.sh
> @@ -1,5 +1,5 @@
> +	declare -r USE

This breaks the 'ebuildshell' feature patch,
https://bugs.gentoo.org/show_bug.cgi?id=155161

Shouldn't "USE" show up in PORTAGE_READONLY_VARS as well?

/haubi/


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-06-23 11:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-26 21:14 [gentoo-portage-dev] [PATCH] Make the USE variable readonly (bug 325009) Zac Medico
2015-04-28 20:52 ` Brian Dolbec
2015-06-23 11:40 ` [gentoo-portage-dev] " Michael Haubenwallner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox