unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: bash-completion: Update to 2.3.
@ 2016-08-03  8:53 Tomáš Čech
  2016-08-05 18:53 ` Andreas Enge
  0 siblings, 1 reply; 9+ messages in thread
From: Tomáš Čech @ 2016-08-03  8:53 UTC (permalink / raw)
  To: guix-devel

* 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 © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2015 Leo Famulari <leo@famulari.name>
+;;; Copyright © 2016 Tomáš Čech <sleep_walker@gnu.org>
 ;;;
 ;;; 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-completion"
-                                                      "/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 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-completion"
+                                                         "/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 adapted
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.
 
---- 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
-@@ -1928,9 +1928,20 @@ _completion_loader()
-     local compfile=./completions
-     [[ $BASH_SOURCE == */* ]] && compfile="${BASH_SOURCE%/*}/completions"
-     compfile+="/${1##*/}"
-+    local base="${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 @@
  
-+    # 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
- 
-     # Need to define *something*, otherwise there will be no completion at all.
-     complete -F _minimal "$1" && return 124
+ __load_completion()
+ {
+-    local -a dirs=( ${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions )
++    local -a dirs=(
++        "$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=$IFS IFS=: dir cmd="$1" compfile
+     for dir in ${XDG_DATA_DIRS:-/usr/local/share:/usr/share}; do
+         dirs+=( $dir/bash-completion/completions )
-- 
2.9.2

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] gnu: bash-completion: Update to 2.3.
  2016-08-03  8:53 [PATCH] gnu: bash-completion: Update to 2.3 Tomáš Čech
@ 2016-08-05 18:53 ` Andreas Enge
  2016-08-07  3:06   ` Leo Famulari
  0 siblings, 1 reply; 9+ messages in thread
From: Andreas Enge @ 2016-08-05 18:53 UTC (permalink / raw)
  To: Tomáš Čech; +Cc: guix-devel

Hello,

On Wed, Aug 03, 2016 at 10:53:11AM +0200, Tomáš Čech wrote:
> * 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.

just the quick standard comment: Please do the switch from alist-...
to modify-phases in a separate first commit; it makes it easier to see
the real diff of your real commit.

The autoreconf phase is strange. Why is it suddenly needed? If there is no
way around it, you should at least add a comment.

Andreas

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] gnu: bash-completion: Update to 2.3.
  2016-08-05 18:53 ` Andreas Enge
@ 2016-08-07  3:06   ` Leo Famulari
  2016-08-07  8:06     ` Tomáš Čech
  0 siblings, 1 reply; 9+ messages in thread
From: Leo Famulari @ 2016-08-07  3:06 UTC (permalink / raw)
  To: Andreas Enge; +Cc: guix-devel

On Fri, Aug 05, 2016 at 08:53:46PM +0200, Andreas Enge wrote:
> The autoreconf phase is strange. Why is it suddenly needed? If there is no
> way around it, you should at least add a comment.

I notice that when projects move to GitHub, they sometimes forget to cut
a new release. GitHub automatically generates a tarball of the source
tree for each tag, and those are not bootstrapped. That's probably what
happened here, and it's worth an upstream bug report, IMO.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] gnu: bash-completion: Update to 2.3.
  2016-08-07  3:06   ` Leo Famulari
@ 2016-08-07  8:06     ` Tomáš Čech
  2016-08-07 10:07       ` [PATCHv2 1/2] gnu: bash-completion: Modify to modify-phases Tomáš Čech
  0 siblings, 1 reply; 9+ messages in thread
From: Tomáš Čech @ 2016-08-07  8:06 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 632 bytes --]

On Sat, Aug 06, 2016 at 11:06:05PM -0400, Leo Famulari wrote:
>On Fri, Aug 05, 2016 at 08:53:46PM +0200, Andreas Enge wrote:
>> The autoreconf phase is strange. Why is it suddenly needed? If there is no
>> way around it, you should at least add a comment.
>
>I notice that when projects move to GitHub, they sometimes forget to cut
>a new release. GitHub automatically generates a tarball of the source
>tree for each tag, and those are not bootstrapped. That's probably what
>happened here, and it's worth an upstream bug report, IMO.
>

Reported here:

  https://github.com/scop/bash-completion/issues/64

Thanks for review.

S_W

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCHv2 1/2] gnu: bash-completion: Modify to modify-phases.
  2016-08-07  8:06     ` Tomáš Čech
