GNU bug report logs - #66499
[PATCH] ui: Handle EPIPE errors when displaying Guix version.

Previous Next

Package: guix-patches;

Reported by: Simon Tournier <zimon.toutoune <at> gmail.com>

Date: Thu, 12 Oct 2023 13:40:01 UTC

Severity: normal

Tags: patch

Done: Simon Tournier <zimon.toutoune <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Simon Tournier <zimon.toutoune <at> gmail.com>
To: 66499 <at> debbugs.gnu.org
Cc: othacehe <at> gnu.org, Simon Tournier <zimon.toutoune <at> gmail.com>
Subject: [bug#66499] [PATCH v2 01/39] ui: Handle EPIPE errors when displaying Guix version.
Date: Mon, 16 Oct 2023 19:29:19 +0200
Fixes <https://issues.guix.gnu.org/66254>.
Reported by Clément Lassieur <clement <at> lassieur.org>.

* guix/ui.scm (show-version-and-exit): Handle EPIPE errors when displaying
version.
---
 guix/ui.scm | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/guix/ui.scm b/guix/ui.scm
index 6f2d4fe245..e3bf07212f 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -552,19 +552,20 @@ (define (initialize-guix)
 
 (define* (show-version-and-exit #:optional (command (car (command-line))))
   "Display version information for COMMAND and `(exit 0)'."
-  (simple-format #t "~a (~a) ~a~%"
-                 command %guix-package-name %guix-version)
-  (format #t "Copyright ~a 2023 ~a"
-          ;; TRANSLATORS: Translate "(C)" to the copyright symbol
-          ;; (C-in-a-circle), if this symbol is available in the user's
-          ;; locale.  Otherwise, do not translate "(C)"; leave it as-is.  */
-          (G_ "(C)")
-          (G_ "the Guix authors\n"))
-  (display (G_"\
+  (leave-on-EPIPE
+   (simple-format #t "~a (~a) ~a~%"
+                  command %guix-package-name %guix-version)
+   (format #t "Copyright ~a 2023 ~a"
+           ;; TRANSLATORS: Translate "(C)" to the copyright symbol
+           ;; (C-in-a-circle), if this symbol is available in the user's
+           ;; locale.  Otherwise, do not translate "(C)"; leave it as-is.  */
+           (G_ "(C)")
+           (G_ "the Guix authors\n"))
+   (display (G_"\
 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.
-"))
+")))
   (exit 0))
 
 (define (show-bug-report-information)

base-commit: b6a070d2a3c059c1a574dc4048fb8f942e008799
-- 
2.38.1





This bug report was last modified 1 year and 216 days ago.

Previous Next


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