~ruther/guix-local

1a8ea0a1885ca5fff85eb00fc79d6c6bcd47818a — Ludovic Courtès 12 years ago 3c0e6e6
offload: Fix 'choose-build-machine' for several machines.

* guix/scripts/offload.scm (choose-build-machine)[undecorate]: Turn into
  a two-argument procedure.
1 files changed, 8 insertions(+), 4 deletions(-)

M guix/scripts/offload.scm
M guix/scripts/offload.scm => guix/scripts/offload.scm +8 -4
@@ 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?))))