Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/contrib/zsh_completion.in
diff options
context:
space:
mode:
authorNezmer <git@nezmer.info>2010-10-12 02:23:16 +0300
committerDan McGee <dan@archlinux.org>2010-10-11 20:29:22 -0500
commit05f0a28932c1acab7a9ddb58435d69626dad54da (patch)
tree86b901ee3ba6fc6ba6d7219de38e68d70d092742 /contrib/zsh_completion.in
parentbce3c8efc7a2d187984aa0e7037307b99c217fd7 (diff)
Use sysconfdir, localstatedir, BASH instead of hardcoded values
This applies to contrib/ files, our scripts, and the documentation. Dan: fix 'make clean' in contrib/ directory. Signed-off-by: Nezmer <git@nezmer.info> Signed-off-by: Dan McGee <dan@archlinux.org>
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