From: Zac Medico Date: Sat, 26 May 2007 01:27:17 +0000 (-0000) Subject: xmlint can produce garbage output even on success, so only dump the ouput when it... X-Git-Tag: v2.1.2.9~15 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d3c996bc15b2e9956c80fa18e024497b184ca267;p=portage.git xmlint can produce garbage output even on success, so only dump the ouput when it fails. See bug #179008. (trunk r6631) svn path=/main/branches/2.1.2/; revision=6632 --- diff --git a/bin/repoman b/bin/repoman index 003caeb32..51b3ba535 100755 --- a/bin/repoman +++ b/bin/repoman @@ -968,10 +968,15 @@ for x in scanlist: else: #Only carry out if in package directory or check forced if xmllint_capable: - st = spawn(["xmllint", "--nonet", "--noout", "--nowarning", "--dtdvalid", - metadata_dtd, os.path.join(checkdir, "metadata.xml")]) + # xmlint can produce garbage output even on success, so only dump + # the ouput when it fails. + st, out = getstatusoutput( + "xmllint --nonet --noout --dtdvalid '%s' '%s'" % \ + (metadata_dtd, os.path.join(checkdir, "metadata.xml"))) if st != os.EX_OK: - print red("!!! metadata.xml is invalid") + print red("!!!") + " metadata.xml is invalid:" + for z in out.splitlines(): + print red("!!! ")+z stats["metadata.bad"]+=1 fails["metadata.bad"].append(x+"/metadata.xml")