From 4930057bcb1b659a3075739dd46edafbbdd6deb9 Mon Sep 17 00:00:00 2001 From: Sebastian Luther Date: Tue, 13 Apr 2010 16:33:28 +0200 Subject: [PATCH] Add repoman check for REQUIRED_USE --- bin/repoman | 17 +++++++++++++++++ pym/portage/dep/__init__.py | 4 ++++ 2 files changed, 21 insertions(+) diff --git a/bin/repoman b/bin/repoman index 0115c2885..2a53bd27e 100755 --- a/bin/repoman +++ b/bin/repoman @@ -322,6 +322,7 @@ qahelp={ "PROVIDE.syntax":"Syntax error in PROVIDE (usually an extra/missing space/parenthesis)", "PROPERTIES.syntax":"Syntax error in PROPERTIES (usually an extra/missing space/parenthesis)", "RESTRICT.syntax":"Syntax error in RESTRICT (usually an extra/missing space/parenthesis)", + "REQUIRED_USE.syntax":"Syntax error in REQUIRED_USE (usually an extra/missing space/parenthesis)", "SRC_URI.syntax":"Syntax error in SRC_URI (usually an extra/missing space/parenthesis)", "SRC_URI.mirror":"A uri listed in profiles/thirdpartymirrors is found in SRC_URI", "ebuild.syntax":"Error generating cache entry for ebuild; typically caused by ebuild syntax error or digest verification failure", @@ -1785,6 +1786,22 @@ for x in scanlist: stats["RESTRICT.invalid"] += len(mybadrestrict) for mybad in mybadrestrict: fails["RESTRICT.invalid"].append(x+"/"+y+".ebuild: %s" % mybad) + #REQUIRED_USE check + required_use = myaux["REQUIRED_USE"] + if required_use: + if eapi in ("0", "1", "2", "3"): + stats['EAPI.incompatible'] += 1 + fails['EAPI.incompatible'].append( + relative_path + ": REQUIRED_USE" + \ + " not supported with EAPI='%s'" % (eapi,)) + try: + portage.dep.check_required_use(required_use, "", myaux["IUSE"].split()) + except portage.exception.InvalidRequiredUseString as e: + stats["REQUIRED_USE.syntax"] = stats["REQUIRED_USE.syntax"] + 1 + fails["REQUIRED_USE.syntax"].append( + "%s: REQUIRED_USE: %s" % (relative_path, e)) + del e + # Syntax Checks relative_path = os.path.join(x, y + ".ebuild") full_path = os.path.join(repodir, relative_path) diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py index a2dbbe9d0..30b181988 100644 --- a/pym/portage/dep/__init__.py +++ b/pym/portage/dep/__init__.py @@ -1450,6 +1450,10 @@ def _check_required_use(constraints, use, iuse): ("check_required_use(): '%s' constraint list without " + \ "use conditional or operator") % (constraints,)) + if not constraint: + raise portage.exception.InvalidRequiredUseString( + ("check_required_use(): '%s' syntax error") % (constraints,) ) + if constraint[-1] == "?": #a use conditional skip_next = True -- 2.26.2