Re: [gentoo-portage-dev] [PATCH 16/18] Disallow helpers in global scope in EAPI 6

2015-01-16 Thread Sergei Trofimovich
On Mon,  1 Dec 2014 22:28:34 +0100
Michał Górny mgo...@gentoo.org wrote:

 Disallow calling most of the ebuild helpers in global scope since they
 are meaningless in that context. Most of them are also prohibited by PMS
 for all EAPIs, so EAPI 6 sounds like a good moment to finally enforce
 that restriction.
 ---
  bin/eapi.sh | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/bin/eapi.sh b/bin/eapi.sh
 index e0ade02..5ab92f4 100644
 --- a/bin/eapi.sh
 +++ b/bin/eapi.sh
 @@ -159,7 +159,7 @@ ___eapi_helpers_can_die() {
  }
  
  ___eapi_disallows_helpers_in_global_scope() {
 - [[ ${1-${EAPI}} =~ ^(4-python|5-progress)$ ]]
 + [[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-slot-abi|5|5-hdepend)$ ]]
  }
  
  ___eapi_unpack_is_case_sensitive() {

Looks like it cries on ebuilds with unset EAPI in main tree (attached).
Can be easily fixed in tree by adding EAPI=0, but better handle it
here: ${EAPI-0} (untested!)

It also changed binutils: it used to be slotted only in presence of USE flag.
Now it's always slotted even with USE=-multislot (at least eix thinks so).

-- 

  Sergei
 * ERROR: dev-java/ibm-jdk-bin-1.6.0.9_p1::gentoo failed (depend 
phase):
 *   use() calls are not allowed in global scope
 * 
 * Call stack:
 *   ebuild.sh, line 584:  Called source 
'/gentoo-32k/gentoo-x86/dev-java/ibm-jdk-bin/ibm-jdk-bin-1.6.0.9_p1.ebuild'
 * ERROR: dev-java/ibm-jdk-bin-1.6.0.9_p2::gentoo failed (depend 
phase):
 *   use() calls are not allowed in global scope
 *   ibm-jdk-bin-1.6.0.9_p1.ebuild, line  50:  Called use 'x86'
 * 
 * Call stack:
 *   ebuild.sh, line  47:  Called die
 * The specific snippet of code:
 *   ebuild.sh, line 584:  Called source 
'/gentoo-32k/gentoo-x86/dev-java/ibm-jdk-bin/ibm-jdk-bin-1.6.0.9_p2.ebuild'
 *  # These functions die because calls to them during the 
depend phase
 * ERROR: dev-java/ibm-jre-bin-1.6.0.9_p1::gentoo failed (depend 
phase):
 * 
 *   use() calls are not allowed in global scope
 * 
 *   ibm-jdk-bin-1.6.0.9_p2.ebuild, line  50:  Called use 'x86'
 * Call stack:
 * If you need support, post the output of `emerge --info 
'=dev-java/ibm-jdk-bin-1.6.0.9_p1::gentoo'`,
 * the complete build log and the output of `emerge -pqv 
'=dev-java/ibm-jdk-bin-1.6.0.9_p1::gentoo'`.
 *   ebuild.sh, line  47:  Called die
 * The specific snippet of code:
 * Working directory: '/usr/lib64/python3.3/site-packages'
 * ERROR: dev-java/ibm-jre-bin-1.6.0.9_p2::gentoo failed (depend 
phase):
 * S: 
'/tmp/portage-tmpdir/portage/dev-java/ibm-jdk-bin-1.6.0.9_p1/work/ibm-jdk-bin-1.6.0.9_p1'
 *   use() calls are not allowed in global scope
 * 
 *  # These functions die because calls to them during the 
depend phase
 * Call stack:
 * 
 * If you need support, post the output of `emerge --info 
'=dev-java/ibm-jdk-bin-1.6.0.9_p2::gentoo'`,
 * the complete build log and the output of `emerge -pqv 
'=dev-java/ibm-jdk-bin-1.6.0.9_p2::gentoo'`.
 *   ebuild.sh, line 584:  Called source 
'/gentoo-32k/gentoo-x86/dev-java/ibm-jre-bin/ibm-jre-bin-1.6.0.9_p2.ebuild'
 *   ebuild.sh, line 584:  Called source 
'/gentoo-32k/gentoo-x86/dev-java/ibm-jre-bin/ibm-jre-bin-1.6.0.9_p1.ebuild'
 * Working directory: '/usr/lib64/python3.3/site-packages'
 * S: 
'/tmp/portage-tmpdir/portage/dev-java/ibm-jdk-bin-1.6.0.9_p2/work/ibm-jdk-bin-1.6.0.9_p2'
 *   ibm-jre-bin-1.6.0.9_p2.ebuild, line  31:  Called use 'x86'
 *   ibm-jre-bin-1.6.0.9_p1.ebuild, line  31:  Called use 'x86'
 *   ebuild.sh, line  47:  Called die
 *   ebuild.sh, line  47:  Called die
 * The specific snippet of code:
 * The specific snippet of code:
 *  # These functions die because calls to them during the 
depend phase
 *  # These functions die because calls to them during the 
depend phase
 * 
 * 
 * If you need support, post the output of `emerge --info 
'=dev-java/ibm-jre-bin-1.6.0.9_p2::gentoo'`,
 * If you need support, post the output of `emerge --info 
'=dev-java/ibm-jre-bin-1.6.0.9_p1::gentoo'`,
 * the complete build log and the output of `emerge -pqv 
'=dev-java/ibm-jre-bin-1.6.0.9_p2::gentoo'`.
 * the complete build log and the output of `emerge -pqv 
'=dev-java/ibm-jre-bin-1.6.0.9_p1::gentoo'`.
 * Working directory: 

Re: [gentoo-portage-dev] [PATCH 16/18] Disallow helpers in global scope in EAPI 6

2015-01-16 Thread Zac Medico
On 01/16/2015 02:14 AM, Sergei Trofimovich wrote:
 On Mon,  1 Dec 2014 22:28:34 +0100
 Michał Górny mgo...@gentoo.org wrote:
 
 Disallow calling most of the ebuild helpers in global scope since they
 are meaningless in that context. Most of them are also prohibited by PMS
 for all EAPIs, so EAPI 6 sounds like a good moment to finally enforce
 that restriction.
 ---
  bin/eapi.sh | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/bin/eapi.sh b/bin/eapi.sh
 index e0ade02..5ab92f4 100644
 --- a/bin/eapi.sh
 +++ b/bin/eapi.sh
 @@ -159,7 +159,7 @@ ___eapi_helpers_can_die() {
  }
  
  ___eapi_disallows_helpers_in_global_scope() {
 -[[ ${1-${EAPI}} =~ ^(4-python|5-progress)$ ]]
 +[[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-slot-abi|5|5-hdepend)$ ]]
  }
  
  ___eapi_unpack_is_case_sensitive() {
 
 Looks like it cries on ebuilds with unset EAPI in main tree (attached).
 Can be easily fixed in tree by adding EAPI=0, but better handle it
 here: ${EAPI-0} (untested!)

Using ${EAPI-0} would not be the correct fix, because portage is
supposed to export the EAPI that was previously determined via the
_parse_eapi_ebuild_head function (preprocessor).
-- 
Thanks,
Zac



Re: [gentoo-portage-dev] [PATCH 16/18] Disallow helpers in global scope in EAPI 6

2015-01-16 Thread Zac Medico
On 01/16/2015 10:18 AM, Zac Medico wrote:
 On 01/16/2015 02:14 AM, Sergei Trofimovich wrote:
 On Mon,  1 Dec 2014 22:28:34 +0100
 Michał Górny mgo...@gentoo.org wrote:

 Disallow calling most of the ebuild helpers in global scope since they
 are meaningless in that context. Most of them are also prohibited by PMS
 for all EAPIs, so EAPI 6 sounds like a good moment to finally enforce
 that restriction.
 ---
  bin/eapi.sh | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/bin/eapi.sh b/bin/eapi.sh
 index e0ade02..5ab92f4 100644
 --- a/bin/eapi.sh
 +++ b/bin/eapi.sh
 @@ -159,7 +159,7 @@ ___eapi_helpers_can_die() {
  }
  
  ___eapi_disallows_helpers_in_global_scope() {
 -   [[ ${1-${EAPI}} =~ ^(4-python|5-progress)$ ]]
 +   [[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-slot-abi|5|5-hdepend)$ ]]
  }
  
  ___eapi_unpack_is_case_sensitive() {

 Looks like it cries on ebuilds with unset EAPI in main tree (attached).
 Can be easily fixed in tree by adding EAPI=0, but better handle it
 here: ${EAPI-0} (untested!)
 
 Using ${EAPI-0} would not be the correct fix, because portage is
 supposed to export the EAPI that was previously determined via the
 _parse_eapi_ebuild_head function (preprocessor).

Actually, ebuild.sh unsets the EAPI just before it sources the ebuild,
and then it does this after it sources the ebuild:

  [ ${EAPI+set} = set ] || EAPI=0

So, for any code that is called while the ebuild is being sourced, using
${EAPI-0} would be correct.
-- 
Thanks,
Zac



[gentoo-portage-dev] [PATCH 16/18] Disallow helpers in global scope in EAPI 6

2014-12-01 Thread Michał Górny
Disallow calling most of the ebuild helpers in global scope since they
are meaningless in that context. Most of them are also prohibited by PMS
for all EAPIs, so EAPI 6 sounds like a good moment to finally enforce
that restriction.
---
 bin/eapi.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index e0ade02..5ab92f4 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -159,7 +159,7 @@ ___eapi_helpers_can_die() {
 }
 
 ___eapi_disallows_helpers_in_global_scope() {
-   [[ ${1-${EAPI}} =~ ^(4-python|5-progress)$ ]]
+   [[ ! ${1-${EAPI}} =~ ^(0|1|2|3|4|4-slot-abi|5|5-hdepend)$ ]]
 }
 
 ___eapi_unpack_is_case_sensitive() {
-- 
2.1.3