mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-24 11:39:46 -05:00
secret-service: Clarify the origin of messages.
* gnu/build/secret-service.scm (secret-service-send-secrets) (secret-service-receive-secrets): Prefix messages by "secret service".
This commit is contained in:
parent
dabb00ffee
commit
118b6dbb46
1 changed files with 11 additions and 6 deletions
|
@ -54,11 +54,14 @@ (define (file->file+size+mode file-name)
|
||||||
(lambda (key . args)
|
(lambda (key . args)
|
||||||
(when (zero? retry)
|
(when (zero? retry)
|
||||||
(apply throw key args))
|
(apply throw key args))
|
||||||
(format (current-error-port) "retrying connection~%")
|
(format (current-error-port)
|
||||||
|
"secret service: retrying connection [~a attempts left]~%"
|
||||||
|
(- retry 1))
|
||||||
(sleep 1)
|
(sleep 1)
|
||||||
(loop (1- retry)))))
|
(loop (1- retry)))))
|
||||||
|
|
||||||
(format (current-error-port) "connected! sending files in ~s %~"
|
(format (current-error-port)
|
||||||
|
"secret service: connected; sending files in ~s~%"
|
||||||
secret-root)
|
secret-root)
|
||||||
(let* ((files (if secret-root (find-files secret-root) '()))
|
(let* ((files (if secret-root (find-files secret-root) '()))
|
||||||
(files-sizes-modes (map file->file+size+mode files))
|
(files-sizes-modes (map file->file+size+mode files))
|
||||||
|
@ -82,11 +85,12 @@ (define (wait-for-client port)
|
||||||
(bind sock AF_INET INADDR_ANY port)
|
(bind sock AF_INET INADDR_ANY port)
|
||||||
(listen sock 1)
|
(listen sock 1)
|
||||||
(format (current-error-port)
|
(format (current-error-port)
|
||||||
"waiting for secrets on port ~a...~%"
|
"secret service: waiting for secrets on port ~a...~%"
|
||||||
port)
|
port)
|
||||||
(match (accept sock)
|
(match (accept sock)
|
||||||
((client . address)
|
((client . address)
|
||||||
(format (current-error-port) "client connection from ~a~%"
|
(format (current-error-port)
|
||||||
|
"secret service: client connection from ~a~%"
|
||||||
(inet-ntop (sockaddr:fam address)
|
(inet-ntop (sockaddr:fam address)
|
||||||
(sockaddr:addr address)))
|
(sockaddr:addr address)))
|
||||||
(close-port sock)
|
(close-port sock)
|
||||||
|
@ -116,7 +120,8 @@ (define (read-secrets port)
|
||||||
('files ((files sizes modes) ...)))
|
('files ((files sizes modes) ...)))
|
||||||
(for-each (lambda (file size mode)
|
(for-each (lambda (file size mode)
|
||||||
(format (current-error-port)
|
(format (current-error-port)
|
||||||
"installing file '~a' (~a bytes)...~%"
|
"secret service: \
|
||||||
|
installing file '~a' (~a bytes)...~%"
|
||||||
file size)
|
file size)
|
||||||
(mkdir-p (dirname file))
|
(mkdir-p (dirname file))
|
||||||
(call-with-output-file file
|
(call-with-output-file file
|
||||||
|
@ -126,7 +131,7 @@ (define (read-secrets port)
|
||||||
files sizes modes))
|
files sizes modes))
|
||||||
(_
|
(_
|
||||||
(format (current-error-port)
|
(format (current-error-port)
|
||||||
"invalid secrets received~%")
|
"secret service: invalid secrets received~%")
|
||||||
#f)))
|
#f)))
|
||||||
|
|
||||||
(let* ((port (wait-for-client port))
|
(let* ((port (wait-for-client port))
|
||||||
|
|
Loading…
Reference in a new issue