From 6d2c124d48da367832bbff5a68758b94c10314bb Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 18 Feb 2021 18:59:05 +0000 Subject: Stop hardcoding hook names in the argument processing --- scripts/guix-build-coordinator.in | 13 ++++++------- 1 file 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 -- cgit v1.2.3