summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/repoman5
-rw-r--r--pym/_emerge/depgraph.py6
-rw-r--r--pym/portage/eapi.py3
3 files changed, 9 insertions, 5 deletions
diff --git a/bin/repoman b/bin/repoman
index e6c281eac..09e7f02f1 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -73,7 +73,8 @@ from portage.output import ConsoleStyleFile, StyleWriter
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
@@ -1774,7 +1775,7 @@ for x in scanlist:
#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" + \
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 7a717df03..c66072835 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -17,7 +17,7 @@ from portage.const import PORTAGE_PACKAGE_ATOM
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")
@@ -2826,7 +2826,7 @@ class depgraph(object):
#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()
@@ -6184,7 +6184,7 @@ def _get_masking_status(pkg, pkgsettings, root_config):
_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()
diff --git a/pym/portage/eapi.py b/pym/portage/eapi.py
index 9f3394379..a288b1964 100644
--- a/pym/portage/eapi.py
+++ b/pym/portage/eapi.py
@@ -39,3 +39,6 @@ def eapi_has_implicit_rdepend(eapi):
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")