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:27:17 +0000 (01:27 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 26 May 2007 01:27:17 +0000 (01:27 -0000)
svn path=/main/branches/2.1.2/; revision=6632

bin/repoman

index 003caeb322addf7592de7c9715686867a7fd42ee..51b3ba53572d13953b7b4abd4f82c1e2d375e1b7 100755 (executable)
@@ -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")