diff options
author | Christopher Baines <mail@cbaines.net> | 2023-05-02 16:15:08 +0200 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2023-05-02 16:41:11 +0200 |
commit | e7dec01910cfcd1bf9f6735e20af12393f2128a9 (patch) | |
tree | c3428050a4cb50e3d416e9475251d044f4a18717 /scripts | |
parent | d0f9ad21854ba01039b1f7c964a0d45cc06b3644 (diff) | |
download | build-coordinator-e7dec01910cfcd1bf9f6735e20af12393f2128a9.tar build-coordinator-e7dec01910cfcd1bf9f6735e20af12393f2128a9.tar.gz |
Support the ignore-if-build-required-by-another option
For cancelling builds.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/guix-build-coordinator.in | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/scripts/guix-build-coordinator.in b/scripts/guix-build-coordinator.in index f873b2c..bc94f53 100644 --- a/scripts/guix-build-coordinator.in +++ b/scripts/guix-build-coordinator.in @@ -286,13 +286,19 @@ (lambda (opt name _ result) (alist-cons 'skip-updating-derived-priorities #t + result))) + (option '("ignore-if-build-required-by-another") #t #f + (lambda (opt name arg result) + (alist-cons 'ignore-if-build-required-by-another + (string=? arg "true") result))))) (define %build-cancel-option-defaults `((tags . ()) (not-tags . ()) (systems . ()) - (not-systems . ()))) + (not-systems . ()) + (ignore-if-build-required-by-another . #t))) (define %build-update-priority-options (cons* (option '("new-priority") #t #f @@ -646,21 +652,28 @@ tags: count) (current-error-port)) (lambda (report) - (for-each (lambda (id) - (send-cancel-build-request - (assq-ref opts 'coordinator) - id - #:skip-updating-derived-priorities? - (assq-ref opts 'skip-updating-derived-priorities)) - (report)) - matching-builds))) + (for-each + (lambda (id) + (send-cancel-build-request + (assq-ref opts 'coordinator) + id + #:skip-updating-derived-priorities? + (assq-ref opts 'skip-updating-derived-priorities) + #:ignore-if-build-required-by-another? + (assq-ref + opts 'ignore-if-build-required-by-another)) + (report)) + matching-builds))) (loop (get-batch))))))) ((build-id) (send-cancel-build-request (assq-ref opts 'coordinator) build-id #:skip-updating-derived-priorities? - (assq-ref opts 'skip-updating-derived-priorities)))))) + (assq-ref opts 'skip-updating-derived-priorities) + #:ignore-if-build-required-by-another? + (assq-ref + opts 'ignore-if-build-required-by-another)))))) (("build" "update-priority" rest ...) (let ((opts (parse-options (append %client-options %base-options |