aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Sam Yu <ytz1995@gmail.com>2016-03-30 15:39:55 +0800
committerGravatar Fabian Homborg <FHomborg@gmail.com>2016-03-30 15:03:51 +0200
commit7e014174b876308f7a6105d6571f51ab7c2022f0 (patch)
tree09f80f4e442edf726ebb146e30e855564b24bfac
parentaacdaee6a9b0587d87bc176553bf1489453a8530 (diff)
__fish_print_packages: use libzypp builtin cache for zypper
-rw-r--r--share/functions/__fish_print_packages.fish6
1 files changed, 6 insertions, 0 deletions
diff --git a/share/functions/__fish_print_packages.fish b/share/functions/__fish_print_packages.fish
index be7d17e1..a6b84b47 100644
--- a/share/functions/__fish_print_packages.fish
+++ b/share/functions/__fish_print_packages.fish
@@ -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