base: Use inner definitions instead of big anonymous procedures.

* src/cuirass/base.scm (build-packages, process-specs): Use an inner
definition instead of a big anonymous procedure.
pull/3/head
Mathieu Lirzin 2016-11-13 02:18:05 +01:00
parent bfd395c09f
commit 5898e6f8f8
No known key found for this signature in database
GPG Key ID: 0ADEE10094604D37
1 changed files with 48 additions and 46 deletions

View File

@ -123,7 +123,7 @@ if required."
(define (build-packages store db jobs)
"Build JOBS and return a list of Build results."
(map (λ (job)
(define (build job)
(let* ((name (assq-ref job #:job-name))
(drv (assq-ref job #:derivation))
(eval-id (assq-ref job #:eval-id))
@ -142,7 +142,7 @@ if required."
(pk "kets key:" key "args:" args))))))))
(when (not success?)
(with-output-to-file error-log
(lambda () (display log)))
(λ () (display log)))
(simple-format #t "build failed: ~a\n" error-log))
(let* ((output (and success? (derivation-path->output-path drv)))
(log (if success? (log-file store output) error-log))
@ -153,11 +153,12 @@ if required."
(db-add-build db build)
(simple-format #t "~A\n" output)
build))))
jobs))
(map build jobs))
(define (process-specs db jobspecs)
"Evaluate and build JOBSPECS and store results in DB."
(for-each (λ (spec)
(define (process spec)
(let ((commit (fetch-repository spec))
(stamp (db-get-stamp db spec)))
(unless (string=? commit stamp)
@ -171,4 +172,5 @@ if required."
(set-build-options store #:use-substitutes? #f))
(build-packages store db jobs))))
(db-add-stamp db spec commit)))
jobspecs))
(for-each process jobspecs))