Re: [gentoo-portage-dev] [PATCH] phase-helpers.sh: has/best_version -b in any phase (bug 665038)

2018-09-03 Thread Zac Medico
On 09/02/2018 04:20 PM, Brian Dolbec wrote:
> On Sun,  2 Sep 2018 15:03:28 -0700
> Zac Medico  wrote:
> 
>> Since BROOT is only defined in src_* phases, make has/best_version -b
>> use the equivalent /${PORTAGE_OVERRIDE_EPREFIX#/} value that is
>> defined in all phases. This makes has/best_version -b in EAPI 7
>> behave exactly the same as --host-root behaves in EAPI 6, allowing
>> python ebuilds to call python_setup in any ebuild phase.
>>
>> Bug: https://bugs.gentoo.org/665038
>> ---
>>  bin/phase-helpers.sh | 7 ++-
>>  1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
>> index 5c9f957e9..ba3f27930 100644
>> --- a/bin/phase-helpers.sh
>> +++ b/bin/phase-helpers.sh
>> @@ -916,7 +916,12 @@ ___best_version_and_has_version_common() {
>>  case ${root_arg} in
>>  -r)
>> root=${ROOT%/}/${EPREFIX#/} ;; -d) root=${ESYSROOT} ;;
>> --b) root=${BROOT:-/} ;;
>> +-b)
>> +#
>> Use /${PORTAGE_OVERRIDE_EPREFIX#/} which is equivalent
>> +# to BROOT, except
>> BROOT is only defined in src_* phases.
>> +
>> root=/${PORTAGE_OVERRIDE_EPREFIX#/}
>> +cmd+=(env
>> EPREFIX="${PORTAGE_OVERRIDE_EPREFIX}")
>> +;;
>>  esac
>>  else
>>  case ${root_arg} in
>> -- 
>> 2.16.4
>>
>>
> 
> LGTM

Thanks, merged:

https://gitweb.gentoo.org/proj/portage.git/commit/?id=102220e1f71341e9bc85236074813f191bb389a4
-- 
Thanks,
Zac



signature.asc
Description: OpenPGP digital signature


Re: [gentoo-portage-dev] [PATCH] phase-helpers.sh: has/best_version -b in any phase (bug 665038)

2018-09-02 Thread Brian Dolbec
On Sun,  2 Sep 2018 15:03:28 -0700
Zac Medico  wrote:

> Since BROOT is only defined in src_* phases, make has/best_version -b
> use the equivalent /${PORTAGE_OVERRIDE_EPREFIX#/} value that is
> defined in all phases. This makes has/best_version -b in EAPI 7
> behave exactly the same as --host-root behaves in EAPI 6, allowing
> python ebuilds to call python_setup in any ebuild phase.
> 
> Bug: https://bugs.gentoo.org/665038
> ---
>  bin/phase-helpers.sh | 7 ++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
> index 5c9f957e9..ba3f27930 100644
> --- a/bin/phase-helpers.sh
> +++ b/bin/phase-helpers.sh
> @@ -916,7 +916,12 @@ ___best_version_and_has_version_common() {
>   case ${root_arg} in
>   -r)
> root=${ROOT%/}/${EPREFIX#/} ;; -d) root=${ESYSROOT} ;;
> - -b) root=${BROOT:-/} ;;
> + -b)
> + #
> Use /${PORTAGE_OVERRIDE_EPREFIX#/} which is equivalent
> + # to BROOT, except
> BROOT is only defined in src_* phases.
> +
> root=/${PORTAGE_OVERRIDE_EPREFIX#/}
> + cmd+=(env
> EPREFIX="${PORTAGE_OVERRIDE_EPREFIX}")
> + ;;
>   esac
>   else
>   case ${root_arg} in
> -- 
> 2.16.4
> 
> 

LGTM



[gentoo-portage-dev] [PATCH] phase-helpers.sh: has/best_version -b in any phase (bug 665038)

2018-09-02 Thread Zac Medico
Since BROOT is only defined in src_* phases, make has/best_version -b
use the equivalent /${PORTAGE_OVERRIDE_EPREFIX#/} value that is defined
in all phases. This makes has/best_version -b in EAPI 7 behave exactly
the same as --host-root behaves in EAPI 6, allowing python ebuilds to
call python_setup in any ebuild phase.

Bug: https://bugs.gentoo.org/665038
---
 bin/phase-helpers.sh | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 5c9f957e9..ba3f27930 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -916,7 +916,12 @@ ___best_version_and_has_version_common() {
case ${root_arg} in
-r) root=${ROOT%/}/${EPREFIX#/} ;;
-d) root=${ESYSROOT} ;;
-   -b) root=${BROOT:-/} ;;
+   -b)
+   # Use 
/${PORTAGE_OVERRIDE_EPREFIX#/} which is equivalent
+   # to BROOT, except BROOT is 
only defined in src_* phases.
+   
root=/${PORTAGE_OVERRIDE_EPREFIX#/}
+   cmd+=(env 
EPREFIX="${PORTAGE_OVERRIDE_EPREFIX}")
+   ;;
esac
else
case ${root_arg} in
-- 
2.16.4