emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#57722: closed ([PATCH] gnu: ipfs: Install bash completion.)


From: GNU bug Tracking System
Subject: bug#57722: closed ([PATCH] gnu: ipfs: Install bash completion.)
Date: Wed, 14 Sep 2022 21:30:02 +0000

Your message dated Wed, 14 Sep 2022 23:29:25 +0200
with message-id <87r10dtzka.fsf_-_@gnu.org>
and subject line Re: bug#57722: [PATCH] gnu: ipfs: Install bash completion.
has caused the debbugs.gnu.org bug report #57722,
regarding [PATCH] gnu: ipfs: Install bash completion.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
57722: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=57722
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: [PATCH] gnu: ipfs: Install bash completion. Date: Sat, 10 Sep 2022 23:47:21 +0200
* gnu/packages/ipfs.scm (ipfs)[arguments]: Add 'install-bashcompletion
phase to install bash completion.
---
 gnu/packages/ipfs.scm | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/ipfs.scm b/gnu/packages/ipfs.scm
index ccc36007b4..faa209bf2a 100644
--- a/gnu/packages/ipfs.scm
+++ b/gnu/packages/ipfs.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
 ;;; Copyright © 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2019, 2020 Martin Becze <mjbecze@riseup.net>
-;;; Copyright © 2020, 2021 Michael Rohleder <mike@rohleder.de>
+;;; Copyright © 2020, 2021, 2022 Michael Rohleder <mike@rohleder.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -230,7 +230,26 @@ (define-public go-ipfs
     (build-system go-build-system)
     (arguments
      `(#:unpack-path "github.com/ipfs/go-ipfs"
-       #:import-path "github.com/ipfs/go-ipfs/cmd/ipfs"))
+       #:import-path "github.com/ipfs/go-ipfs/cmd/ipfs"
+       #:modules ((guix build utils)
+                  (guix build go-build-system)
+                  (ice-9 popen)
+                  (ice-9 textual-ports))
+       #:phases
+       (modify-phases %standard-phases
+         ;; https://github.com/ipfs/kubo/blob/master/docs/command-completion.md
+         (add-after 'install 'install-bashcompletion
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (completiondir (string-append out 
"/etc/bash_completion.d")))
+               (mkdir-p completiondir)
+               (call-with-output-file (string-append completiondir "/ipfs")
+                 (lambda (port)
+                   (let ((input-pipe (open-pipe* OPEN_READ
+                                                 (string-append out 
"/bin/ipfs")
+                                                 "commands" "completion" 
"bash")))
+                     (display (get-string-all input-pipe) port)
+                     (close-pipe input-pipe))))))))))
     (native-inputs
      (list python-minimal-wrapper zsh))
     (home-page "https://ipfs.io";)
-- 
2.37.3




--- End Message ---
--- Begin Message --- Subject: Re: bug#57722: [PATCH] gnu: ipfs: Install bash completion. Date: Wed, 14 Sep 2022 23:29:25 +0200 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)
Michael Rohleder <mike@rohleder.de> skribis:

> From bbf32c53a2402f6f123d00d2e5ece9efdbf10504 Mon Sep 17 00:00:00 2001
> From: Michael Rohleder <mike@rohleder.de>
> Date: Tue, 13 Sep 2022 11:29:23 +0200
> Subject: [PATCH] gnu: go-ipfs: Install bash completion.
>
> * gnu/packages/ipfs.scm (go-ipfs)[arguments]: Use gexp.
> Add 'install-bashcompletion phase to install bash completion.

Applied, thanks!

Great that Maxime found a bug as a side effect.  :-)


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]