xmlint can produce garbage output even on success, so only dump the ouput when it...
authorZac Medico <zmedico@gentoo.org>
Sat, 26 May 2007 01:26:20 +0000 (01:26 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 26 May 2007 01:26:20 +0000 (01:26 -0000)
svn path=/main/trunk/; revision=6631

bin/repoman

index 901b2c3c34df33b97ab6833384189a026a933ae1..f47911665da7d7a564d950113392da24d9899958 100755 (executable)
@@ -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")