mirror of
https://github.com/fish-shell/fish-shell
synced 2024-09-21 23:11:54 +00:00
add package parsing for OpenBSD
This commit is contained in:
parent
440df37b41
commit
bfd2885279
1 changed files with 10 additions and 4 deletions
|
@ -27,14 +27,20 @@ function __fish_print_packages
|
|||
|
||||
# Pkg is fast on FreeBSD and provides versioning info which we want for
|
||||
# installed packages
|
||||
if begin
|
||||
type -q -f pkg
|
||||
and test (uname) = "FreeBSD"
|
||||
end
|
||||
if type -q -f pkg
|
||||
pkg query "%n-%v"
|
||||
return
|
||||
end
|
||||
|
||||
# pkg_info on OpenBSD provides versioning info which we want for
|
||||
# installed packages but, calling it directly can cause delays in
|
||||
# returning information if another pkg_* tool have a lock.
|
||||
# Listing /var/db/pkg is a clean alternative.
|
||||
if type -q -f pkg_add
|
||||
set -l files /var/db/pkg/*; string replace '/var/db/pkg/' '' -- $files
|
||||
return
|
||||
end
|
||||
|
||||
# Caches for 5 minutes
|
||||
if type -q -f pacman
|
||||
set cache_file $XDG_CACHE_HOME/.pac-cache.$USER
|
||||
|
|
Loading…
Reference in a new issue