public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-portage-dev] [PATCH] Fix off-by-one error in supported EAPI list
@ 2014-08-17 18:37 Michał Górny
  2014-08-17 18:44 ` Brian Dolbec
  0 siblings, 1 reply; 4+ messages in thread
From: Michał Górny @ 2014-08-17 18:37 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Michał Górny

Fix the off-by-one error in construction of supported EAPI list that
resulted in EAPI 5 being considered unsupported.
---
 pym/portage/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index fdbc4a8..18b2599 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -493,7 +493,7 @@ _doebuild_manifest_exempt_depend = 0
 
 _testing_eapis = frozenset(["4-python", "4-slot-abi", "5-progress", "5-hdepend"])
 _deprecated_eapis = frozenset(["4_pre1", "3_pre2", "3_pre1", "5_pre1", "5_pre2"])
-_supported_eapis = frozenset([str(x) for x in range(portage.const.EAPI)] + list(_testing_eapis) + list(_deprecated_eapis))
+_supported_eapis = frozenset([str(x) for x in range(portage.const.EAPI + 1)] + list(_testing_eapis) + list(_deprecated_eapis))
 
 def _eapi_is_deprecated(eapi):
 	return eapi in _deprecated_eapis
-- 
2.0.4



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

* Re: [gentoo-portage-dev] [PATCH] Fix off-by-one error in supported EAPI list
  2014-08-17 18:37 [gentoo-portage-dev] [PATCH] Fix off-by-one error in supported EAPI list Michał Górny
@ 2014-08-17 18:44 ` Brian Dolbec
  2014-08-17 18:58   ` Michał Górny
  0 siblings, 1 reply; 4+ messages in thread
From: Brian Dolbec @ 2014-08-17 18:44 UTC (permalink / raw
  To: gentoo-portage-dev

On Sun, 17 Aug 2014 20:37:10 +0200
Michał Górny <mgorny@gentoo.org> wrote:

> Fix the off-by-one error in construction of supported EAPI list that
> resulted in EAPI 5 being considered unsupported.
> ---
>  pym/portage/__init__.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
> index fdbc4a8..18b2599 100644
> --- a/pym/portage/__init__.py
> +++ b/pym/portage/__init__.py
> @@ -493,7 +493,7 @@ _doebuild_manifest_exempt_depend = 0
>  
>  _testing_eapis = frozenset(["4-python", "4-slot-abi", "5-progress",
> "5-hdepend"]) _deprecated_eapis = frozenset(["4_pre1", "3_pre2",
> "3_pre1", "5_pre1", "5_pre2"]) -_supported_eapis = frozenset([str(x)
> for x in range(portage.const.EAPI)] + list(_testing_eapis) +
> list(_deprecated_eapis)) +_supported_eapis = frozenset([str(x) for x
> in range(portage.const.EAPI + 1)] + list(_testing_eapis) +
> list(_deprecated_eapis)) def _eapi_is_deprecated(eapi): return eapi
> in _deprecated_eapis

Hmm, I thought EAPI was suppose to be a string...

from portage/const.py:

EAPI                     = 5

which is clearly an integer.

Shouldn't it be a list of supported EAPI's if it is a string?
Then you'd also have to change the range() use to a len of EAPI.split()


-- 
Brian Dolbec <dolsen>



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

* [gentoo-portage-dev] [PATCH] Fix off-by-one error in supported EAPI list
@ 2014-08-17 18:48 Michał Górny
  0 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2014-08-17 18:48 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Michał Górny

Fix the off-by-one error in construction of supported EAPI list that
resulted in EAPI 5 being considered unsupported.
---
 pym/portage/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index fdbc4a8..18b2599 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -493,7 +493,7 @@ _doebuild_manifest_exempt_depend = 0
 
 _testing_eapis = frozenset(["4-python", "4-slot-abi", "5-progress", "5-hdepend"])
 _deprecated_eapis = frozenset(["4_pre1", "3_pre2", "3_pre1", "5_pre1", "5_pre2"])
-_supported_eapis = frozenset([str(x) for x in range(portage.const.EAPI)] + list(_testing_eapis) + list(_deprecated_eapis))
+_supported_eapis = frozenset([str(x) for x in range(portage.const.EAPI + 1)] + list(_testing_eapis) + list(_deprecated_eapis))
 
 def _eapi_is_deprecated(eapi):
 	return eapi in _deprecated_eapis
-- 
2.0.4



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

* Re: [gentoo-portage-dev] [PATCH] Fix off-by-one error in supported EAPI list
  2014-08-17 18:44 ` Brian Dolbec
@ 2014-08-17 18:58   ` Michał Górny
  0 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2014-08-17 18:58 UTC (permalink / raw
  To: Brian Dolbec; +Cc: gentoo-portage-dev

[-- Attachment #1: Type: text/plain, Size: 767 bytes --]

Dnia 2014-08-17, o godz. 11:44:55
Brian Dolbec <dolsen@gentoo.org> napisał(a):

> Hmm, I thought EAPI was suppose to be a string...
> 
> from portage/const.py:
> 
> EAPI                     = 5
> 
> which is clearly an integer.

It generally is. However, the Council-defined EAPIs match integers
so far and portage seems to be taking advantage of that.

> Shouldn't it be a list of supported EAPI's if it is a string?

From a quick grep, this constant is used twice:

1. to generate the _supported_eapis list using range(),

2. to output newest supported EAPI when EAPI masking occurs.

We could supposedly replace that with list of officially supported
EAPIs but I don't have any strong opinion on this...

-- 
Best regards,
Michał Górny

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 949 bytes --]

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

end of thread, other threads:[~2014-08-17 18:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-17 18:37 [gentoo-portage-dev] [PATCH] Fix off-by-one error in supported EAPI list Michał Górny
2014-08-17 18:44 ` Brian Dolbec
2014-08-17 18:58   ` Michał Górny
  -- strict thread matches above, loose matches on Subject: below --
2014-08-17 18:48 Michał Górny

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