guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/02: Ensure the known and unknown keys appear


From: Christopher Baines
Subject: 02/02: Ensure the known and unknown keys appear
Date: Tue, 9 May 2023 08:48:14 -0400 (EDT)

cbaines pushed a commit to branch master
in repository data-service.

commit bbacbcd2aa712613f5fde0e18c3cab474dd0f6ad
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Tue May 9 13:45:36 2023 +0100

    Ensure the known and unknown keys appear
---
 guix-data-service/model/nar.scm | 30 ++++++++++++++++++++----------
 1 file changed, 20 insertions(+), 10 deletions(-)

diff --git a/guix-data-service/model/nar.scm b/guix-data-service/model/nar.scm
index 61b441a..0e3b3e6 100644
--- a/guix-data-service/model/nar.scm
+++ b/guix-data-service/model/nar.scm
@@ -290,16 +290,26 @@ ORDER BY build_server_id DESC, system, target, 
build_server_id, substitute_known
    (match-lambda
      ((build-server-id . rest)
       (cons build-server-id
-            (group-to-alist
-             (match-lambda
-               ((system target substitute-known? count)
-                (cons `((system . ,system)
-                        (target . ,target))
-                      (cons (if substitute-known?
-                                'known
-                                'unknown)
-                            count))))
-             rest))))
+            (map
+             (lambda (details)
+               ;; Ensure the known and unknown keys appear
+               `(,@details
+                 ,@(if (assq-ref details 'known)
+                       '()
+                       '((known . 0)))
+                 ,@(if (assq-ref details 'unknown)
+                       '()
+                       '((known . 0)))))
+             (group-to-alist
+              (match-lambda
+                ((system target substitute-known? count)
+                 (cons `((system . ,system)
+                         (target . ,target))
+                       (cons (if substitute-known?
+                                 'known
+                                 'unknown)
+                             count))))
+              rest)))))
    (group-to-alist
     ;; Group by build-server-id
     identity



reply via email to

[Prev in Thread] Current Thread [Next in Thread]