From 349aa60161ab7ad06733abc938bd1b480f8bba51 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 30 Jun 2007 23:38:04 +0000 Subject: Add a QA warning for invalid values of RESTRICT. Thanks to peper for the patch. svn path=/main/trunk/; revision=7102 --- bin/repoman | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'bin') diff --git a/bin/repoman b/bin/repoman index 483eff4e5..e95c88d9d 100755 --- a/bin/repoman +++ b/bin/repoman @@ -183,6 +183,7 @@ qahelp={ "IUSE.invalid":"This ebuild has a variable in IUSE that is not in the use.desc or use.local.desc file", "LICENSE.invalid":"This ebuild is listing a license that doesnt exist in portages license/ dir.", "KEYWORDS.invalid":"This ebuild contains KEYWORDS that are not listed in profiles/arch.list or for which no valid profile was found", + "RESTRICT.invalid":"This ebuild contains invalid RESTRICT values.", "ebuild.nostable":"There are no ebuilds that are marked as stable for your ARCH", "ebuild.allmasked":"All ebuilds are masked for this package (Package level only)", "ebuild.majorsyn":"This ebuild has a major syntax error that may cause the ebuild to fail partially or fully", @@ -217,6 +218,7 @@ qawarnings=[ "IUSE.invalid", "KEYWORDS.stupid", "KEYWORDS.missing", +"RESTRICT.invalid", "ebuild.minorsyn", "ebuild.badheader", "file.size", @@ -240,6 +242,8 @@ for x in missingvars: qacats.append(x) qawarnings.append(x) +valid_restrict = frozenset(["binchecks", "bindist", "fetch", "mirror", + "primaryuri", "strip", "test", "userpriv"]) verbose=0 quiet=0 @@ -1348,6 +1352,14 @@ for x in scanlist: stats["KEYWORDS.invalid"] += 1 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) + #syntax checks myear = time.gmtime(os.stat(checkdir+"/"+y+".ebuild")[ST_MTIME])[0] gentoo_copyright = re.compile(r'^# Copyright ((1999|200\d)-)?' + str(myear) + r' Gentoo Foundation') -- cgit v1.2.3-1-g7c22