-
Notifications
You must be signed in to change notification settings - Fork 93
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
Bash completion: Always offer NEVRAs and NAMEs for packages #1983
Bash completion: Always offer NEVRAs and NAMEs for packages #1983
Conversation
Nice, this works.
I think I'd prefer also completing the name even if there is only one NEVRA available, i.e.
mostly for the sake of consistency. It keeps the shell history a bit cleaner if the command is completed just as |
c1b1fae
to
2fcc09b
Compare
2fcc09b
to
ebefcc4
Compare
Originally, for packages, the NAME was offered in bash completion. In the case of multiple packages with the same NAME, there was an option to offer NEVRA instead of the NAME for those packages. Now, bash completion always offers NEVRA for packages. There is an option to offer package NAMEs in addition to NEVRAs. This is useful, for example, when the user wants to install a package. Usually the user only wants to enter the package NAME and not the entire NEVRA. If multiple packages with the same NAME are available, the specific package is then selected by the solver.
For installed packages (for dnf5 commands reinstall, remove, repoquery, swap) bash completion offered only NEVRAs. Now bash completion for dnf5 offers NAMEs in addition to NEVRAs in all cases.
ebefcc4
to
c17fa88
Compare
OK. Sounds like a good idea. I've simplified the logic. Now NAMEs are always offered in addition to NEVRAs. |
} | ||
} | ||
|
||
result_set.insert(package.get_full_nevra()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to skip the source rpm packages NEVRAS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to skip the source rpm packages NEVRAS?
Now, all matching packages from all allowed repositories are offered. Including source packages.
Fedora source packages are in their own repository, which is disabled by default. If the source package repository is enabled, source packages are offered.
Examples:
# dnf5 download iftop<TAB><TAB>
iftop iftop-0:1.0-0.34.pre4.fc41.x86_64
# dnf5 --enable-repo=fedora-source download iftop<TAB><TAB>
iftop iftop-0:1.0-0.34.pre4.fc41.src iftop-0:1.0-0.34.pre4.fc41.x86_64
What is meant by the question? Do you want the source packages to not be offered? It is true that NEVRAs for source packages only make sense for certain commands - for example, download
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I discovered it i copr repository, which contains both binary and source rpm. I was just thinking whether *.src packages are usable for the user. But it's really niche issue, as you said - most of the repositories do not contain source packages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine that .src.rpms are suggested too, the user probably knows what they're doing if they select a specific NEVRA to install/remove/download.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Looks good now.
04016f4
Closes: #1956
Originally, for packages, the NAME was offered in bash completion. In the case of multiple packages with the same NAME, there was an option to offer NEVRA instead of a NAME for those packages.
Now, bash completion always offers NEVRA for packages. There is an option to offer package NAME in addition to NEVRAs. This is useful, for example, when the user wants to install a package. Usually the user only wants to enter the package NAME and not the entire NEVRA. If multiple packages with the same NAME are available, the specific
package is then selected by the solver.
The DNF5 aplication now always offers both NEVRAs and NAMEs.