diff options
author | Ludovic Courtès <ludo@gnu.org> | 2016-12-09 23:00:08 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2016-12-09 23:02:02 +0100 |
commit | 2b513387cd63f82afc8fb6a076674b323e964b7f (patch) | |
tree | ac2793d37ed55c54622753563058e952988bf485 | |
parent | bd8345777f5a48ee61656248655ebac71a09e926 (diff) | |
download | gnu-guix-2b513387cd63f82afc8fb6a076674b323e964b7f.tar gnu-guix-2b513387cd63f82afc8fb6a076674b323e964b7f.tar.gz |
offload: Test each machine only once.
* guix/scripts/offload.scm (check-machine-availability)[build-machine=?]:
New procedure.
Add call to 'delete-duplicates'.
-rw-r--r-- | guix/scripts/offload.scm | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/guix/scripts/offload.scm b/guix/scripts/offload.scm index f25cc5e7bb..f56220ff69 100644 --- a/guix/scripts/offload.scm +++ b/guix/scripts/offload.scm @@ -710,7 +710,14 @@ allowed on MACHINE. Return +∞ if MACHINE is unreachable." (define (check-machine-availability machine-file) "Check that each machine in MACHINE-FILE is usable as a build machine." - (let ((machines (build-machines machine-file))) + (define (build-machine=? m1 m2) + (and (string=? (build-machine-name m1) (build-machine-name m2)) + (= (build-machine-port m1) (build-machine-port m2)))) + + ;; A given build machine may appear several times (e.g., once for + ;; "x86_64-linux" and a second time for "i686-linux"); test them only once. + (let ((machines (delete-duplicates (build-machines machine-file) + build-machine=?))) (info (_ "testing ~a build machines defined in '~a'...~%") (length machines) machine-file) (let* ((names (map build-machine-name machines)) |