mirror of
https://github.com/moparisthebest/pacman
synced 2024-11-11 20:05:07 -05:00
contrib : update zsh and bash completion to reflect the new sync dbs location.
I wonder how many tools / scripts deal directly with the sync databases under /var/lib/pacman/ , I doubt these are the only ones. Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
This commit is contained in:
parent
461bc9e6ce
commit
3987137505
@ -48,7 +48,7 @@ _available_pkgs ()
|
||||
local available_pkgs
|
||||
local enabled_repos
|
||||
enabled_repos=$( grep '\[' /etc/pacman.conf | grep -v -e 'options' -e '^#' | tr -d '[]' )
|
||||
available_pkgs=$( for r in $enabled_repos; do echo /var/lib/pacman/$r/*; done )
|
||||
available_pkgs=$( for r in $enabled_repos; do echo /var/lib/pacman/sync/$r/*; done )
|
||||
COMPREPLY=( $( compgen -W "$( for i in $available_pkgs; do j=${i##*/}; echo ${j%-*-*}; done )" -- $cur ) )
|
||||
}
|
||||
|
||||
@ -67,7 +67,7 @@ _available_groups ()
|
||||
local available_groups
|
||||
local enabled_repos
|
||||
enabled_repos=$( grep '\[' /etc/pacman.conf | grep -v -e 'options' -e '^#' | tr -d '[]' )
|
||||
available_groups=$( for r in $enabled_repos; do sed '/%GROUPS%/,/^$/{//d; p}' /var/lib/pacman/$r/*/desc | sort -u; done )
|
||||
available_groups=$( for r in $enabled_repos; do sed '/%GROUPS%/,/^$/{//d; p}' /var/lib/pacman/sync/$r/*/desc | sort -u; done )
|
||||
COMPREPLY=( $( compgen -W "$( for i in $available_groups; do echo ${i%-*-*}; done )" -- $cur ) )
|
||||
}
|
||||
|
||||
|
@ -227,9 +227,9 @@ _pacman_completions_all_packages() {
|
||||
repositories=( $(_call_program repositories cat /etc/pacman.conf | grep "^\[" | sed "s,\(\[\|\]\),,g" | grep -v "^options" | sort -u) )
|
||||
# these can be specified as either 'package' or 'repository/package'
|
||||
if [[ "$PREFIX" == "" ]] ; then
|
||||
packages=( $(_call_program packages ls /var/lib/pacman/${^repositories} | grep -v "^/" | sed "s,\-[^-]*\-[^-]*$,," | sort -u) )
|
||||
packages=( $(_call_program packages ls /var/lib/pacman/sync/${^repositories} | grep -v "^/" | sed "s,\-[^-]*\-[^-]*$,," | sort -u) )
|
||||
else
|
||||
packages=( $(_call_program packages ls /var/lib/pacman/${^repositories} | grep -v "^/" | grep -e \^$PREFIX | sed "s,\-[^-]*\-[^-]*$,," | sort -u) )
|
||||
packages=( $(_call_program packages ls /var/lib/pacman/sync/${^repositories} | grep -v "^/" | grep -e \^$PREFIX | sed "s,\-[^-]*\-[^-]*$,," | sort -u) )
|
||||
fi
|
||||
compadd "$@" -a packages
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user