tarantool / mkrepo

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

rpm: fix primary.xml - part 3 #73

Closed urbanchef closed 1 year ago

urbanchef commented 1 year ago

Repeat the original behavior of rpm-software-management/createrepo_c when generating <rpm:requires> entries by keeping only the highest version of libc.so.6 in <rpm:requires> [1,2].

For example, here's how mkrepo built before this patch. Note multiple libc.so.6 entries.

<rpm:requires>
  <rpm:entry name="libc.so.6()(64bit)"/>
  <rpm:entry name="libc.so.6(GLIBC_2.11)(64bit)"/>
  <rpm:entry name="libc.so.6(GLIBC_2.14)(64bit)"/>
  <rpm:entry name="libc.so.6(GLIBC_2.15)(64bit)"/>
  <rpm:entry name="libc.so.6(GLIBC_2.2.5)(64bit)"/>
  <rpm:entry name="libc.so.6(GLIBC_2.3)(64bit)"/>
  <rpm:entry name="libc.so.6(GLIBC_2.3.4)(64bit)"/>
  <rpm:entry name="libc.so.6(GLIBC_2.4)(64bit)"/>
  <rpm:entry name="libc.so.6(GLIBC_2.8)(64bit)"/>
  <rpm:entry name="libdl.so.2()(64bit)"/>
  <rpm:entry name="libdl.so.2(GLIBC_2.2.5)(64bit)"/>
  <rpm:entry name="libtinfo.so.5()(64bit)"/>
  <rpm:entry name="rtld(GNU_HASH)"/>
</rpm:requires>

And this is how rpm-software-management/createrepo_c is doing the same. Note, only the highest version of libc.so.6 is kept.

<rpm:requires>
  <rpm:entry name="libc.so.6(GLIBC_2.15)(64bit)"/>
  <rpm:entry name="libdl.so.2()(64bit)"/>
  <rpm:entry name="libdl.so.2(GLIBC_2.2.5)(64bit)"/>
  <rpm:entry name="libtinfo.so.5()(64bit)"/>
  <rpm:entry name="rtld(GNU_HASH)"/>
</rpm:requires>

[1] https://github.com/rpm-software-management/createrepo_c/blob/e656df3/src/parsehdr.c#L82 [2] https://github.com/rpm-software-management/createrepo_c/blob/e656df3/src/parsehdr.c#L449

Follows up #71 Follows up #72