aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-03-26 16:22:41 +0100
committerLudovic Courtès <ludo@gnu.org>2014-03-26 16:27:46 +0100
commit6c41cce0bee19b3a18edc82b17d5a8a110971ac6 (patch)
treec2613de4bde1406749d29bda429fffcd1ddbe91d
parentc67ccedd9e6a75b6dd1e36b45f62cc8bbdcf93fb (diff)
downloadguix-6c41cce0bee19b3a18edc82b17d5a8a110971ac6.tar
guix-6c41cce0bee19b3a18edc82b17d5a8a110971ac6.tar.gz
offload: Wait for the processes involved in 'guix archive --missing'.
* guix/scripts/offload.scm (send-files): Keep the second return value of 'filtered-port'. Call 'waitpid' on it.
-rw-r--r--guix/scripts/offload.scm22
1 files changed, 13 insertions, 9 deletions
diff --git a/guix/scripts/offload.scm b/guix/scripts/offload.scm
index 755453704e..6f04cf3b8a 100644
--- a/guix/scripts/offload.scm
+++ b/guix/scripts/offload.scm
@@ -26,6 +26,7 @@
#:use-module ((guix build utils) #:select (which mkdir-p))
#:use-module (guix ui)
#:use-module (srfi srfi-1)
+ #:use-module (srfi srfi-11)
#:use-module (srfi srfi-26)
#:use-module (srfi srfi-34)
#:use-module (srfi srfi-35)
@@ -356,15 +357,18 @@ with exit code ~a~%"
success, #f otherwise."
(define (missing-files files)
;; Return the subset of FILES not already on MACHINE.
- (let* ((files (format #f "~{~a~%~}" files))
- (missing (filtered-port
- (list (which %lshg-command)
- "-l" (build-machine-user machine)
- "-p" (number->string (build-machine-port machine))
- "-i" (build-machine-private-key machine)
- (build-machine-name machine)
- "guix" "archive" "--missing")
- (open-input-string files))))
+ (let*-values (((files)
+ (format #f "~{~a~%~}" files))
+ ((missing pids)
+ (filtered-port
+ (list (which %lshg-command)
+ "-l" (build-machine-user machine)
+ "-p" (number->string (build-machine-port machine))
+ "-i" (build-machine-private-key machine)
+ (build-machine-name machine)
+ "guix" "archive" "--missing")
+ (open-input-string files))))
+ (for-each waitpid pids)
(string-tokenize (get-string-all missing))))
(with-store store