fpf-cli 1.6.44 → 1.6.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/fpf +24 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -105,8 +105,8 @@ Installed packages are marked with `*` in the result list.
|
|
|
105
105
|
- `FPF_DYNAMIC_RELOAD_BYPASS_QUERY_CACHE=1`: bypass query cache during live reloads (default `1` for freshest results); set `0` to prefer cached reloads
|
|
106
106
|
- `FPF_SEARCH_CATALOG_ASYNC_PREWARM`: async warmup for `apt`/`brew` catalog caches during interactive reload/search paths (default `1`, set `0` for synchronous legacy behavior)
|
|
107
107
|
- `FPF_ENABLE_QUERY_CACHE`: `auto` (default), `1`, or `0` (`auto` enables query cache for `apt`, `brew`, `pacman`, and `bun`)
|
|
108
|
-
- `FPF_QUERY_CACHE_TTL`:
|
|
108
|
+
- `FPF_QUERY_CACHE_TTL`: global query-cache TTL override seconds for heavy managers (defaults: `apt=180`, `brew=120`, `pacman=180`; set `0` to always refresh)
|
|
109
109
|
- `FPF_APT_QUERY_CACHE_TTL`, `FPF_BREW_QUERY_CACHE_TTL`, `FPF_PACMAN_QUERY_CACHE_TTL`: per-manager query-cache TTL overrides
|
|
110
|
-
- `FPF_BUN_QUERY_CACHE_TTL`: Bun query-cache TTL (default `
|
|
110
|
+
- `FPF_BUN_QUERY_CACHE_TTL`: Bun query-cache TTL (default `300`)
|
|
111
111
|
- `FPF_DISABLE_INSTALLED_CACHE=1` disables installed-package marker cache
|
|
112
112
|
- `FPF_INSTALLED_CACHE_TTL`: installed-package marker cache freshness window in seconds (default `300`, set `0` to always refresh)
|
package/fpf
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
set -euo pipefail
|
|
4
4
|
|
|
5
5
|
SCRIPT_NAME="fpf"
|
|
6
|
-
SCRIPT_VERSION="1.6.
|
|
6
|
+
SCRIPT_VERSION="1.6.45"
|
|
7
7
|
TMP_ROOT="${TMPDIR:-/tmp}/fpf"
|
|
8
8
|
SESSION_TMP_ROOT=""
|
|
9
9
|
HELP_FILE=""
|
|
@@ -40,18 +40,36 @@ query_cache_default_enabled_for_manager() {
|
|
|
40
40
|
|
|
41
41
|
query_cache_ttl_seconds_for_manager() {
|
|
42
42
|
local manager="$1"
|
|
43
|
-
local default_ttl="
|
|
43
|
+
local default_ttl="0"
|
|
44
|
+
local global_ttl="${FPF_QUERY_CACHE_TTL:-}"
|
|
44
45
|
local manager_ttl="0"
|
|
45
46
|
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
case "${manager}" in
|
|
48
|
+
apt)
|
|
49
|
+
default_ttl="180"
|
|
50
|
+
;;
|
|
51
|
+
brew)
|
|
52
|
+
default_ttl="120"
|
|
53
|
+
;;
|
|
54
|
+
pacman)
|
|
55
|
+
default_ttl="180"
|
|
56
|
+
;;
|
|
57
|
+
bun)
|
|
58
|
+
default_ttl="300"
|
|
59
|
+
;;
|
|
60
|
+
esac
|
|
61
|
+
|
|
62
|
+
if [[ -n "${global_ttl}" ]]; then
|
|
63
|
+
if [[ "${global_ttl}" =~ ^[0-9]+$ ]]; then
|
|
64
|
+
default_ttl="${global_ttl}"
|
|
65
|
+
fi
|
|
48
66
|
fi
|
|
49
67
|
|
|
50
68
|
case "${manager}" in
|
|
51
69
|
bun)
|
|
52
|
-
manager_ttl="${FPF_BUN_QUERY_CACHE_TTL
|
|
70
|
+
manager_ttl="${FPF_BUN_QUERY_CACHE_TTL:-${default_ttl}}"
|
|
53
71
|
if ! [[ "${manager_ttl}" =~ ^[0-9]+$ ]]; then
|
|
54
|
-
manager_ttl=
|
|
72
|
+
manager_ttl="${default_ttl}"
|
|
55
73
|
fi
|
|
56
74
|
;;
|
|
57
75
|
apt)
|