mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-25 12:23:09 +00:00
__fish_print_packages: use libzypp builtin cache for zypper
This commit is contained in:
parent
aacdaee6a9
commit
7e014174b8
1 changed files with 6 additions and 0 deletions
|
@ -54,6 +54,12 @@ function __fish_print_packages
|
|||
|
||||
# Zypper needs caching as it is slow
|
||||
if type -q -f zypper
|
||||
# Use libzypp cache file if available
|
||||
if test -f /var/cache/zypp/solv/@System/solv.idx
|
||||
cat /var/cache/zypp/solv/*/solv.idx | awk '!/application:|srcpackage:|product:|pattern:|patch:/ {print $1'\t$package'}'
|
||||
return
|
||||
end
|
||||
|
||||
# If the cache is less than five minutes old, we do not recalculate it
|
||||
|
||||
set -l cache_file $XDG_CACHE_HOME/.zypper-cache.$USER
|
||||
|
|
Loading…
Reference in a new issue