From 0200fc0fbc574b69c30168635e5958c27f7fec79 Mon Sep 17 00:00:00 2001 From: Vadim Zyamalov Date: Tue, 8 Dec 2020 22:59:56 +0300 Subject: [PATCH] Creating cache for xbps-query in __fish_print_packages.fish (#7534) * Completions for xbps were not showed on cache file creation * Completions for xbps were not showed on cache file creation, small typo --- share/functions/__fish_print_packages.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/functions/__fish_print_packages.fish b/share/functions/__fish_print_packages.fish index 0572b553a..3d6444ed3 100644 --- a/share/functions/__fish_print_packages.fish +++ b/share/functions/__fish_print_packages.fish @@ -253,15 +253,15 @@ function __fish_print_packages if not set -q only_installed set -l cache_file $xdg_cache_home/.xbps-cache.$USER if test -f $cache_file - cat $cache_file set -l age (math (date +%s) - (stat -c '%Y' $cache_file)) set -l max_age 300 if test $age -lt $max_age + cat $cache_file return end end # prints: Package - xbps-query -Rsl | sed 's/^... \([^ ]*\)-.* .*/\1/; s/$/\t'Package'/' >$cache_file & + xbps-query -Rsl | sed 's/^... \([^ ]*\)-.* .*/\1/; s/$/\t'Package'/' | tee $cache_file return else xbps-query -l | sed 's/^.. \([^ ]*\)-.* .*/\1/' # TODO: actually put package versions in tab for locally installed packages