diff options
Diffstat (limited to 'Completion')
-rw-r--r-- | Completion/Darwin/Command/_fink | 1 | ||||
-rw-r--r-- | Completion/Darwin/Type/_retrieve_mac_apps | 7 | ||||
-rw-r--r-- | Completion/Debian/Command/_apt | 14 | ||||
-rw-r--r-- | Completion/Debian/Type/_deb_packages | 17 | ||||
-rw-r--r-- | Completion/Redhat/Command/_rpm | 1 | ||||
-rw-r--r-- | Completion/Redhat/Command/_yum | 23 | ||||
-rw-r--r-- | Completion/Unix/Command/_bogofilter | 1 | ||||
-rw-r--r-- | Completion/Unix/Type/_path_commands | 4 | ||||
-rw-r--r-- | Completion/Unix/Type/_perl_modules | 1 |
9 files changed, 38 insertions, 31 deletions
diff --git a/Completion/Darwin/Command/_fink b/Completion/Darwin/Command/_fink index f0ff6834e..27ca3740c 100644 --- a/Completion/Darwin/Command/_fink +++ b/Completion/Darwin/Command/_fink @@ -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" ]] || diff --git a/Completion/Darwin/Type/_retrieve_mac_apps b/Completion/Darwin/Type/_retrieve_mac_apps index f435fde26..e9a30e006 100644 --- a/Completion/Darwin/Type/_retrieve_mac_apps +++ b/Completion/Darwin/Type/_retrieve_mac_apps @@ -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 )) } diff --git a/Completion/Debian/Command/_apt b/Completion/Debian/Command/_apt index c22e42ecb..bdcfcd26a 100644 --- a/Completion/Debian/Command/_apt +++ b/Completion/Debian/Command/_apt @@ -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 "$@" diff --git a/Completion/Debian/Type/_deb_packages b/Completion/Debian/Type/_deb_packages index 8ddf0e959..dea50cfdc 100644 --- a/Completion/Debian/Type/_deb_packages +++ b/Completion/Debian/Type/_deb_packages @@ -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 - - [[ /var/cache/apt/pkgcache.bin -nt "$1" || - /var/lib/dpkg/available -nt "$1" ]] - } +_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" ]] +} _deb_packages "$@" diff --git a/Completion/Redhat/Command/_rpm b/Completion/Redhat/Command/_rpm index 140f5313f..184d7b00d 100644 --- a/Completion/Redhat/Command/_rpm +++ b/Completion/Redhat/Command/_rpm @@ -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 diff --git a/Completion/Redhat/Command/_yum b/Completion/Redhat/Command/_yum index 8988b43d7..455812b1b 100644 --- a/Completion/Redhat/Command/_yum +++ b/Completion/Redhat/Command/_yum @@ -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 "$@" diff --git a/Completion/Unix/Command/_bogofilter b/Completion/Unix/Command/_bogofilter index 9e6ac3f88..980d3155e 100644 --- a/Completion/Unix/Command/_bogofilter +++ b/Completion/Unix/Command/_bogofilter @@ -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) ) diff --git a/Completion/Unix/Type/_path_commands b/Completion/Unix/Type/_path_commands index 340a013c3..393c0c67e 100644 --- a/Completion/Unix/Type/_path_commands +++ b/Completion/Unix/Type/_path_commands @@ -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) ) diff --git a/Completion/Unix/Type/_perl_modules b/Completion/Unix/Type/_perl_modules index 00629335b..26cab0c23 100644 --- a/Completion/Unix/Type/_perl_modules +++ b/Completion/Unix/Type/_perl_modules @@ -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) ) |