commit: 0c06fc1d848f0b891b210778b2a99b7396aa8871
Author: Sebastian Pipping <sping <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 31 17:51:23 2020 +0000
Commit: Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Fri Jan 31 17:54:35 2020 +0000
URL: https://gitweb.gentoo.org/proj/metagen.git/commit/?id=0c06fc1d
Get document type declaration back to a single
Signed-off-by: Sebastian Pipping <sping <AT> gentoo.org>
metagen/metagenerator.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/metagen/metagenerator.py b/metagen/metagenerator.py
index e733997..c0b79d7 100755
--- a/metagen/metagenerator.py
+++ b/metagen/metagenerator.py
@@ -75,7 +75,13 @@ class MyMetadata:
# Re-write indentation to tabulators
# (for backwards compatibility and smaller diffs with existing files)
reparsed = minidom.parseString(xml_text)
- return reparsed.toprettyxml(indent='\t', encoding='UTF-8').decode()
+ xml_text = reparsed.toprettyxml(indent='\t', encoding='UTF-8').decode()
+
+ # Get doctype back on a single line
+ # - for compatibility with output produced by metagen <0.7
+ # - to make pkgcheck stop from warning about PkgMetadataXmlIndentation
+ return xml_text.replace('<!DOCTYPE pkgmetadata\n SYSTEM',
+ '<!DOCTYPE pkgmetadata SYSTEM')
def do_tests():