GNU bug report logs - #77884
[PATCH] gnu: trash-cli: Install shell completions.

Previous Next

Package: guix-patches;

Reported by: Andrew Wong <wongandj <at> icloud.com>

Date: Fri, 18 Apr 2025 04:12:05 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 77884 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#77884; Package guix-patches. (Fri, 18 Apr 2025 04:12:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Andrew Wong <wongandj <at> icloud.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 18 Apr 2025 04:12:07 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andrew Wong <wongandj <at> icloud.com>
To: guix-patches <at> gnu.org
Cc: Andrew Wong <wongandj <at> icloud.com>
Subject: [PATCH] gnu: trash-cli: Install shell completions.
Date: Fri, 18 Apr 2025 00:10:39 -0400
* gnu/packages/shellutils.scm (trash-cli)[arguments]<#:phases>Install shell completions.

Change-Id: I0b165155d1da8069837bd9b93990dfaf0ff7de52
---
 gnu/packages/shellutils.scm | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/shellutils.scm b/gnu/packages/shellutils.scm
index ea6dcafbc9..aae50d8d4c 100644
--- a/gnu/packages/shellutils.scm
+++ b/gnu/packages/shellutils.scm
@@ -672,7 +672,31 @@ (define-public trash-cli
                    (replace 'check
                      (lambda* (#:key tests? #:allow-other-keys)
                        (when tests?
-                         (invoke "pytest")))))))
+                         (invoke "pytest"))))
+                   (add-after 'wrap 'install-completions
+                     (lambda _
+                       (for-each
+                        (lambda (binary)
+                          (for-each
+                           (lambda (shell-completion-data)
+                             (mkdir-p
+                              (string-append
+                               #$output (dirname (cdr shell-completion-data))))
+                             (with-output-to-file
+                                 (format
+                                  #f (string-append
+                                      #$output (cdr shell-completion-data))
+                                  (basename binary))
+                               (lambda _
+                                 (invoke binary "--print-completion"
+                                         (car shell-completion-data)))))
+                           '(("bash" . "/share/bash-completion/completions/~a")
+                             ("zsh" . "/share/zsh/site-functions/_~a")
+                             ("tcsh" . "/etc/profile.d/~a.completion.csh"))))
+                        (find-files
+                         (string-append #$output "/bin/")
+                         (lambda (file stat)
+                           (not (string-suffix? "-real" file))))))))))
     (native-inputs (list python-flexmock
                          python-mock
                          python-parameterized

base-commit: f7c41ab31f5023023385500f6eb9083d23dd1ccb
-- 
2.49.0





This bug report was last modified 6 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.