diff options
author | Sebastian Pipping <sping@gentoo.org> | 2020-01-31 18:51:23 +0100 |
---|---|---|
committer | Sebastian Pipping <sping@gentoo.org> | 2020-01-31 18:54:35 +0100 |
commit | 0c06fc1d848f0b891b210778b2a99b7396aa8871 (patch) | |
tree | 602f75184146313707000ca5458b3f522e19d132 | |
parent | Merge branch 'pypi' (diff) | |
download | metagen-0c06fc1d848f0b891b210778b2a99b7396aa8871.tar.gz metagen-0c06fc1d848f0b891b210778b2a99b7396aa8871.tar.bz2 metagen-0c06fc1d848f0b891b210778b2a99b7396aa8871.zip |
Get document type declaration back to a single
Signed-off-by: Sebastian Pipping <sping@gentoo.org>
-rwxr-xr-x | metagen/metagenerator.py | 8 |
1 files changed, 7 insertions, 1 deletions
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(): |