From 92ee0fd5eb7b1572cd4f90a7c12c1137ce74004b Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 7 Jun 2023 10:14:17 +0200 Subject: 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(-) (limited to 'guix/scripts/import.scm') 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 _ ...) -- cgit v1.2.3