diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-07-02 02:10:07 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-07-02 02:10:07 +0000 |
commit | ed822428db0afacb6670b262de9ff398632fb512 (patch) | |
tree | 52f9cf88cda2936bdb1e3ff2ad545d0b2ea3a593 | |
parent | 695e7fe4c6effd1e744d38cf3dfbdad7a34e6e59 (diff) | |
download | portage-ed822428db0afacb6670b262de9ff398632fb512.tar.gz portage-ed822428db0afacb6670b262de9ff398632fb512.tar.bz2 portage-ed822428db0afacb6670b262de9ff398632fb512.zip |
Flatten restrict for the RESTRICT.invalid check. (trunk r7120)
svn path=/main/branches/2.1.2/; revision=7121
-rwxr-xr-x | bin/repoman | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/bin/repoman b/bin/repoman index dfc4778b2..6154e3c89 100755 --- a/bin/repoman +++ b/bin/repoman @@ -172,6 +172,7 @@ qahelp={ "PDEPEND.syntax":"Syntax error in PDEPEND (usually an extra/missing space/parenthesis)", "LICENSE.syntax":"Syntax error in LICENSE (usually an extra/missing space/parenthesis)", "PROVIDE.syntax":"Syntax error in PROVIDE (usually an extra/missing space/parenthesis)", + "RESTRICT.syntax":"Syntax error in RESTRICT (usually an extra/missing space/parenthesis)", "SRC_URI.syntax":"Syntax error in SRC_URI (usually an extra/missing space/parenthesis)", "ebuild.syntax":"Error generating cache entry for ebuild; typically caused by ebuild syntax error", "ebuild.output":"A simple sourcing of the ebuild produces output; this breaks ebuild policy.", @@ -1351,12 +1352,21 @@ for x in scanlist: fails["KEYWORDS.invalid"].append(x+"/"+y+".ebuild: %s (profile invalid)" % mykey) #restrict checks - myrestrict = set(myaux["RESTRICT"].split()) - mybadrestrict = myrestrict.difference(valid_restrict) - if mybadrestrict: - stats["RESTRICT.invalid"] += len(mybadrestrict) - for mybad in mybadrestrict: - fails["RESTRICT.invalid"].append(x+"/"+y+".ebuild: %s" % mybad) + myrestrict = None + try: + myrestrict = portage_dep.use_reduce( + portage_dep.paren_reduce(myaux["RESTRICT"]), matchall=1) + except portage_exception.InvalidDependString, e: + stats["RESTRICT.syntax"] = stats["RESTRICT.syntax"] + 1 + fails["RESTRICT.syntax"].append(mykey+".ebuild RESTRICT: "+str(e)) + del e + if myrestrict: + myrestrict = set(portage.flatten(myrestrict)) + mybadrestrict = myrestrict.difference(valid_restrict) + if mybadrestrict: + stats["RESTRICT.invalid"] += len(mybadrestrict) + for mybad in mybadrestrict: + fails["RESTRICT.invalid"].append(x+"/"+y+".ebuild: %s" % mybad) #syntax checks myear = time.gmtime(os.stat(checkdir+"/"+y+".ebuild")[ST_MTIME])[0] |