mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-02 22:11:54 +02:00
25988: declare temporary cache array as local, thanks to problem noticed by Kazuhiro NISHIYAMA.
This commit is contained in:
parent
1b78e1a912
commit
6dbf2f2f4a
11 changed files with 51 additions and 30 deletions
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,16 @@
|
|||
2008-11-02 Clint Adams <clint@zsh.org>
|
||||
|
||||
* 25988: Completion/Darwin/Command/_fink,
|
||||
Completion/Darwin/Type/_retrieve_mac_apps,
|
||||
Completion/Debian/Command/_apt,
|
||||
Completion/Debian/Type/_deb_packages,
|
||||
Completion/Redhat/Command/_rpm, Completion/Redhat/Command/_yum,
|
||||
Completion/Unix/Command/_bogofilter,
|
||||
Completion/Unix/Type/_path_commands,
|
||||
Completion/Unix/Type/_perl_modules, Doc/Zsh/compsys.yo: declare
|
||||
temporary cache array as local, thanks to problem noticed by
|
||||
Kazuhiro NISHIYAMA.
|
||||
|
||||
2008-11-01 Clint Adams <clint@zsh.org>
|
||||
|
||||
* 25987: Src/Modules/tcp.c: don't ztrdup the buffer returned by
|
||||
|
|
|
@ -55,6 +55,7 @@ _fink_get_packages(){
|
|||
}
|
||||
|
||||
_finkpkgs_caching_policy(){
|
||||
local -a oldp
|
||||
oldp=( "$1"(Nmw+1) )
|
||||
(( $#oldp )) ||
|
||||
[[ /sw/var/cache/apt/pkgcache.bin -nt "$1" ]] ||
|
||||
|
|
|
@ -4,9 +4,10 @@
|
|||
# Used by _mac_applications and _mac_files_for_application.
|
||||
|
||||
_mac_apps_caching_policy () {
|
||||
# Rebuild if cache is more than a day old
|
||||
oldp=( "$1"(Nmw+1) )
|
||||
(( $#oldp ))
|
||||
# Rebuild if cache is more than a day old
|
||||
local -a oldp
|
||||
oldp=( "$1"(Nmw+1) )
|
||||
(( $#oldp ))
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -571,14 +571,14 @@ _apt_releases () {
|
|||
_tags apt-releases && compadd -a _apt_releases
|
||||
}
|
||||
|
||||
_apt_caching_policy () {
|
||||
# rebuild if cache is more than a week old
|
||||
oldp=( "$1"(mw+1) )
|
||||
(( $#oldp )) && return 0
|
||||
_apt_caching_policy () {
|
||||
local -a oldp
|
||||
|
||||
[[ /var/cache/apt/pkgcache.bin -nt "$1" ||
|
||||
/var/lib/dpkg/available -nt "$1" ]]
|
||||
}
|
||||
oldp=( "$1"(mw+1) )
|
||||
(( $#oldp )) && return 0
|
||||
|
||||
[[ /var/cache/apt/pkgcache.bin -nt "$1" ||
|
||||
/var/lib/dpkg/available -nt "$1" ]]
|
||||
}
|
||||
|
||||
_apt "$@"
|
||||
|
|
|
@ -108,13 +108,14 @@ _deb_packages () {
|
|||
_tags packages && compadd "$expl[@]" - "${(@P)cachevar}"
|
||||
}
|
||||
|
||||
_debs_caching_policy () {
|
||||
# rebuild if cache is more than a week old
|
||||
oldp=( "$1"(mw+1) )
|
||||
(( $#oldp )) && return 0
|
||||
_debs_caching_policy () {
|
||||
# rebuild if cache is more than a week old
|
||||
local -a oldp
|
||||
oldp=( "$1"(mw+1) )
|
||||
(( $#oldp )) && return 0
|
||||
|
||||
[[ /var/cache/apt/pkgcache.bin -nt "$1" ||
|
||||
/var/lib/dpkg/available -nt "$1" ]]
|
||||
}
|
||||
[[ /var/cache/apt/pkgcache.bin -nt "$1" ||
|
||||
/var/lib/dpkg/available -nt "$1" ]]
|
||||
}
|
||||
|
||||
_deb_packages "$@"
|
||||
|
|
|
@ -314,6 +314,7 @@ fi
|
|||
|
||||
_rpms_caching_policy () {
|
||||
# rebuild if cache is more than a week old
|
||||
local -a oldp
|
||||
oldp=( "$1"(mw+1) )
|
||||
(( $#oldp )) && return 0
|
||||
|
||||
|
|
|
@ -274,21 +274,22 @@ _yum_list_or_info()
|
|||
|
||||
_yum_caching_policy()
|
||||
{
|
||||
local _yumrepomds
|
||||
local _yumrepomds
|
||||
local -a oldp
|
||||
|
||||
# rebuild if cache is more than a week old
|
||||
oldp=( "$1"(mw+1) )
|
||||
(( $#oldp )) && return 0
|
||||
# rebuild if cache is more than a week old
|
||||
oldp=( "$1"(mw+1) )
|
||||
(( $#oldp )) && return 0
|
||||
|
||||
_yumrepomds=( /var/cache/yum/**/repomd.xml )
|
||||
_yumrepomds=( /var/cache/yum/**/repomd.xml )
|
||||
|
||||
if (( $#_yumrepomds )); then
|
||||
for repo in $_yumrepomds; do
|
||||
[[ "$repo" -nt "$1" ]] && return 0
|
||||
done
|
||||
fi
|
||||
if (( $#_yumrepomds )); then
|
||||
for repo in $_yumrepomds; do
|
||||
[[ "$repo" -nt "$1" ]] && return 0
|
||||
done
|
||||
fi
|
||||
|
||||
return 1
|
||||
return 1
|
||||
}
|
||||
|
||||
_yum "$@"
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
local expl ret bogotokens
|
||||
|
||||
_bogoutil_caching_policy () {
|
||||
local -a oldp
|
||||
|
||||
# rebuild if cache is more than a week old
|
||||
oldp=( "$1"(mw+1) )
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
(( $+functions[_path_commands_caching_policy] )) ||
|
||||
_path_commands_caching_policy() {
|
||||
|
||||
local oldp file
|
||||
typeset -a dbfiles
|
||||
local file
|
||||
local -a oldp dbfiles
|
||||
|
||||
# rebuild if cache is more than a week old
|
||||
oldp=( "$1"(Nmw+1) )
|
||||
|
|
|
@ -132,6 +132,7 @@ _perl_modules () {
|
|||
|
||||
_perl_modules_caching_policy () {
|
||||
local _perllocals
|
||||
local -a oldp
|
||||
|
||||
# rebuild if cache is more than a week old
|
||||
oldp=( "$1"(mw+1) )
|
||||
|
|
|
@ -3906,6 +3906,7 @@ Example:
|
|||
|
||||
example(_example_caching_policy () {
|
||||
# rebuild if cache is more than a week old
|
||||
local -a oldp
|
||||
oldp=( "$1"(Nmw+1) )
|
||||
(( $#oldp ))
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue