summaryrefslogtreecommitdiffstats
path: root/contrib/zsh_completion.in
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/zsh_completion.in')
-rw-r--r--contrib/zsh_completion.in18
1 files changed, 9 insertions, 9 deletions
diff --git a/contrib/zsh_completion.in b/contrib/zsh_completion.in
index f69fe631..16919134 100644
--- a/contrib/zsh_completion.in
+++ b/contrib/zsh_completion.in
@@ -222,20 +222,20 @@ _pacman_completions_all_groups() {
_pacman_completions_all_packages() {
local -a cmd packages repositories packages_long
- repositories=(${(o)${${${(M)${(f)"$(</etc/pacman.conf)"}:#\[*}/\[/}/\]/}:#options})
+ repositories=(${(o)${${${(M)${(f)"$(<@sysconfdir@/pacman.conf)"}:#\[*}/\[/}/\]/}:#options})
typeset -U repositories
- packages_long=(/var/lib/pacman/sync/${^repositories}/*(/))
- packages=(${(o)${${packages_long/\/var\/lib\/pacman\/sync\//}#*/}%-*-*} )
+ packages_long=(@localstatedir@/lib/pacman/sync/${^repositories}/*(/))
+ packages=(${(o)${${packages_long#@localstatedir@/lib/pacman/sync/}#*/}%-*-*} )
typeset -U packages
_wanted packages expl "packages" compadd - "${(@)packages}"
if [[ $PREFIX != */* ]] ; then
- repositories=(${(o)${${${(M)${(f)"$(</etc/pacman.conf)"}:#\[*}/\[/}/\]/}:#options})
+ repositories=(${(o)${${${(M)${(f)"$(<@sysconfdir@/pacman.conf)"}:#\[*}/\[/}/\]/}:#options})
typeset -U repositories
_wanted repo_packages expl "repository/package" compadd -S "/" $repositories
else
compset -P '*/'
- packages_long=(/var/lib/pacman/sync/$IPREFIX*(/))
- packages=(${(o)${${packages_long/\/var\/lib\/pacman\/sync\//}#*/}%-*-*} )
+ packages_long=(@localstatedir@/lib/pacman/sync/$IPREFIX*(/))
+ packages=(${(o)${${packages_long#@localstatedir@/lib/pacman/sync/}#*/}%-*-*} )
typeset -U packages
_wanted repo_packages expl "repository/package" compadd ${(@)packages}
fi
@@ -253,15 +253,15 @@ _pacman_completions_installed_groups() {
# provides completions for installed packages
_pacman_completions_installed_packages() {
local -a cmd packages packages_long
- packages_long=(/var/lib/pacman/local/*(/))
- packages=( ${${packages_long/\/var\/lib\/pacman\/local\//}%-*-*} )
+ packages_long=(@localstatedir@/lib/pacman/local/*(/))
+ packages=( ${${packages_long#@localstatedir@/lib/pacman/local/}%-*-*} )
compadd "$@" -a packages
}
# provides completions for repository names
_pacman_completions_repositories() {
local -a cmd repositories
- repositories=(${(o)${${${(M)${(f)"$(</etc/pacman.conf)"}:#\[*}/\[/}/\]/}:#options})
+ repositories=(${(o)${${${(M)${(f)"$(<@sysconfdir@/pacman.conf)"}:#\[*}/\[/}/\]/}:#options})
# Uniq the array
typeset -U repositories
compadd "$@" -a repositories