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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Andrew Wong <wongandj@HIDDEN>; Keywords: patch; Done: Andrew Wong <wongandj@HIDDEN>; Maintainer for guix-patches is guix-patches@HIDDEN.
bug closed, send any further explanations to 77884 <at> debbugs.gnu.org and Andrew Wong <wongandj@HIDDEN> Request was from Andrew Wong <wongandj@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 18 Apr 2025 04:11:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 18 00:11:14 2025
Received: from localhost ([127.0.0.1]:49174 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u5d4K-0006fi-NG
	for submit <at> debbugs.gnu.org; Fri, 18 Apr 2025 00:11:14 -0400
Received: from lists.gnu.org ([2001:470:142::17]:46460)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <wongandj@HIDDEN>)
 id 1u5d4E-0006cG-8f
 for submit <at> debbugs.gnu.org; Fri, 18 Apr 2025 00:11:10 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <wongandj@HIDDEN>)
 id 1u5d43-0003D7-8l
 for guix-patches@HIDDEN; Fri, 18 Apr 2025 00:10:55 -0400
Received: from p-east3-cluster3-host12-snip6-10.eps.apple.com
 ([2a01:b747:3006:204::7b] helo=outbound.qs.icloud.com)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <wongandj@HIDDEN>)
 id 1u5d40-0001E8-TY
 for guix-patches@HIDDEN; Fri, 18 Apr 2025 00:10:54 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com;
 s=1a1hai; bh=IixZKkJjNg+tSj6SxuLOwEAu0PiaIVhUqlCV1qCjUZg=;
 h=From:To:Subject:Date:Message-ID:MIME-Version:x-icloud-hme;
 b=qXICndxt1FnWT+jjn2ert9BOv66hFipSuPCDwXKZ4WNu9itOSg/jmAH7rfriW2ajn
 HCGI2mPp5fNUTOAyQTNxN+e6Fu/DhLjKxGspqJ17rw1Wa1gUh2FDOy25zUMyFxVWCK
 UEC3dcQSVLTan6uIZvV59nPAIwlryHBmTdspWZ/7VIdttblf+SPPoDOmQNvicEp+wf
 BWVqPvMMkGjogh7uutTAkZzf5cNAhmNTGmMguCZ60dePiX9TnUuyrTBXz8FjW/3D4y
 n9+etIAL+52PpfFtUpDMfYXo5DkyW4Cg8SP6YFLTQl+Hd15Af5UlI2PgVn4REgqaH1
 Qax/KgwV44seg==
Received: from wongworks.lan (qs-asmtp-me-k8s.p00.prod.me.com [17.57.155.37])
 by outbound.qs.icloud.com (Postfix) with ESMTPSA id D656D180014A;
 Fri, 18 Apr 2025 04:10:46 +0000 (UTC)
From: Andrew Wong <wongandj@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH] gnu: trash-cli: Install shell completions.
Date: Fri, 18 Apr 2025 00:10:39 -0400
Message-ID: <71d35b161b07d6d4193a173d4e51dbb61338c752.1744949439.git.wongandj@HIDDEN>
X-Mailer: git-send-email 2.49.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Proofpoint-ORIG-GUID: VfNzHLn2joY47xxeoRwG4niBfy52x4-9
X-Proofpoint-GUID: VfNzHLn2joY47xxeoRwG4niBfy52x4-9
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.272,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34
 definitions=2025-04-18_01,2025-04-17_01,2024-11-22_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0
 mlxlogscore=719
 adultscore=0 bulkscore=0 spamscore=0 suspectscore=0 malwarescore=0
 mlxscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.19.0-2308100000 definitions=main-2504180028
Received-SPF: pass client-ip=2a01:b747:3006:204::7b;
 envelope-from=wongandj@HIDDEN; helo=outbound.qs.icloud.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
Cc: Andrew Wong <wongandj@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

* 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





Acknowledgement sent to Andrew Wong <wongandj@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#77884; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 7 Jun 2025 13:45:02 UTC

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