guix-commits
[Top][All Lists]
Advanced

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

01/01: guix package: Swallow EPIPE upon 'guix package --list-generations


From: Ludovic Courtès
Subject: 01/01: guix package: Swallow EPIPE upon 'guix package --list-generations'.
Date: Tue, 23 May 2017 17:57:34 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 807ba51950720d5321ea1c95234805ccdf9b479b
Author: Ludovic Courtès <address@hidden>
Date:   Tue May 23 22:45:03 2017 +0200

    guix package: Swallow EPIPE upon 'guix package --list-generations'.
    
    Fixes <http://bugs.gnu.org/27017>.
    Reported by Alex Vong <address@hidden>.
    
    * guix/scripts/package.scm (process-query) <'list-generations>: Wrap
    body in 'leave-on-EPIPE'.
---
 guix/scripts/package.scm | 38 ++++++++++++++++++++------------------
 1 file changed, 20 insertions(+), 18 deletions(-)

diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index 1f3f49f..f050fad 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -681,24 +681,26 @@ processed, #f otherwise."
          (unless (null-list? (cdr numbers))
            (display-profile-content-diff profile (car numbers) (cadr numbers))
            (diff-profiles profile (cdr numbers))))
-       (cond ((not (file-exists? profile))      ; XXX: race condition
-              (raise (condition (&profile-not-found-error
-                                 (profile profile)))))
-             ((string-null? pattern)
-              (list-generation display-profile-content
-                               (car (profile-generations profile)))
-              (diff-profiles profile (profile-generations profile)))
-             ((matching-generations pattern profile)
-              =>
-              (lambda (numbers)
-                (if (null-list? numbers)
-                    (exit 1)
-                    (leave-on-EPIPE
-                     (list-generation display-profile-content (car numbers))
-                     (diff-profiles profile numbers)))))
-             (else
-              (leave (G_ "invalid syntax: ~a~%")
-                     pattern)))
+
+       (leave-on-EPIPE
+        (cond ((not (file-exists? profile))       ; XXX: race condition
+               (raise (condition (&profile-not-found-error
+                                  (profile profile)))))
+              ((string-null? pattern)
+               (list-generation display-profile-content
+                                (car (profile-generations profile)))
+               (diff-profiles profile (profile-generations profile)))
+              ((matching-generations pattern profile)
+               =>
+               (lambda (numbers)
+                 (if (null-list? numbers)
+                     (exit 1)
+                     (begin
+                       (list-generation display-profile-content (car numbers))
+                       (diff-profiles profile numbers)))))
+              (else
+               (leave (G_ "invalid syntax: ~a~%")
+                      pattern))))
        #t)
 
       (('list-installed regexp)



reply via email to

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