projects/guix·blob java-team · refs

31 lines · 1.4 KiB

1Bash-completion is written with FHS in mind where completion scripts
2all get added to /usr/share/bash-completion/completions and are picked
3up by the dynamic completion loader from there---whether they are
4part of bash-completion or installed by another package.
5
6On Guix systems, we want not only to search within bash-completion's own
7directory, but also in the user's profile and guix home profile, as well
8as in the system profile.
9This is what this patch does.
10
11
12--- a/bash_completion
13+++ b/bash_completion
14@@ -2173,7 +2173,15 @@ complete -F _minimal ''
15
16 __load_completion()
17 {
18- local -a dirs=(${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions)
19+ local -a dirs=(
20+ ${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions
21+ "$HOME/.guix-profile/share/bash-completion/completions"
22+ "$HOME/.guix-profile/etc/bash_completion.d"
23+ "$HOME/.guix-home/profile/share/bash-completion/completions"
24+ "$HOME/.guix-home/profile/etc/bash_completion.d"
25+ "/run/current-system/profile/share/bash-completion/completions"
26+ "/run/current-system/profile/etc/bash_completion.d" )
27+
28 local ifs=$IFS IFS=: dir cmd="${1##*/}" compfile
29 [[ -n $cmd ]] || return 1
30 for dir in ${XDG_DATA_DIRS:-/usr/local/share:/usr/share}; do
31 dirs+=( $dir/bash-completion/completions )