diff options
author | Christopher Baines <mail@cbaines.net> | 2020-04-13 12:44:07 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2020-04-13 12:44:07 +0100 |
commit | 9263f271f5ddaae3dc8c01ddb73910a66937d721 (patch) | |
tree | 539b8f75a764cb9d8ccef5f6edc319112eaf85c2 /guix-build-coordinator | |
parent | b4b062bf1480a3fbf4ead37d95250e54c1ea24f3 (diff) | |
download | build-coordinator-9263f271f5ddaae3dc8c01ddb73910a66937d721.tar build-coordinator-9263f271f5ddaae3dc8c01ddb73910a66937d721.tar.gz |
Add datastore-find-build-output
Diffstat (limited to 'guix-build-coordinator')
-rw-r--r-- | guix-build-coordinator/datastore.scm | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/guix-build-coordinator/datastore.scm b/guix-build-coordinator/datastore.scm index 7907e13..10131e7 100644 --- a/guix-build-coordinator/datastore.scm +++ b/guix-build-coordinator/datastore.scm @@ -1,4 +1,5 @@ (define-module (guix-build-coordinator datastore) + #:use-module (srfi srfi-1) #:use-module (oop goops) #:duplicates (merge-generics) #:use-module (guix-build-coordinator datastore abstract) @@ -19,7 +20,8 @@ datastore-replace-build-allocation-plan datastore-allocate-builds-to-agent datastore-list-allocation-plan-builds) - #:export (database-uri->datastore)) + #:export (database-uri->datastore + datastore-find-build-output)) (define (database-uri->datastore database) (cond @@ -30,3 +32,13 @@ (else (error (simple-format #f "Unknown database ~A" database))))) + +(define (datastore-find-build-output datastore build-id output-name) + (let* ((build (datastore-find-build datastore build-id)) + (outputs (datastore-find-derivation-outputs + datastore + (assq-ref build 'derivation-name)))) + (any (lambda (output) + (when (string=? (assq-ref output 'name) output-name) + (assq-ref output 'output))) + outputs))) |