@ 2016-08-07 10:07       ` Tomáš Čech
  2016-08-07 10:07         ` [PATCHv2 2/2] gnu: bash-completion: Update to 2.3. Update the patch Tomáš Čech
  2016-08-08 21:10         ` [PATCHv2 1/2] gnu: bash-completion: Modify to modify-phases Leo Famulari
  0 siblings, 2 replies; 9+ messages in thread
From: Tomáš Čech @ 2016-08-07 10:07 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/bash.scm(bash-completion): Use modify-phases instead of
  alist-cons-after.
---
 gnu/packages/bash.scm | 46 +++++++++++++++++++++++-----------------------
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm
index ff3acfc..c006546 100644
--- a/gnu/packages/bash.scm
+++ b/gnu/packages/bash.scm
@@ -289,29 +289,29 @@ without modification.")
     (build-system gnu-build-system)
     (native-inputs `(("util-linux" ,util-linux)))
     (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-completion"
-                                                      "/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 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-completion"
+                                                        "/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))))))
     (synopsis "Bash completions for common commands")
     (description
      "This package provides extensions that allow Bash to provide adapted
-- 
2.9.2

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCHv2 2/2] gnu: bash-completion: Update to 2.3. Update the patch.
  2016-08-07 10:07       ` [PATCHv2 1/2] gnu: bash-completion: Modify to modify-phases Tomáš Čech
@ 2016-08-07 10:07         ` Tomáš Čech
  2016-08-08 21:14           ` Leo Famulari
  2016-08-08 21:10         ` [PATCHv2 1/2] gnu: bash-completion: Modify to modify-phases Leo Famulari
  1 sibling, 1 reply; 9+ messages in thread
From: Tomáš Čech @ 2016-08-07 10:07 UTC (permalink / raw)
  To: guix-devel

* 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.
---
 gnu/packages/bash.scm                              |  8 ++---
 .../patches/bash-completion-directories.patch      | 40 +++++++++-------------
 2 files changed, 21 insertions(+), 27 deletions(-)

diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm
index c006546..bddb830 100644
--- a/gnu/packages/bash.scm
+++ b/gnu/packages/bash.scm
@@ -275,15 +275,15 @@ 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 "/releases/download/"
+                    version "/" name "-" version ".tar.xz"))
               (sha256
                (base32
-                "0kxf8s5bw7y50x0ksb77d3kv0dwadixhybl818w27y6mlw26hq1b"))
+                "1sg82nmsr00ig37skln2qvmi8mgbxgdvycm3ygzs8gbz66pq3q5j"))
               (patches
                (search-patches "bash-completion-directories.patch"))))
     (build-system gnu-build-system)
diff --git a/gnu/packages/patches/bash-completion-directories.patch b/gnu/packages/patches/bash-completion-directories.patch
index 1a3e2f5..351a8e0 100644
--- a/gnu/packages/patches/bash-completion-directories.patch
+++ b/gnu/packages/patches/bash-completion-directories.patch
@@ -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.
 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
