gnu: Add kafs-client
[jackhill/guix/guix.git] / gnu / packages / patches / bash-completion-directories.patch
CommitLineData
16629c8a
LC
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 in the system profile.
8This is what this patch does.
9
ba6d25f3 10
504be7db
TGR
11--- a/bash_completion
12+++ b/bash_completion
13@@ -2016,7 +2016,13 @@ complete -F _minimal ''
16629c8a 14
ba6d25f3
15 __load_completion()
16 {
17- local -a dirs=( ${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions )
18+ local -a dirs=(
19+ "$HOME/.guix-profile/share/bash-completion/completions/$base"
20+ "$HOME/.guix-profile/etc/bash_completion.d/$base"
21+ "/run/current-system/profile/share/bash-completion/completions/$base"
22+ "/run/current-system/profile/etc/bash_completion.d/$base"
23+ ${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions )
24+
504be7db 25 local OIFS=$IFS IFS=: dir cmd="${1##*/}" compfile
ba6d25f3
26 for dir in ${XDG_DATA_DIRS:-/usr/local/share:/usr/share}; do
27 dirs+=( $dir/bash-completion/completions )