aboutsummaryrefslogtreecommitdiff
path: root/bin/cuirass.in
diff options
context:
space:
mode:
Diffstat (limited to 'bin/cuirass.in')
-rw-r--r--bin/cuirass.in32
1 files changed, 18 insertions, 14 deletions
diff --git a/bin/cuirass.in b/bin/cuirass.in
index 5aa53c4..d0cd84a 100644
--- a/bin/cuirass.in
+++ b/bin/cuirass.in
@@ -90,9 +90,10 @@ if required."
(string-append "'" (object->string spec))))
(jobs (read port)))
(close-pipe port)
- (map (λ (job)
- (acons #:id (db-add-evaluation db job) job))
- jobs)))
+ ;; Keep track of SPEC id in the returned jobs.
+ (let ((spec-id (assq-ref spec #:id)))
+ (map (λ (job) (acons #:spec-id spec-id job))
+ jobs))))
(define (build-packages store db jobs)
"Build JOBS which is a list of <job> objects."
@@ -104,23 +105,26 @@ if required."
(format #t "building ~A...~%" drv)
(parameterize ((current-build-output-port log-port))
(build-derivations store (list drv))
- (db-add-build-log db job log-port)
+ ;; XXX: 'Builds' database table is not implemented yet.
+ ;; (db-add-build-log db job log-port)
(close-port log-port))
(format #t "~A~%" (derivation-path->output-path drv))))
jobs))
-(define (process-spec db spec)
- "Evaluate and build SPEC"
- (fetch-repository spec)
- (compile (string-append (%package-cachedir) "/" (assq-ref spec #:name)))
- (with-store store
- (let ((jobs (evaluate store db spec)))
- (set-build-options store #:use-substitutes? #f)
- (build-packages store db jobs))))
-
(define (process-specs db jobspecs)
"Evaluate and build JOBSPECS and store results in DB."
- (for-each (λ (spec) (process-spec db spec)) jobspecs))
+ (for-each (λ (spec)
+ (fetch-repository spec)
+ (compile (string-append (%package-cachedir) "/"
+ (assq-ref spec #:name)))
+ (with-store store
+ (let* ((id (db-add-specification db spec))
+ (spec* (acons #:id id spec))
+ (jobs (evaluate store db spec*)))
+ (db-add-evaluation db jobs)
+ (set-build-options store #:use-substitutes? #f)
+ (build-packages store db jobs))))
+ jobspecs))
;;;