From 0d01f2d786e3fa436ccbd8246e5a20ead6bb2b4f Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 26 May 2007 01:26:20 +0000 Subject: [PATCH] xmlint can produce garbage output even on success, so only dump the ouput when it fails. See bug #179008. svn path=/main/trunk/; revision=6631 --- bin/repoman | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/repoman b/bin/repoman index 901b2c3c3..f47911665 100755 --- a/bin/repoman +++ b/bin/repoman @@ -980,10 +980,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") -- 2.26.2