aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Dolbec <dolsen@gentoo.org>2016-05-05 09:04:54 -0700
committerBrian Dolbec <dolsen@gentoo.org>2016-05-14 11:29:40 -0700
commit1f4d8908748dc59c362d655db3f6fe3b4c913476 (patch)
tree3897decde5f97c5ba252f87436e77691e7dec29d
parentrepoman/modules/.../pkgmetadata.py: Fix failed missing doctype detection (diff)
downloadportage-1f4d8908748dc59c362d655db3f6fe3b4c913476.tar.gz
portage-1f4d8908748dc59c362d655db3f6fe3b4c913476.tar.bz2
portage-1f4d8908748dc59c362d655db3f6fe3b4c913476.zip
repoman/modules/.../pkgmetadata.py: Add code to remove mostly duplicate errors
Some types of errors produce two error messages cluttering up the output. The first error message is clearer, listing the possible option values allowed. This filters out the second error message for that same line and attribute.
-rw-r--r--pym/repoman/modules/scan/metadata/pkgmetadata.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/pym/repoman/modules/scan/metadata/pkgmetadata.py b/pym/repoman/modules/scan/metadata/pkgmetadata.py
index d8344c293..433551aed 100644
--- a/pym/repoman/modules/scan/metadata/pkgmetadata.py
+++ b/pym/repoman/modules/scan/metadata/pkgmetadata.py
@@ -221,11 +221,16 @@ class PkgMetadata(ScanBase, USEFlagChecks):
return uselist
def _add_validate_errors(self, xpkg, log):
+ listed = set()
for error in log:
- self.qatracker.add_error(
- "metadata.bad",
- "%s/metadata.xml: line: %s, %s"
- % (xpkg, error.line, error.message))
+ msg_prefix = error.message.split(":",1)[0]
+ info = "%s %s" % (error.line, msg_prefix)
+ if info not in listed:
+ listed.add(info)
+ self.qatracker.add_error(
+ "metadata.bad",
+ "%s/metadata.xml: line: %s, %s"
+ % (xpkg, error.line, error.message))
@property
def runInPkgs(self):