ssh: Add 'remote-inferior'.

* guix/inferior.scm (<inferior>)[close]: New field.
(port->inferior): New procedure.
(open-inferior): Rewrite in terms of 'port->inferior'.
(close-inferior): Honor INFERIOR's 'close' field.
(inferior-eval-with-store): Add FIXME comment.
* guix/ssh.scm (remote-inferior): New procedure.
This commit is contained in:
Ludovic Courtès 2018-12-24 00:55:07 +01:00
parent 8f5825540d
commit af15fe13b6
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
2 changed files with 27 additions and 9 deletions

View file

@ -18,6 +18,7 @@
(define-module (guix ssh)
#:use-module (guix store)
#:use-module (guix inferior)
#:use-module (guix i18n)
#:use-module ((guix utils) #:select (&fix-hint))
#:use-module (ssh session)
@ -36,6 +37,7 @@
#:use-module (ice-9 match)
#:use-module (ice-9 binary-ports)
#:export (open-ssh-session
remote-inferior
remote-daemon-channel
connect-to-remote-daemon
send-files
@ -94,6 +96,12 @@ Throw an error on failure."
(message (format #f (G_ "SSH connection to '~a' failed: ~a~%")
host (get-error session))))))))))
(define (remote-inferior session)
"Return a remote inferior for the given SESSION."
(let ((pipe (open-remote-pipe* session OPEN_BOTH
"guix" "repl" "-t" "machine")))
(port->inferior pipe)))
(define* (remote-daemon-channel session
#:optional
(socket-name