summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-01-10 10:14:17 +0000
committerZac Medico <zmedico@gentoo.org>2009-01-10 10:14:17 +0000
commit4e1ab70684b925f4b5d4caab9670dca2b0ffd262 (patch)
treec7cbfaac86b228b97ba68d204b6fff7b449a231d
parentccc2fe960fe439ddbec89f95173d4c322784425c (diff)
downloadportage-4e1ab70684b925f4b5d4caab9670dca2b0ffd262.tar.gz
portage-4e1ab70684b925f4b5d4caab9670dca2b0ffd262.tar.bz2
portage-4e1ab70684b925f4b5d4caab9670dca2b0ffd262.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. svn path=/main/trunk/; revision=12413
-rwxr-xr-xbin/repoman12
-rw-r--r--man/repoman.13
2 files changed, 15 insertions, 0 deletions
diff --git a/bin/repoman b/bin/repoman
index 0fdef5181..726939293 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)
diff --git a/man/repoman.1 b/man/repoman.1
index 0380adfd6..754214049 100644
--- a/man/repoman.1
+++ b/man/repoman.1
@@ -263,6 +263,9 @@ Bad metadata.xml files
.B metadata.missing
Missing metadata.xml files
.TP
+.B metadata.warning
+Warnings in metadata.xml files
+.TP
.B upstream.workaround
The ebuild works around an upstream bug, an upstream bug should be filed and
tracked in bugs.gentoo.org