mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
[dnf] Fall back to dnf repolist
when no sqlite3
[ci skip]
This commit is contained in:
parent
4a5f0f3a3d
commit
50e2a8dd72
1 changed files with 5 additions and 1 deletions
|
@ -7,12 +7,16 @@ function __dnf_list_installed_packages
|
|||
end
|
||||
|
||||
function __dnf_list_available_packages
|
||||
# dnf --cacheonly list --available gives a list of non-installed packages dnf is aware of,
|
||||
# but it is slow as molasses. Unfortunately, sqlite3 is not available oob (Fedora Server 32).
|
||||
if type -q sqlite3
|
||||
# This schema is bad, there is only a "pkg" field with the full
|
||||
# packagename-version-release.fedorarelease.architecture
|
||||
# tuple. We are only interested in the packagename.
|
||||
sqlite3 /var/cache/dnf/packages.db "SELECT pkg FROM available WHERE pkg LIKE \"$cur%\"" 2>/dev/null |
|
||||
string replace -r -- '-[^-]*-[^-]*$' ''
|
||||
string replace -r -- '-[^-]*-[^-]*$' ''
|
||||
else
|
||||
dnf repoquery --cacheonly "$cur*" --qf "%{NAME}" --available 2>/dev/null
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue