Description of problem:
Currently createrepo does not handle modules information (modules.yaml) and as a result there are problems with repositories created from RHEL8 packages. Modules.yaml must be handled separately at the moment
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Reposync RHEL8 repo:
dnf reposync --newest-only --repoid=rhel-8-for-x86_64-appstream-rpms --download-path=/var/www/html/rhel8 --downloadcomps --download-metadata
createrepo -v /var/www/html/rhel8/rhel-8-for-x86_64-appstream-rpms/ -g comps.xml
2. Enable new repo
3. Try updating packages from the new repo
`dnf update` shows packages conflicts:
Problem 1: cannot install both perl-libs-4:5.24.4-404.module+el8.1.0+2926+ce7246ad.x86_64 and perl-libs-4:5.26.3-416.el8.x86_64
- package perl-Digest-1.17-396.module+el8.1.0+2926+ce7246ad.noarch requires perl(:MODULE_COMPAT_5.24.4), but none of the providers can be installed
- cannot install the best update candidate for package perl-libs-4:5.26.3-416.el8.x86_64
- cannot install the best update candidate for package perl-Digest-1.17-395.el8.noarch
There is conflict between perl:5.24 and perl:5.26 stream
The problem arises because there is no information about modules in rpms. So createrepo does not see the information about modules and so is not able to pass this information to the system.
There is workaround: get modules info from the repocache and add it to the created repository:
gunzip -c /var/cache/dnf/AppStream-..../repodata/...........-modules.yaml.gz > /tmp/AppStream-modules.yaml
modifyrepo_c --mdtype=modules /tmp/AppStream-modules.yaml /var/www/html/rhel8/rhel-8-for-x86_64-appstream-rpms
createrepo_c will scan for yaml files in addition to RPMs.
The patterns are:
*.modulemd.yaml (recommended file name: N:S:V:C:A.modulemd.yaml)
*.modulemd-defaults.yaml (recommended file name: N.modulemd-defaults.yaml)
modules.yaml (recommended way of importing multiple documents at once)
The files can come from a directory scan or from -i, --pkglist.
Package list must support a mix of RPMs and yaml documents.
The patterns and supported modulemd documents will be extended in the future as needed. Most likely an extension to support EOL/Obsoletes will be needed:
As the result, all found and supported yaml documents will be merged into [hash-]modules.yaml[.compression] in the repodata with <data type="modules">.
The files should be ordered prior creating modules.yaml to guarantee repeatability. See how createrepo_c orders RPMs.
If combination of individual yaml documents and modules.yaml is used, modules.yaml must go first and individual documents must override relevant parts of its original content.
createrepo_c --update will work work with the yaml documents the same way as createrepo_c in regular (non-update) mode, because the operation is relatively cheap and it's not necessary to compute any checksums as nedded for RPMs.
PR for the described behavior: https://github.com/rpm-software-management/createrepo_c/pull/224