aboutsummaryrefslogtreecommitdiff
path: root/scripts/guix-build-coordinator.in
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2021-01-03 10:38:16 +0000
committerChristopher Baines <mail@cbaines.net>2021-01-03 10:38:16 +0000
commitd90f395e814ee74e531cd7f6e5910bc4a095aa54 (patch)
treed3a84a472d48e7e713c9cfe76be778c5f9f607bb /scripts/guix-build-coordinator.in
parent3a921d472ebad0600e58abdc8808125771dfc309 (diff)
downloadbuild-coordinator-d90f395e814ee74e531cd7f6e5910bc4a095aa54.tar
build-coordinator-d90f395e814ee74e531cd7f6e5910bc4a095aa54.tar.gz
Have build list cope with multiple pages
Diffstat (limited to 'scripts/guix-build-coordinator.in')
-rw-r--r--scripts/guix-build-coordinator.in65
1 files changed, 37 insertions, 28 deletions
diff --git a/scripts/guix-build-coordinator.in b/scripts/guix-build-coordinator.in
index da63025..64e38ca 100644
--- a/scripts/guix-build-coordinator.in
+++ b/scripts/guix-build-coordinator.in
@@ -380,18 +380,19 @@ canceled?: ~A
%client-option-defaults
%builds-list-option-defaults)
rest)))
- (let ((response (request-builds-list
- (assq-ref opts 'coordinator)
- #:tags (assq-ref opts 'tags)
- #:not-tags (assq-ref opts 'not-tags)
- #:processed (assq-ref opts 'processed)
- #:canceled (assq-ref opts 'canceled)
- #:after-id (assq-ref opts 'after-id)
- #:limit (assq-ref opts 'limit))))
- (for-each
- (lambda (build-details)
- (simple-format (current-output-port)
- "id: ~A
+ (let loop ((after-id #f))
+ (let ((response (request-builds-list
+ (assq-ref opts 'coordinator)
+ #:tags (assq-ref opts 'tags)
+ #:not-tags (assq-ref opts 'not-tags)
+ #:processed (assq-ref opts 'processed)
+ #:canceled (assq-ref opts 'canceled)
+ #:after-id (or after-id (assq-ref opts 'after-id))
+ #:limit (assq-ref opts 'limit))))
+ (for-each
+ (lambda (build-details)
+ (simple-format (current-output-port)
+ "id: ~A
derivation: ~A
processed: ~A
canceled: ~A
@@ -399,22 +400,30 @@ priority: ~A
tags:
~A
\n"
- (assoc-ref build-details "uuid")
- (assoc-ref build-details "derivation-name")
- (if (assoc-ref build-details "processed")
- "true"
- "false")
- (if (assoc-ref build-details "canceled")
- "true"
- "false")
- (assoc-ref build-details "priority")
- (string-join
- (map (match-lambda
- ((key . val)
- (string-append " " key ": " val)))
- (assoc-ref build-details "tags"))
- "\n")))
- (vector->list (assoc-ref response "builds"))))))
+ (assoc-ref build-details "uuid")
+ (assoc-ref build-details "derivation-name")
+ (if (assoc-ref build-details "processed")
+ "true"
+ "false")
+ (if (assoc-ref build-details "canceled")
+ "true"
+ "false")
+ (assoc-ref build-details "priority")
+ (string-join
+ (map (match-lambda
+ ((key . val)
+ (string-append " " key ": " val)))
+ (assoc-ref build-details "tags"))
+ "\n")))
+ (vector->list (assoc-ref response "builds")))
+
+ (when (= (vector-length (assoc-ref response "builds"))
+ (assq-ref opts 'limit))
+ (loop
+ (assoc-ref (vector-ref
+ (assoc-ref response "builds")
+ (- (vector-length (assoc-ref response "builds")) 1))
+ "uuid")))))))
(("build" "show-blocking" rest ...)
(let ((opts (parse-options %base-options
(append %base-option-defaults