From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20=C4=8Cech?= Subject: [PATCH] gnu: bash-completion: Update to 2.3. Date: Wed, 3 Aug 2016 10:53:11 +0200 Message-ID: <20160803085311.24325-1-sleep_walker@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33554) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUrvS-0002tI-Pe for guix-devel@gnu.org; Wed, 03 Aug 2016 04:53:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUrvO-0004aG-J9 for guix-devel@gnu.org; Wed, 03 Aug 2016 04:53:17 -0400 List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org * gnu/packages/bash.scm(bash-completion): Update to 2.3, add autoreconf phase, change origin to Github. * gnu/packages/patches/bash-completion-directories.patch: Rework - same purpose, different code. --- gnu/packages/bash.scm | 62 ++++++++++++----= ------ .../patches/bash-completion-directories.patch | 39 ++++++-------- 2 files changed, 50 insertions(+), 51 deletions(-) diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm index ff3acfc..6f3fe17 100644 --- a/gnu/packages/bash.scm +++ b/gnu/packages/bash.scm @@ -2,6 +2,7 @@ ;;; Copyright =C2=A9 2012, 2013, 2014, 2015 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2014, 2015 Mark H Weaver ;;; Copyright =C2=A9 2015 Leo Famulari +;;; Copyright =C2=A9 2016 Tom=C3=A1=C5=A1 =C4=8Cech ;;; ;;; This file is part of GNU Guix. ;;; @@ -21,6 +22,7 @@ (define-module (gnu packages bash) #:use-module (guix licenses) #:use-module (gnu packages) + #:use-module (gnu packages autotools) #:use-module (gnu packages ncurses) #:use-module (gnu packages readline) #:use-module (gnu packages bison) @@ -275,43 +277,47 @@ without modification.") (define-public bash-completion (package (name "bash-completion") - (version "2.1") + (version "2.3") (source (origin (method url-fetch) (uri (string-append - "http://bash-completion.alioth.debian.org/files/" - "bash-completion-" version ".tar.bz2")) + "https://github.com/scop/" name "/archive/" version + ".tar.gz")) (sha256 (base32 - "0kxf8s5bw7y50x0ksb77d3kv0dwadixhybl818w27y6mlw26hq1b")) + "0aij7fmn6f7q3z6pbqn61h0b81ydl5iv19zhhj5cdfz3yvswwbyr")) (patches (search-patches "bash-completion-directories.patch")))) (build-system gnu-build-system) - (native-inputs `(("util-linux" ,util-linux))) + (native-inputs `(("util-linux" ,util-linux) + ("autoconf" ,autoconf) + ("automake" ,automake))) (arguments - `(#:phases (alist-cons-after - 'install 'remove-redundant-completions - (lambda* (#:key inputs outputs #:allow-other-keys) - ;; Util-linux comes with a bunch of completion files = for - ;; its own commands which are more sophisticated and - ;; up-to-date than those of bash-completion. Remove = those - ;; from bash-completion. - (let* ((out (assoc-ref outputs "out")) - (util-linux (assoc-ref inputs "util-linux")) - (completions (string-append out - "/share/bash-compl= etion" - "/completions")) - (already (find-files - (string-append - util-linux - "/etc/bash_completion.d")))) - (with-directory-excursion completions - (for-each (lambda (file) - (when (file-exists? file) - (delete-file file))) - (map basename already))) - #t)) - %standard-phases))) + `(#:phases (modify-phases %standard-phases + (add-after 'install 'remove-redundant-completions + (lambda* (#:key inputs outputs #:allow-other-keys) + ;; Util-linux comes with a bunch of completion fil= es for + ;; its own commands which are more sophisticated a= nd + ;; up-to-date than those of bash-completion. Remo= ve those + ;; from bash-completion. + (let* ((out (assoc-ref outputs "out")) + (util-linux (assoc-ref inputs "util-linux"= )) + (completions (string-append out + "/share/bash-co= mpletion" + "/completions")= ) + (already (find-files + (string-append + util-linux + "/etc/bash_completion.d")))) + (with-directory-excursion completions + (for-each (lambda (file) + (when (file-exists? file) + (delete-file file))) + (map basename already))) + #t))) + (add-before 'configure 'autoconf + (lambda _ + (zero? (system* "autoreconf" "-vfi"))))))) (synopsis "Bash completions for common commands") (description "This package provides extensions that allow Bash to provide adapte= d diff --git a/gnu/packages/patches/bash-completion-directories.patch b/gnu= /packages/patches/bash-completion-directories.patch index 1a3e2f5..9a40f11 100644 --- a/gnu/packages/patches/bash-completion-directories.patch +++ b/gnu/packages/patches/bash-completion-directories.patch @@ -7,27 +7,20 @@ 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. This is what this patch does. =20 ---- bash-completion-2.1/bash_completion 2015-03-11 09:45:45.056846446 +0= 100 -+++ bash-completion-2.1/bash_completion 2015-03-11 09:52:43.248159504 +0= 100 -@@ -1928,9 +1928,20 @@ _completion_loader() - local compfile=3D./completions - [[ $BASH_SOURCE =3D=3D */* ]] && compfile=3D"${BASH_SOURCE%/*}/comp= letions" - compfile+=3D"/${1##*/}" -+ local base=3D"${1##*/}" +--- a/bash_completiong 2016-08-03 10:23:02.356782287 +0200 ++++ b/bash_completion 2016-08-03 10:27:50.120140403 +0200 +@@ -1960,7 +1960,13 @@ =20 -+ # Look for completion files in the user and global profiles and -+ # lastly in 'bash-completion' itself. -+ for file in = \ -+ "$HOME/.guix-profile/share/bash-completion/completions/$base" = \ -+ "$HOME/.guix-profile/etc/bash_completion.d/$base" = \ -+ "/run/current-system/profile/share/bash-completion/completions/= $base" \ -+ "/run/current-system/profile/etc/bash_completion.d/$base" = \ -+ "$compfile" -+ do - # Avoid trying to source dirs; https://bugzilla.redhat.com/903540 -- [[ -f "$compfile" ]] && . "$compfile" &>/dev/null && return 124 -+ [[ -f "$file" ]] && . "$file" &>/dev/null && return 124 -+ done -=20 - # Need to define *something*, otherwise there will be no completion= at all. - complete -F _minimal "$1" && return 124 + __load_completion() + { +- local -a dirs=3D( ${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOM= E/.local/share}/bash-completion}/completions ) ++ local -a dirs=3D( ++ "$HOME/.guix-profile/share/bash-completion/completions/$base" ++ "$HOME/.guix-profile/etc/bash_completion.d/$base" ++ "/run/current-system/profile/share/bash-completion/completions/= $base" ++ "/run/current-system/profile/etc/bash_completion.d/$base" ++ ${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share= }/bash-completion}/completions ) ++ + local OIFS=3D$IFS IFS=3D: dir cmd=3D"$1" compfile + for dir in ${XDG_DATA_DIRS:-/usr/local/share:/usr/share}; do + dirs+=3D( $dir/bash-completion/completions ) --=20 2.9.2