diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-01-12 08:24:58 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-01-12 08:24:58 +0000 |
commit | 5cfb5c7c6e45422f28c76d47228700bc785596f1 (patch) | |
tree | e86ae30cf74a7b442264a00b523e7744baa9b385 /bin/repoman | |
parent | c7edb4d49338563f4149a91ff524a730b0f330ce (diff) | |
download | portage-5cfb5c7c6e45422f28c76d47228700bc785596f1.tar.gz portage-5cfb5c7c6e45422f28c76d47228700bc785596f1.tar.bz2 portage-5cfb5c7c6e45422f28c76d47228700bc785596f1.zip |
Add a new 'metadata.warning' category and a check which detects local USE
descriptions that are not used in any ebuilds. Thanks to Markus Meier
<maekke@g.o> for the initial patch. (trunk r12413)
svn path=/main/branches/2.1.6/; revision=12469
Diffstat (limited to 'bin/repoman')
-rwxr-xr-x | bin/repoman | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/bin/repoman b/bin/repoman index b8eb9d2ae..129a4296e 100755 --- a/bin/repoman +++ b/bin/repoman @@ -315,6 +315,7 @@ qahelp={ "ebuild.badheader":"This ebuild has a malformed header", "metadata.missing":"Missing metadata.xml files", "metadata.bad":"Bad metadata.xml files", + "metadata.warning":"Warnings in metadata.xml files", "virtual.versioned":"PROVIDE contains virtuals with versions", "virtual.exists":"PROVIDE contains existing package names", "virtual.unavailable":"PROVIDE contains a virtual which contains no profile default", @@ -351,6 +352,7 @@ qawarnings = set(( "file.size", "inherit.autotools", "java.eclassesnotused", +"metadata.warning", "virtual.versioned", "virtual.exists", "virtual.unavailable", @@ -1063,11 +1065,14 @@ for x in scanlist: fails["metadata.bad"].append(x+"/metadata.xml") del metadata_bad + muselist = frozenset(muselist) changelog_path = os.path.join(checkdir_relative, "ChangeLog") changelog_modified = changelog_path in modified_changelogs allmasked = True + # detect unused local USE-descriptions + used_useflags = set() for y in ebuildlist: relative_path = os.path.join(x, y + ".ebuild") @@ -1368,6 +1373,7 @@ for x in scanlist: default_use.append(myflag) if flag_name not in uselist: myuse.append(flag_name) + used_useflags.update(myuse) # uselist checks - metadata for mypos in range(len(myuse)-1,-1,-1): @@ -1576,6 +1582,12 @@ for x in scanlist: stats["ebuild.allmasked"]+=1 fails["ebuild.allmasked"].append(x) + # check if there are unused local USE-descriptions in metadata.xml + for myflag in muselist.difference(used_useflags): + stats["metadata.warning"] += 1 + fails["metadata.warning"].append( + "unused local USE-description: '%s'" % myflag) + if options.mode == "manifest": sys.exit(dofail) |