From: Fabian Groffen Date: Sun, 12 Apr 2009 17:45:26 +0000 (-0000) Subject: remove prefix handling/parsing in eapi_is_supported, revert to trunk version X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=ea63f1e2bb763c3c7dca8c512fe310ea7d7b5c94;p=portage.git remove prefix handling/parsing in eapi_is_supported, revert to trunk version svn path=/main/branches/prefix/; revision=13336 --- diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index aa90dcade..145a0656a 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -5072,33 +5072,21 @@ def _eapi_is_deprecated(eapi): return eapi in _deprecated_eapis def eapi_is_supported(eapi): - # PREFIX HACK/EXTENSION: in prefix we have "incompatible" ebuilds in - # an consistent manner; regardless what the EAPI of the main tree - # ebuild is, we always need the prefix extension which by itself can - # have a version too. In EAPI we allow to have multiple components - # separated by spaces to cater for this. In general we could extend - # it here to contain ':' tokens, where is a - # string, and a number. If ':' is omitted, it would be - # assumed to be the EAPI version as used in the main tree, if - # ':' is omitted, version 0 would be assumed. This way an - # unset EAPI would make main tree EAPI 0, and 'EAPI="prefix"' would - # mean main tree EAPI 0, prefix tree EAPI 0. - # However, back to reality, we just look for all we require, - # and don't do version tricks other than the main tree does. - - eapi = str(eapi).split() # note Python's contract for this special case - - # check what's supported (can) - properties = set(_testing_eapis) # another clumpsy solution - properties.add("prefix") # clumpsy temporary solution - for i in range(portage.const.EAPI + 1): - properties.add(str(i)) - - for v in eapi: - if v not in properties: - return False - - return True + eapi = str(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 # Generally, it's best not to assume that cache entries for unsupported EAPIs # can be validated. However, the current package manager specification does not