from portage.util import cmp_sort_key, writemsg_level
from portage.package.ebuild.digestgen import digestgen
from portage.eapi import eapi_has_src_uri_arrows, eapi_has_slot_deps, \
- eapi_has_use_deps, eapi_has_strong_blocks, eapi_has_iuse_defaults
+ eapi_has_use_deps, eapi_has_strong_blocks, eapi_has_iuse_defaults, \
+ eapi_has_required_use
if sys.hexversion >= 0x3000000:
basestring = str
#REQUIRED_USE check
required_use = myaux["REQUIRED_USE"]
if required_use:
- if eapi in ("0", "1", "2", "3"):
+ if not eapi_has_required_use(eapi):
stats['EAPI.incompatible'] += 1
fails['EAPI.incompatible'].append(
relative_path + ": REQUIRED_USE" + \
from portage.dbapi import dbapi
from portage.dbapi.dep_expand import dep_expand
from portage.dep import Atom
-from portage.eapi import eapi_has_strong_blocks
+from portage.eapi import eapi_has_strong_blocks, eapi_has_required_use
from portage.output import bold, blue, colorize, create_color_func, darkblue, \
darkgreen, green, nc_len, red, teal, turquoise, yellow
bad = create_color_func("BAD")
#check REQUIRED_USE constraints
if not pkg.built and pkg.metadata["REQUIRED_USE"] and \
- pkg.metadata["EAPI"] not in ("0", "1", "2", "3"):
+ eapi_has_required_use(pkg.metadata["EAPI"]):
required_use = pkg.metadata["REQUIRED_USE"]
use = pkg.use.enabled
iuse = self._frozen_config.settings._get_implicit_iuse()
_MaskReason("invalid", "invalid: %s" % (msg,)))
if pkg.metadata["REQUIRED_USE"] and \
- pkg.metadata["EAPI"] not in ("0", "1", "2", "3"):
+ eapi_has_required_use(pkg.metadata["EAPI"]):
required_use = pkg.metadata["REQUIRED_USE"]
use = pkg.use.enabled
iuse = pkgsettings._get_implicit_iuse()
def eapi_has_dosed_dohard(eapi):
return eapi in ("0", "1", "2", "3")
+
+def eapi_has_required_use(eapi):
+ return eapi not in ("0", "1", "2", "3")