tarantool / mkrepo

Maintain DEB and RPM repositories on S3
69 stars 24 forks source link

Generating an invalid xml file with the & symbol #86

Closed sonaton closed 7 months ago

sonaton commented 9 months ago

The utility generates a file that does not pass xml validation and which is not read by yum.

example: package: https://mirror.yandex.ru/centos/7/os/x86_64/Packages/hunspell-el-0.8-7.el7.noarch.rpm

result primary.xml:

<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://linux.duke.edu/metadata/common" xmlns:rpm="http://linux.duke.edu/metadata/rpm" packages="1">
<package type="rpm">
  <name>hunspell-el</name>
  <arch>noarch</arch>
  <version epoch="1" ver="0.8" rel="7.el7"/>
  <checksum type="sha256" pkgid="YES">b42a5d9db2bd1ca5fc8853ee81b90ac33c47c460cc85ff8d0b480e4ed89e8c98</checksum>
  <summary>Greek hunspell dictionaries</summary>
  <description>Greek hunspell dictionaries.</description>
  <packager>CentOS BuildSystem &lt;http://bugs.centos.org&gt;</packager>
  <url>http://ispell.math.upatras.gr/?section=oofficespell&subsection=howto</url>
  <time file="1694596934" build="1402344145"/>
  <size package="1414768" installed="7025304" archive="7026320"/>
  <location href="Packages/hunspell-el-0.8-7.el7.noarch.rpm"/>
  <format>
    <rpm:license>GPLv2+ or LGPLv2+ or MPLv1.1</rpm:license>
    <rpm:vendor>CentOS</rpm:vendor>
    <rpm:group>Applications/Text</rpm:group>
    <rpm:buildhost>worker1.bsys.centos.org</rpm:buildhost>
    <rpm:sourcerpm>hunspell-el-0.8-7.el7.src.rpm</rpm:sourcerpm>
    <rpm:header-range start="1384" end="5208"/>
    <rpm:provides>
      <rpm:entry name="hunspell-el" flags="EQ" epoch="1" ver="0.8" rel="7.el7"/>
    </rpm:provides>
    <rpm:requires>
      <rpm:entry name="hunspell"/>
    </rpm:requires>
    <rpm:obsoletes>
    </rpm:obsoletes>
  </format>
</package>
</metadata>

validation result: Error : InvalidChar Line : 11 Message : char '&' is not expected.

yum error: (process:30319): GLib-WARNING **: 09:31:48.638: GError set over the top of a previous GError or uninitialized memory. This indicates a bug in someone's code. You must ensure an error is NULL before it's set. The overwriting error message was: Parsing primary.xml error: EntityRef: expecting ';'