diff options
author | Christopher Baines <mail@cbaines.net> | 2021-02-18 18:59:05 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2021-02-18 18:59:05 +0000 |
commit | 6d2c124d48da367832bbff5a68758b94c10314bb (patch) | |
tree | 8ce3cbaa64c643451b20c9e5cbcc9eb6d573667a | |
parent | c72d2a172fafa591da3b73274ed70723d5fbf360 (diff) | |
download | build-coordinator-6d2c124d48da367832bbff5a68758b94c10314bb.tar build-coordinator-6d2c124d48da367832bbff5a68758b94c10314bb.tar.gz |
Stop hardcoding hook names in the argument processing
-rw-r--r-- | scripts/guix-build-coordinator.in | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/scripts/guix-build-coordinator.in b/scripts/guix-build-coordinator.in index 3992c6f..f40dc01 100644 --- a/scripts/guix-build-coordinator.in +++ b/scripts/guix-build-coordinator.in @@ -760,13 +760,12 @@ tags: (datastore (database-uri->datastore (assq-ref opts 'database) #:metrics-registry metrics-registry)) - (hooks - `((build-submitted . ,(assq-ref opts 'build-submitted-hook)) - (build-canceled . ,(assq-ref opts 'build-canceled-hook)) - (build-started . ,(assq-ref opts 'build-started-hook)) - (build-success . ,(assq-ref opts 'build-success-hook)) - (build-failure . ,(assq-ref opts 'build-failure-hook)) - (build-missing-inputs . ,(assq-ref opts 'build-missing-inputs-hook)))) + (hooks (filter-map + (lambda (name) + (and=> (assq-ref opts name) + (lambda (value) + (cons name value)))) + %known-hooks)) (hooks-with-defaults `(,@(filter cdr hooks) ,@(remove (match-lambda |