File: _cache_invalid

package info (click to toggle)
zsh-beta 4.3.2-dev-1%2B20061127-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 13,260 kB
  • ctags: 6,846
  • sloc: ansic: 83,534; sh: 5,094; makefile: 781; perl: 746; awk: 364; sed: 16
file content (21 lines) | stat: -rw-r--r-- 707 bytes parent folder | download | duplicates (19)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#autoload
#
# Function to decide whether a completions cache needs rebuilding

local _cache_ident _cache_dir _cache_path _cache_policy
_cache_ident="$1"

# If the cache is disabled, we never want to rebuild it, so pretend
# it's valid.
zstyle -t ":completion:${curcontext}:" use-cache || return 1

zstyle -s ":completion:${curcontext}:" cache-path _cache_dir
: ${_cache_dir:=${ZDOTDIR:-$HOME}/.zcompcache}
_cache_path="$_cache_dir/$_cache_ident"

# See whether the caching policy says that the cache needs rebuilding
# (the policy will return 0 if it does).
zstyle -s ":completion:${curcontext}:" cache-policy _cache_policy
[[ -n "$_cache_policy" ]] && "$_cache_policy" "$_cache_path" && return 0

return 1