diff options
author | Ludovic Courtès <ludo@gnu.org> | 2019-08-28 18:51:12 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2019-08-28 18:52:52 +0200 |
commit | e09c7f4ae4e1c634975874cc18fd65ae4c4af091 (patch) | |
tree | a8b602e349554ad884aa372cc99837bd5b23de69 /guix/remote.scm | |
parent | 2a5f781e76e2dbacf5b828e7e73a8d9f60e79b60 (diff) | |
download | patches-e09c7f4ae4e1c634975874cc18fd65ae4c4af091.tar patches-e09c7f4ae4e1c634975874cc18fd65ae4c4af091.tar.gz |
remote, ssh: Show the command exit status upon failure.
* guix/remote.scm (remote-pipe-for-gexp): Show the exit status in error
message.
* guix/ssh.scm (remote-inferior): Likewise.
Diffstat (limited to 'guix/remote.scm')
-rw-r--r-- | guix/remote.scm | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/guix/remote.scm b/guix/remote.scm index d0c3d04a25..c00585de74 100644 --- a/guix/remote.scm +++ b/guix/remote.scm @@ -27,6 +27,7 @@ #:use-module (guix derivations) #:use-module (guix utils) #:use-module (ssh popen) + #:use-module (ssh channel) #:use-module (srfi srfi-1) #:use-module (srfi srfi-34) #:use-module (srfi srfi-35) @@ -68,10 +69,13 @@ BECOME-COMMAND is given, use that to invoke the remote Guile REPL." (let ((pipe (apply open-remote-pipe* session OPEN_READ repl-command))) (when (eof-object? (peek-char pipe)) - (raise (condition - (&message - (message (format #f (G_ "failed to run '~{~a~^ ~}'") - repl-command)))))) + (let ((status (channel-get-exit-status pipe))) + (close-port pipe) + (raise (condition + (&message + (message (format #f (G_ "remote command '~{~a~^ ~}' failed \ +with status ~a") + repl-command status))))))) pipe)) (define* (%remote-eval lowered session #:optional become-command) |