Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dnf5 bash completion does not include nevra information like dnf4 #1956

Open
grumpey opened this issue Dec 15, 2024 · 1 comment · May be fixed by #1983
Open

dnf5 bash completion does not include nevra information like dnf4 #1956

grumpey opened this issue Dec 15, 2024 · 1 comment · May be fixed by #1983
Assignees

Comments

@grumpey
Copy link

grumpey commented Dec 15, 2024

With dnf4:

sudo dnf4 install kernel-devel-
kernel-devel-6.11.10-300.fc41.x86_64          kernel-devel-matched-6.11.10-300.fc41.x86_64  
kernel-devel-6.11.4-301.fc41.x86_64           kernel-devel-matched-6.11.4-301.fc41.x86_64   
sudo dnf4 install hexchat-
hexchat-2.16.2-5.fc41.i686           hexchat-autoaway-2.0-15.fc41.x86_64  hexchat-devel-2.16.2-5.fc41.x86_64   
hexchat-2.16.2-5.fc41.x86_64         hexchat-devel-2.16.2-5.fc41.i686
 sudo dnf4 install kernel-core-6.11.
kernel-core-6.11.10-300.fc41.x86_64  kernel-core-6.11.4-301.fc41.x86_64

With dnf5:
sudo dnf install kernel-devel-matched
sudo dnf install kernel-core

sudo dnf install hexchat-
hexchat-autoaway  hexchat-devel

With dnf5 if you add the version information it is removed when you try to tab to complete.

@ppisar ppisar changed the title dnf5 bash completion does not include nerva information like dnf4 dnf5 bash completion does not include nevra information like dnf4 Jan 2, 2025
@jrohel
Copy link
Contributor

jrohel commented Jan 2, 2025

Current status of bash completion in dnf5

If we are working with installed packages - we want to remove (remove), reinstall (reinstall), swap (swap) there are two cases:

  1. usually only one package of a given name is installed and bash completion completes only the name
  2. for multiple installed packages of the same name (installonly packages - usually kernel) the nevras are displayed so that the user can choose which one he wants to work with.

Examples (some packages are installed in multiple versions):

# dnf5 remove kernel-
kernel-core-0:6.11.10-300.fc41.x86_64           kernel-modules-core-0:6.11.11-300.fc41.x86_64
kernel-core-0:6.11.11-300.fc41.x86_64           kernel-modules-core-0:6.12.6-200.fc41.x86_64
kernel-core-0:6.12.6-200.fc41.x86_64            kernel-modules-extra-0:6.11.10-300.fc41.x86_64
kernel-headers                                  kernel-modules-extra-0:6.11.11-300.fc41.x86_64
kernel-modules-0:6.11.10-300.fc41.x86_64        kernel-modules-extra-0:6.12.6-200.fc41.x86_64
kernel-modules-0:6.11.11-300.fc41.x86_64        kernel-srpm-macros
kernel-modules-0:6.12.6-200.fc41.x86_64         kernel-tools
kernel-modules-core-0:6.11.10-300.fc41.x86_64   kernel-tools-libs
# dnf5 swap kernel-
kernel-core-0:6.11.10-300.fc41.x86_64           kernel-modules-core-0:6.11.11-300.fc41.x86_64
kernel-core-0:6.11.11-300.fc41.x86_64           kernel-modules-core-0:6.12.6-200.fc41.x86_64
kernel-core-0:6.12.6-200.fc41.x86_64            kernel-modules-extra-0:6.11.10-300.fc41.x86_64
kernel-headers                                  kernel-modules-extra-0:6.11.11-300.fc41.x86_64
kernel-modules-0:6.11.10-300.fc41.x86_64        kernel-modules-extra-0:6.12.6-200.fc41.x86_64
kernel-modules-0:6.11.11-300.fc41.x86_64        kernel-srpm-macros
kernel-modules-0:6.12.6-200.fc41.x86_64         kernel-tools
kernel-modules-core-0:6.11.10-300.fc41.x86_64   kernel-tools-libs
# dnf5 reinstall kernel-
kernel-core-0:6.11.10-300.fc41.x86_64           kernel-modules-core-0:6.11.11-300.fc41.x86_64
kernel-core-0:6.11.11-300.fc41.x86_64           kernel-modules-core-0:6.12.6-200.fc41.x86_64
kernel-core-0:6.12.6-200.fc41.x86_64            kernel-modules-extra-0:6.11.10-300.fc41.x86_64
kernel-headers                                  kernel-modules-extra-0:6.11.11-300.fc41.x86_64
kernel-modules-0:6.11.10-300.fc41.x86_64        kernel-modules-extra-0:6.12.6-200.fc41.x86_64
kernel-modules-0:6.11.11-300.fc41.x86_64        kernel-srpm-macros
kernel-modules-0:6.12.6-200.fc41.x86_64         kernel-tools
kernel-modules-core-0:6.11.10-300.fc41.x86_64   kernel-tools-libs

When working with available packages, only the package name is always displayed. Solver automatically installs the highest possible version (or with --best we request the highest available version). Usually the user does not want to specify the version.

There are cases when the user wants to specify a specific version to install from several available packages (installing a new one, upgrade, downgrade, ...). In this case bash completion does not really help.

Proposed solutions:

  1. in the case of multiple versions of available packages, print the nevra, otherwise just the name as before
  2. for available packages, always add the nevra, for installed the nevra only when multiple versions of a package is installed
  3. always list the nevras for installed and available packages as in dnf4
  4. any other idea?

@jrohel jrohel self-assigned this Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants