rpm-software-management / dnf5

Next-generation RPM package management system
Other
255 stars 86 forks source link

dnf5 whatprovides alias does not work #1823

Open LukeShortCloud opened 1 week ago

LukeShortCloud commented 1 week ago

With DNF 4, it was possible to use both dnf provides and dnf whatprovides. These should be aliases of each other. However, it does not appear to work with DNF 5. This potentially breaks some backwards compatibility with scripts.

$ dnf5 whatprovides ssh
Unknown argument "whatprovides" for command "dnf5". Add "--help" for more information about the arguments.
It could be a command provided by a plugin, try: dnf5 install 'dnf5-command(whatprovides)'
$ dnf5 provides ssh
Updating and loading repositories:
Repositories loaded.
openssh-clients-9.8p1-3.fc41.2.x86_64 : An open source SSH client applications
Repo         : @System
Matched From :
Filename     : /usr/bin/ssh

openssh-clients-9.8p1-3.fc41.2.x86_64 : An open source SSH client applications
Repo         : updates-archive
Matched From :
Filename     : /usr/bin/ssh

openssh-clients-9.8p1-3.fc41.2.x86_64 : An open source SSH client applications
Repo         : fedora-41-updates
Matched From :
Filename     : /usr/bin/ssh

openssh-clients-9.8p1-3.fc41.1.x86_64 : An open source SSH client applications
Repo         : fedora-41
Matched From :
Filename     : /usr/bin/ssh

Version information:

$ dnf5 --version
dnf5 version 5.2.6.2
dnf5 plugin API version 2.0
libdnf5 version 5.2.6.2
libdnf5 plugin API version 2.0
$ cat /etc/os-release
NAME="Fedora Linux"
VERSION="41.20241030.0 (Silverblue)"
RELEASE_TYPE=stable
ID=fedora
VERSION_ID=41
VERSION_CODENAME=""
PLATFORM_ID="platform:f41"
PRETTY_NAME="Fedora Linux 41.20241030.0 (Silverblue)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:41"
DEFAULT_HOSTNAME="fedora"
HOME_URL="https://silverblue.fedoraproject.org"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora-silverblue/"
SUPPORT_URL="https://ask.fedoraproject.org/"
BUG_REPORT_URL="https://github.com/fedora-silverblue/issue-tracker/issues"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=41
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=41
SUPPORT_END=2025-05-13
VARIANT="Silverblue"
VARIANT_ID=silverblue
OSTREE_VERSION='41.20241030.0'
dreua commented 1 week ago

Not just scripts, also people such as myself who were used to dnf whatprovides. This may be obvious to the dnf gurus but for many people it costs time to figure this stuff out and find the "new" command you now need to remember.

Also there is a relevant semantic difference between the dnf [what]provides and dnf repoquery [what]provide commands: I for one often used dnf[3] whatprovides <some command> to find the package providing an executable with just the command (executable name) instead of the whole path. This worked fine and continues to work now I realized I just need to omit the what but some search results lead me to the repoquery subcommands and those don't work and did not work (dnf 4) with the bare executable name.

[da@David-UB ~]$ dnf provides dnf-3
Updating and loading repositories:
Repositories loaded.
python3-dnf-4.21.1-2.fc41.noarch : Python 3 interface to DNF
Repo         : @System
Matched From : 
Filename     : /usr/bin/dnf-3

python3-dnf-4.21.1-1.fc41.noarch : Python 3 interface to DNF
Repo         : fedora
Matched From : 
Filename     : /usr/bin/dnf-3

python3-dnf-4.21.1-2.fc41.noarch : Python 3 interface to DNF
Repo         : updates
Matched From : 
Filename     : /usr/bin/dnf-3

[da@David-UB ~]$ dnf repoquery whatprovides dnf-3
Updating and loading repositories:
Repositories loaded.
[da@David-UB ~]$ dnf repoquery provides dnf-3
Updating and loading repositories:
Repositories loaded.
[no further output]

Versions

[da@David-UB ~]$ dnf --version
dnf5 version 5.2.6.2
dnf5 plugin API version 2.0
libdnf5 version 5.2.6.2
libdnf5 plugin API version 2.0

Loaded dnf5 plugins:
  name: builddep
  version: 1.0.0
  API version: 2.0

  name: changelog
  version: 1.0.0
  API version: 2.0

  name: config-manager
  version: 0.1.0
  API version: 2.0

  name: copr
  version: 0.1.0
  API version: 2.0

  name: needs_restarting
  version: 1.0.0
  API version: 2.0

  name: repoclosure
  version: 1.0.0
  API version: 2.0

Final remarks

I don't mean to complain here, I'm happy to do some late testing as Fedora 41 user, but it would be great to have the UX improved for the users yet to migrate to DNF5. Anyway, thanks a lot for dnf 5 it is indeed blazing fast :rocket: