dnf icon indicating copy to clipboard operation
dnf copied to clipboard

spec: If DNF5 obsoletes DNF, do not build dnf and yum packages

Open ppisar opened this issue 1 year ago • 1 comments

Fedora CI installability and rpmdeplint tests failed on Fedoras where dnf5 obsoletes dnf and yum packages because the tests attempt to install just built dnf and yum packages, but DNF5 refuses installing them because they are obsoleted by an already installed dnf5:

 --------------------------------------------------------
|                                                        |
|   Running install test for dnf-0:4.21.0-3.fc41.noarch  |
|                                                        |
--------------------------------------------------------
Updating and loading repositories:
 Repo for 121841198 Brew build          100% |   4.7 MiB/s |   4.8 KiB |  00m00s
Repositories loaded.
Failed to resolve the transaction:
Problem: problem with installed package
  - installed package dnf5-5.2.5.0-2.fc41.x86_64 obsoletes dnf < 5 provided by dnf-4.21.0-3.fc41.noarch from brew-121841198
  - package dnf5-5.2.5.0-2.fc41.x86_64 from fedora obsoletes dnf < 5 provided by dnf-4.21.0-3.fc41.noarch from brew-121841198
  - package dnf5-5.2.5.0-2.fc41.x86_64 from updates obsoletes dnf < 5 provided by dnf-4.21.0-3.fc41.noarch from brew-121841198
  - package dnf5-5.2.5.0-2.fc41.x86_64 from rawhide obsoletes dnf < 5 provided by dnf-4.21.0-3.fc41.noarch from brew-121841198
  - package dnf5-5.2.5.0-2.fc41.x86_64 from fedora-41-buildroot obsoletes dnf < 5 provided by dnf-4.21.0-3.fc41.noarch from brew-121841198
  - package dnf5-5.2.5.0-2.fc41.x86_64 from testing-farm-tag-repository obsoletes dnf < 5 provided by dnf-4.21.0-3.fc41.noarch from brew-121841198
  - conflicting requests

(The same happesn for yum package.)

Solution this patch implements is not building the two obsolete packages. At the end, they cannot be installed.

ppisar avatar Aug 19 '24 15:08 ppisar

Here [https://src.fedoraproject.org/rpms/dnf/pull-request/24] is scratch build in Fedora, showing the Fedora CI results. As you can see, installability test passes. For unknown reason, other Fedora tests where not performed.

I tested this pull request in Fedora 42 where DNF5 obsoletes and in Fedora 40 where it does not. The two packages were correctly skipped in Fedora 42, while in Fedora 40 were correctly produced. No other changes was visible to the packages.

ppisar avatar Aug 19 '24 15:08 ppisar