commit:     cfc31c04bf6e1d59b2756e3ac315a2040cdd162d
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed May  4 06:08:50 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat May 14 18:29:40 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=cfc31c04

repoman/modules/.../pkgmetadata.py: Fix failed missing doctype detection

The docinfo is always created, so is not valid to use like a boolean to detect 
a missing
doctype.
doctype is a null string or equivalent and as such the correct choice for the 
if statement.

Failure discoverd by: Göktürk Yüksek <gokturk <AT> binghamton.edu> 
Thank you

 pym/repoman/modules/scan/metadata/pkgmetadata.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/repoman/modules/scan/metadata/pkgmetadata.py 
b/pym/repoman/modules/scan/metadata/pkgmetadata.py
index 83ca93f..d8344c2 100644
--- a/pym/repoman/modules/scan/metadata/pkgmetadata.py
+++ b/pym/repoman/modules/scan/metadata/pkgmetadata.py
@@ -106,7 +106,7 @@ class PkgMetadata(ScanBase, USEFlagChecks):
                                "xml declaration encoding should be '%s', not 
'%s'" %
                                (xpkg, metadata_xml_encoding, xml_encoding))
 
-               if not _metadata_xml.docinfo:
+               if not _metadata_xml.docinfo.doctype:
                        metadata_bad = True
                        self.qatracker.add_error(
                                "metadata.bad",

Reply via email to