aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-03-13 22:57:21 +0100
committerLudovic Courtès <ludo@gnu.org>2014-03-13 22:57:21 +0100
commit1a8ea0a1885ca5fff85eb00fc79d6c6bcd47818a (patch)
tree20d06beeef7e47fed57a51c9b10ee880a0e16ecf
parent3c0e6e6080242656104143612ba57bc210779709 (diff)
downloadguix-1a8ea0a1885ca5fff85eb00fc79d6c6bcd47818a.tar
guix-1a8ea0a1885ca5fff85eb00fc79d6c6bcd47818a.tar.gz
offload: Fix 'choose-build-machine' for several machines.
* guix/scripts/offload.scm (choose-build-machine)[undecorate]: Turn into a two-argument procedure.
-rw-r--r--guix/scripts/offload.scm12
1 files changed, 8 insertions, 4 deletions
diff --git a/guix/scripts/offload.scm b/guix/scripts/offload.scm
index c9ea457db1..95e35088a1 100644
--- a/guix/scripts/offload.scm
+++ b/guix/scripts/offload.scm
@@ -466,10 +466,14 @@ allowed on MACHINE."
machines))
(define (undecorate pred)
- (match-lambda
- ((machine slot)
- (and (pred machine)
- (list machine slot)))))
+ (lambda (a b)
+ (match a
+ ((machine1 slot1)
+ (match b
+ ((machine2 slot2)
+ (if (pred machine1 machine2)
+ (list machine1 slot1)
+ (list machine2 slot2))))))))
(let ((machines+slots (sort machines+slots
(undecorate machine-less-loaded-or-faster?))))