public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download: 
* [gentoo-portage-dev] [PATCH 4/6] Make eapi_is_supported() reuse _supported_eapis list
  @ 2014-08-18 17:51 99% ` Michał Górny
  0 siblings, 0 replies; 1+ results
From: Michał Górny @ 2014-08-18 17:51 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Michał Górny

Make the eapi_is_supported() function use the generated list of
supported EAPIs rather than partial lists and integer comparison.
---
 pym/portage/__init__.py | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 18b2599..66bfeb0 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -505,19 +505,7 @@ def eapi_is_supported(eapi):
 		eapi = str(eapi)
 	eapi = eapi.strip()
 
-	if _eapi_is_deprecated(eapi):
-		return True
-
-	if eapi in _testing_eapis:
-		return True
-
-	try:
-		eapi = int(eapi)
-	except ValueError:
-		eapi = -1
-	if eapi < 0:
-		return False
-	return eapi <= portage.const.EAPI
+	return eapi in _supported_eapis
 
 # This pattern is specified by PMS section 7.3.1.
 _pms_eapi_re = re.compile(r"^[ \t]*EAPI=(['\"]?)([A-Za-z0-9+_.-]*)\1[ \t]*([ \t]#.*)?$")
-- 
2.0.4



^ permalink raw reply related	[relevance 99%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2014-08-18 17:51     [gentoo-portage-dev] [PATCHES] Random issues and refactoring before EAPI6 series Michał Górny
2014-08-18 17:51 99% ` [gentoo-portage-dev] [PATCH 4/6] Make eapi_is_supported() reuse _supported_eapis list 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