guix-commits
[Top][All Lists]
Advanced

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

01/17: import: Gracefully handle EPIPE.


From: guix-commits
Subject: 01/17: import: Gracefully handle EPIPE.
Date: Thu, 8 Jun 2023 17:46:52 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 92ee0fd5eb7b1572cd4f90a7c12c1137ce74004b
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Wed Jun 7 10:14:17 2023 +0200

    import: Gracefully handle EPIPE.
    
    Previously, "guix import pypi f3 | head -3" would print a backtrace.
    
    * guix/scripts/import.scm (guix-import): Wrap
    'pretty-print-with-comments' call in 'leave-on-EPIPE'.
---
 guix/scripts/import.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm
index f84a964a53..4ddd8d46a1 100644
--- a/guix/scripts/import.scm
+++ b/guix/scripts/import.scm
@@ -85,7 +85,8 @@ Run IMPORTER with ARGS.\n"))
     ((importer args ...)
      (if (member importer importers)
          (let ((print (lambda (expr)
-                        (pretty-print-with-comments (current-output-port) 
expr))))
+                        (leave-on-EPIPE
+                         (pretty-print-with-comments (current-output-port) 
expr)))))
            (match (apply (resolve-importer importer) args)
              ((and expr (or ('package _ ...)
                             ('let _ ...)



reply via email to

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