Hi! We'd like to propose a new functionality for dnf: When a user tries to install a package XYZ and dnf doesn't find it, dnf would recommend them alternative packages. These offered packages would advertise that they are an alternative for XYZ using a specially formatted Provides tag.
For example, packages `python2-requests` and `python3-requests` would both have the following tag:
Provides: alternative-for(python-requests) = %{version}-%{release}
(Possibly via the already existing and widespread %python_provide macro in the Python case.)
And when the user would try to install `python-requests`, dnf would look for packages with the relevant Provides tag and display them:
# dnf install python-requests * There are following alternatives to this package: python2-requests python3-requests No match for argument: python-requests Error: Unable to find a match
This would be very similar to an already existing functionality that searches for lowercase package names:
# dnf install python3-REQUESTS * Maybe you meant: python3-requests No match for argument: python3-REQUESTS Error: Unable to find a match
(That functionality is broken in some versions—RHBZ#1628514—so you might not see this result at the moment.)
What are your thoughts?
One possible addition would be to include a parameter for weight in the Provides tag, so that python3-requests could be listed as the preferred option before python2-requests.
All the best, Tomas Orsava
On Thu, Sep 13, 2018 at 06:17:39PM +0200, Tomas Orsava wrote:
Hi! We'd like to propose a new functionality for dnf: When a user tries to install a package XYZ and dnf doesn't find it, dnf would recommend them alternative packages. These offered packages would advertise that they are an alternative for XYZ using a specially formatted Provides tag.
For example, packages `python2-requests` and `python3-requests` would both have the following tag:
Provides: alternative-for(python-requests) = %{version}-%{release}
You could probably achieve that behavior with normal provides we have today and a DNF plugin.
Just guessing. And people who care for such a feature could just get the plugin, you know...
P
packaging@lists.fedoraproject.org