rpm-software-management/createrepo_c

Parser doesn't decode requirement attribute values

dralley opened this issue · 1 comments

Provided this XML:

<package type="rpm">
  <name>bpg-algeti-fonts</name>
  <arch>noarch</arch>
  <version epoch="0" ver="2.005" rel="11.el8"/>
  <checksum type="sha256" pkgid="YES">a8a037218867c6f04ceccedc6fe02b0ed1ffa0caba3b4bbf74d213054d3c7b7e</checksum>
  <summary>Algeti Family of BPG Georgian Fonts</summary>
  <description>BPG Fonts are a set of GPL licensed Georgian Unicode fonts.

This package contains the Algeti font family.</description>
  <packager>CloudLinux Packaging Team &lt;packager@cloudlinux.com&gt;</packager>
  <url>http://groups.google.com/group/bpg-fonts</url>
  <time file="1610618208" build="1597662384"/>
  <size package="39932" installed="43077" archive="44028"/>
  <location href="Packages/bpg-algeti-fonts-2.005-11.el8.noarch.rpm"/>
  <format>
    <rpm:license>GPL+ with exceptions</rpm:license>
    <rpm:vendor>CloudLinux</rpm:vendor>
    <rpm:group>Unspecified</rpm:group>
    <rpm:buildhost>build.cloudlinux.com</rpm:buildhost>
    <rpm:sourcerpm>bpg-fonts-20120413-11.el8.src.rpm</rpm:sourcerpm>
    <rpm:header-range start="5144" end="11960"/>
    <rpm:provides>
      <rpm:entry name="bpg-algeti-fonts" flags="EQ" epoch="0" ver="2.005" rel="11.el8"/>
      <rpm:entry name="config(bpg-algeti-fonts)" flags="EQ" epoch="0" ver="2.005" rel="11.el8"/>
      <rpm:entry name="font(:lang=fj)"/>
      <rpm:entry name="font(:lang=ho)"/>
      <rpm:entry name="font(:lang=ia)"/>
      <rpm:entry name="font(:lang=ie)"/>
      <rpm:entry name="font(:lang=io)"/>
      <rpm:entry name="font(:lang=ka)"/>
      <rpm:entry name="font(:lang=kj)"/>
      <rpm:entry name="font(:lang=kwm)"/>
      <rpm:entry name="font(:lang=ms)"/>
      <rpm:entry name="font(:lang=ng)"/>
      <rpm:entry name="font(:lang=nr)"/>
      <rpm:entry name="font(:lang=om)"/>
      <rpm:entry name="font(:lang=rn)"/>
      <rpm:entry name="font(:lang=rw)"/>
      <rpm:entry name="font(:lang=sn)"/>
      <rpm:entry name="font(:lang=so)"/>
      <rpm:entry name="font(:lang=ss)"/>
      <rpm:entry name="font(:lang=st)"/>
      <rpm:entry name="font(:lang=sw)"/>
      <rpm:entry name="font(:lang=ts)"/>
      <rpm:entry name="font(:lang=uz)"/>
      <rpm:entry name="font(:lang=xh)"/>
      <rpm:entry name="font(:lang=za)"/>
      <rpm:entry name="font(:lang=zu)"/>
      <rpm:entry name="font(bpgalgetigpl&amp;gnu)"/>
      <rpm:entry name="metainfo()"/>
      <rpm:entry name="metainfo(bpg-algeti.metainfo.xml)"/>
    </rpm:provides>
    <rpm:requires>
      <rpm:entry name="bpg-fonts-common" flags="EQ" epoch="0" ver="20120413" rel="11.el8"/>
    </rpm:requires>
    <file>/etc/fonts/conf.d/64-bpg.conf-algeti.conf</file>
  </format>
</package>

In the resulting parsed package, the attribute value in this part <rpm:entry name="font(bpgalgetigpl&amp;gnu)"/> is not decoded.

>>> print(createrepo_pkg.provides[-3])
('font(bpgalgetigpl&#38;gnu)', None, None, None, None, False)

Which means that when it gets written back as XML, it gets double-encoded.

>>> cr.xml_dump_primary(createrepo_pkg)[-380:]
'rpm:entry name="font(bpgalgetigpl&amp;#38;gnu)"/>\n     .......

This is present in the alma linux 8 appstream repo, presumably centos8-stream as well.

Closing as duplicate of #286