Wrong deps are copied to the repo when using "recursive" option to copy rpms
## Cloned from bugzilla 1917076 ##
Description of problem: Pulp solves the wrong dependent packages which will cause conflict to other packages.
Steps to Reproduce:
- Enable the pulp debug log level and restart Pulp services
- On Satellite Web UI, create a content view name "cv_rhel_8", set the "solve dependencies" to "Yes"
- Add "Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs)" repository to the CV.
- Create a filter to include all errata until 1st Oct 2020.
- Create a filter to include all rpms without errata.
- Publish the content view
- Register a rhel 8 host to the CV.
- Run dnf update on the host.
Actual results: Update with dependencies issue as below:
Updating Subscription Management repositories.
Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs) 2.8 MB/s | 21 MB 00:07
Last metadata expiration check: 0:00:08 ago on Thu 14 Jan 2021 08:40:47 PM AEST. Error: Problem 1: package bluez-obexd-5.50-3.el8.x86_64 requires bluez(x86-64) = 5.50-3.el8, but none of the providers can be installed
- cannot install both bluez-5.52-1.el8.x86_64 and bluez-5.50-3.el8.x86_64
- cannot install the best update candidate for package bluez-obexd-5.50-3.el8.x86_64
- cannot install the best update candidate for package bluez-5.50-3.el8.x86_64 Problem 2: problem with installed package bluez-obexd-5.50-3.el8.x86_64
- package bluez-obexd-5.50-3.el8.x86_64 requires bluez-libs(x86-64) = 5.50-3.el8, but none of the providers can be installed
- cannot install both bluez-libs-5.52-1.el8.x86_64 and bluez-libs-5.50-3.el8.x86_64
- cannot install the best update candidate for package bluez-libs-5.50-3.el8.x86_64 (try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
The following libsolv error is printed in the journal log.¶
pulp: pulp_rpm.plugins.importers.yum.pulp_solv:DEBUG: [6c1e9667] (30103-60480) Encountered problems solving: cannot install both kpatch-0:0.6.1-noarch.noarch and kpatch-0:0.6.1-noarch.noarch, cannot install both libnl3-0:3.4.0-i686.i686 and libnl3-0:3.4.0-i686.i686, cannot install both krb5-pkinit-0:1.17-x86_64.x86_64 and krb5-pkinit-0:1.17-x86_64.x86_64, cannot install both NetworkManager-libnm-1:1.20.0-x86_64.x86_64 and NetworkManager-libnm-1:1.20.0-x86_64.x86_64, cannot install both systemd-libs-0:239-x86_64.x86_64 and systemd-libs-0:239-x86_64.x86_64, cannot install both glibc-langpack-ro-0:2.28-x86_64.x86_64 and glibc-langpack-ro-0:2.28-x86_64.x86_64, cannot install both glibc-langpack-so-0:2.28-x86_64.x86_64 and glibc-langpack-so-0:2.28-x86_64.x86_64, cannot install both glibc-langpack-sk-0:2.28-x86_64.x86_64 and glibc-langpack-sk-0:2.28-x86_64.x86_64, cannot install both libsss_idmap-0:2.0.0-x86_64.x86_64 and libsss_idmap-0:2.0.0-x86_64.x86_64, cannot install both python3-test-0:3.6.8-x86_64.x86_64 and python3-test-0:3.6.8-x86_64.x86_64, cannot install both glibc-langpack-br-0:2.28-x86_64.x86_64 and glibc-langpack-br-0:2.28-x86_64.x86_64, cannot install both xfsprogs-0:5.0.0-i686.i686 and xfsprogs-0:5.0.0-i686.i686, cannot install both glibc-langpack-li-0:2.28-x86_64.x86_64 and glibc-langpack-li-0:2.28-x86_64.x86_64, cannot install both libcomps-devel-0:0.1.11-x86_64.x86_64 and libcomps-devel-0:0.1.11-x86_64.x86_64, cannot install both iwl5000-firmware-0:184.108.40.206_1-noarch.noarch and iwl5000-firmware-0:220.127.116.11_1-noarch.noarch, cannot install both glibc-langpack-ar-0:2.28-x86_64.x86_64 and glibc-langpack-ar-0:2.28-x86_64.x86_64, cannot install both glibc-langpack-gv-0:2.28-x86_64.x86_64 and glibc-langpack-gv-0:2.28-x86_64.x86_64, cannot install both libxml2-0:2.9.7-x86_64.x86_64 and libxml2-0:2.9.7-x86_64.x86_64, cannot install both samba-client-libs-0:4.10.4-x86_64.x86_64 and samba-client-libs-0:4.10.4-x86_64.x86_64, cannot install both xfsprogs-devel-0:5.0.0-x86_64.x86_64 and xfsprogs-devel-0:5.0.0-x86_64.x86_64, cannot install both libfdisk-devel-0:2.32.1-x86_64.x86_64 and libfdisk-devel-0:2.32.1-x86_64.x86_64, cannot install both glibc-langpack-it-0:2.28-x86_64.x86_64 and glibc-langpack-it-0:2.28-x86_64.x86_64, cannot install both sssd-client-0:2.2.0-x86_64.x86_64 and sssd-client-0:2.2.0-x86_64.x86_64, cannot install both glibc-langpack-en-0:2.28-x86_64.x86_64 and glibc-langpack-en-0:2.28-x86_64.x86_64, cannot install both gnutls-0:3.6.8-i686.i686 and gnutls-0:3.6.8-i686.i686, cannot install both libcurl-minimal-0:7.61.1-x86_64.x86_64 and libcurl-minimal-0:7.61.1-x86_64.x86_64, cannot install both uuidd-0:2.32.1-x86_64.x86_64 and uuidd-0:2.32.1-x86_64.x86_64, cannot install both dnf-data-0:4.2.17-noarch.noarch and dnf-data-0:4.2.17-noarch.noarch, cannot install both cups-libs-1:2.2.6-x86_64.x86_64 and cups-libs-1:2.2.6-x86_64.x86_64, cannot install both sssd-kcm-0:2.2.0-x86_64.x86_64 and sssd-kcm-0:2.2.0-x86_64.x86_64, cannot install both platform-python-0:3.6.8-x86_64.x86_64 and platform-python-0:3.6.8-x86_64.x86_64, cannot install both libipa_hbac-0:2.0.0-i686.i686 and libipa_hbac-0:2.0.0-i686.i686, cannot install both glibc-devel-0:2.28-x86_64.x86_64 and glibc-devel-0:2.28-x86_64.x86_64, cannot install both libtirpc-0:1.1.4-i686.i686 and libtirpc-0:1.1.4-i686.i686, cannot install both dhcp-relay-12:4.3.6-x86_64.x86_64 and dhcp-relay-12:4.3.6-x86_64.x86_64, cannot install both python3-perf-0:4.18.0-x86_64.x86_64 and python3-perf-0:4.18.0-x86_64.x86_64, cannot install both lua-libs-0:5.3.4-i686.i686 and lua-libs-0:5.3.4-i686.i686, cannot install both glibc-langpack-sgs-0:2.28-x86_64.x86_64 and glibc-langpack-sgs-0:2.28-x86_64.x86_64, cannot install both iwl3160-firmware-1:18.104.22.168-noarch.noarch and iwl3160-firmware-1:22.214.171.124-noarch.noarch, cannot install both realmd-0:0.16.3-x86_64.x86_64 and realmd-0:0.16.3-x86_64.x86_64, cannot install both cyrus-sasl-plain-0:2.1.27-x86_64.x86_64....
- No problem in libsolv while publishing the CV.
- Either nothing to update (depend on the rhel8 version) or update packages without problem.
Additional info: While checking the above log, you should notice that the "nevr" of the rpm is not correct, such as "iwl3160-firmware-1:126.96.36.199-noarch.noarch". This is causing many same rpm versions are parsing to libsolv. Libsolv complains that it can't install the same version of rpms like below:
"cannot install both iwl3160-firmware-1:188.8.131.52-noarch.noarch and iwl3160-firmware-1:184.108.40.206-noarch.noarch" "cannot install both libtirpc-0:1.1.4-i686.i686 and libtirpc-0:1.1.4-i686.i686"
Below is the offending line in the code. It sets the "r" to "arch", but it should be set to "release".
Amending this line seems to solve the issue. Libsolv doesn't complain any problem. The libsolve transaction (transaction.newsolvables() method) pulls the correct number of rpms (which is equal or more than to the associating rpms)
Fix pulp depsolv issue when copy rpms with recursive config 2/2
This completes the commit d62c61f where pulp solves wrong dependencies because wrong evr is parsed to the solvable unit.
Signed-off-by: Pavel Moravec firstname.lastname@example.org (cherry picked from commit 3b82d8dfe2dc81f2716e86ec5ea91adbecc539cd)