gnu: bash-completion: Update to 2.3. Update the patch.

* gnu/packages/bash.scm (bash-completion): Update to 2.3.
* gnu/packages/patches/bash-completion-directories.patch: New version of
  the patch for the same purpose.
This commit is contained in:
Tomáš Čech 2016-08-07 12:02:27 +02:00
parent aa67d3c546
commit ba6d25f3b9
No known key found for this signature in database
GPG Key ID: 4A23E34FA033436D
2 changed files with 21 additions and 27 deletions

View File

@ -275,15 +275,15 @@ without modification.")
(define-public bash-completion (define-public bash-completion
(package (package
(name "bash-completion") (name "bash-completion")
(version "2.1") (version "2.3")
(source (origin (source (origin
(method url-fetch) (method url-fetch)
(uri (string-append (uri (string-append
"http://bash-completion.alioth.debian.org/files/" "https://github.com/scop/" name "/releases/download/"
"bash-completion-" version ".tar.bz2")) version "/" name "-" version ".tar.xz"))
(sha256 (sha256
(base32 (base32
"0kxf8s5bw7y50x0ksb77d3kv0dwadixhybl818w27y6mlw26hq1b")) "1sg82nmsr00ig37skln2qvmi8mgbxgdvycm3ygzs8gbz66pq3q5j"))
(patches (patches
(search-patches "bash-completion-directories.patch")))) (search-patches "bash-completion-directories.patch"))))
(build-system gnu-build-system) (build-system gnu-build-system)

View File

@ -7,27 +7,21 @@ On Guix systems, we want not only to search within bash-completion's own
directory, but also in the user's profile and in the system profile. directory, but also in the user's profile and in the system profile.
This is what this patch does. This is what this patch does.
--- bash-completion-2.1/bash_completion 2015-03-11 09:45:45.056846446 +0100
+++ bash-completion-2.1/bash_completion 2015-03-11 09:52:43.248159504 +0100 --- a/bash_completion 2016-08-03 10:23:02.356782287 +0200
@@ -1928,9 +1928,20 @@ _completion_loader() +++ b/bash_completion 2016-08-03 10:27:50.120140403 +0200
local compfile=./completions @@ -1960,7 +1960,13 @@
[[ $BASH_SOURCE == */* ]] && compfile="${BASH_SOURCE%/*}/completions"
compfile+="/${1##*/}"
+ local base="${1##*/}"
+ # Look for completion files in the user and global profiles and __load_completion()
+ # lastly in 'bash-completion' itself. {
+ for file in \ - local -a dirs=( ${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions )
+ "$HOME/.guix-profile/share/bash-completion/completions/$base" \ + local -a dirs=(
+ "$HOME/.guix-profile/etc/bash_completion.d/$base" \ + "$HOME/.guix-profile/share/bash-completion/completions/$base"
+ "/run/current-system/profile/share/bash-completion/completions/$base" \ + "$HOME/.guix-profile/etc/bash_completion.d/$base"
+ "/run/current-system/profile/etc/bash_completion.d/$base" \ + "/run/current-system/profile/share/bash-completion/completions/$base"
+ "$compfile" + "/run/current-system/profile/etc/bash_completion.d/$base"
+ do + ${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions )
# Avoid trying to source dirs; https://bugzilla.redhat.com/903540 +
- [[ -f "$compfile" ]] && . "$compfile" &>/dev/null && return 124 local OIFS=$IFS IFS=: dir cmd="$1" compfile
+ [[ -f "$file" ]] && . "$file" &>/dev/null && return 124 for dir in ${XDG_DATA_DIRS:-/usr/local/share:/usr/share}; do
+ done dirs+=( $dir/bash-completion/completions )
# Need to define *something*, otherwise there will be no completion at all.
complete -F _minimal "$1" && return 124