-@@ -1928,9 +1928,20 @@ _completion_loader()
-     local compfile=./completions
-     [[ $BASH_SOURCE == */* ]] && compfile="${BASH_SOURCE%/*}/completions"
-     compfile+="/${1##*/}"
-+    local base="${1##*/}"
- 
-+    # 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
+
+--- a/bash_completion	2016-08-03 10:23:02.356782287 +0200
++++ b/bash_completion	2016-08-03 10:27:50.120140403 +0200
+@@ -1960,7 +1960,13 @@
  
-     # Need to define *something*, otherwise there will be no completion at all.
-     complete -F _minimal "$1" && return 124
+ __load_completion()
+ {
+-    local -a dirs=( ${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions )
++    local -a dirs=(
++        "$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=$IFS IFS=: dir cmd="$1" compfile
+     for dir in ${XDG_DATA_DIRS:-/usr/local/share:/usr/share}; do
+         dirs+=( $dir/bash-completion/completions )
-- 
2.9.2

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCHv2 1/2] gnu: bash-completion: Modify to modify-phases.
  2016-08-07 10:07       ` [PATCHv2 1/2] gnu: bash-completion: Modify to modify-phases Tomáš Čech
  2016-08-07 10:07         ` [PATCHv2 2/2] gnu: bash-completion: Update to 2.3. Update the patch Tomáš Čech
@ 2016-08-08 21:10         ` Leo Famulari
  1 sibling, 0 replies; 9+ messages in thread
From: Leo Famulari @ 2016-08-08 21:10 UTC (permalink / raw)
  To: Tomáš Čech; +Cc: guix-devel

On Sun, Aug 07, 2016 at 12:07:14PM +0200, Tomáš Čech wrote:
> * gnu/packages/bash.scm(bash-completion): Use modify-phases instead of
>   alist-cons-after.

Please add a space before (bash-completion).

Otherwise, looks good to me!

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCHv2 2/2] gnu: bash-completion: Update to 2.3. Update the patch.
  2016-08-07 10:07         ` [PATCHv2 2/2] gnu: bash-completion: Update to 2.3. Update the patch Tomáš Čech
@ 2016-08-08 21:14           ` Leo Famulari
  2016-08-09  9:05             ` Tomáš Čech
  0 siblings, 1 reply; 9+ messages in thread
From: Leo Famulari @ 2016-08-08 21:14 UTC (permalink / raw)
  To: Tomáš Čech; +Cc: guix-devel

On Sun, Aug 07, 2016 at 12:07:15PM +0200, Tomáš Čech wrote:
> * gnu/packages/bash.scm(bash-completion): Update to 2.3.

Same nit-pick about leaving a space before the variable name :)

> * gnu/packages/patches/bash-completion-directories.patch: New version of
>   the patch for the same purpose.

LGTM

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCHv2 2/2] gnu: bash-completion: Update to 2.3. Update the patch.
  2016-08-08 21:14           ` Leo Famulari
@ 2016-08-09  9:05             ` Tomáš Čech
  0 siblings, 0 replies; 9+ messages in thread
From: Tomáš Čech @ 2016-08-09  9:05 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 423 bytes --]

On Mon, Aug 08, 2016 at 05:14:41PM -0400, Leo Famulari wrote:
>On Sun, Aug 07, 2016 at 12:07:15PM +0200, Tomáš Čech wrote:
>> * gnu/packages/bash.scm(bash-completion): Update to 2.3.
>
>Same nit-pick about leaving a space before the variable name :)
>
>> * gnu/packages/patches/bash-completion-directories.patch: New version of
>>   the patch for the same purpose.
>
>LGTM

Thanks for review, pushed.

S_W

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-08-09  9:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-03  8:53 [PATCH] gnu: bash-completion: Update to 2.3 Tomáš Čech
2016-08-05 18:53 ` Andreas Enge
2016-08-07  3:06   ` Leo Famulari
2016-08-07  8:06     ` Tomáš Čech
2016-08-07 10:07       ` [PATCHv2 1/2] gnu: bash-completion: Modify to modify-phases Tomáš Čech
2016-08-07 10:07         ` [PATCHv2 2/2] gnu: bash-completion: Update to 2.3. Update the patch Tomáš Čech
2016-08-08 21:14           ` Leo Famulari
2016-08-09  9:05             ` Tomáš Čech
2016-08-08 21:10         ` [PATCHv2 1/2] gnu: bash-completion: Modify to modify-phases Leo Famulari

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).