guix-commits
[Top][All Lists]
Advanced

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

01/06: Include package details for the package derivation outputs JSON


From: Christopher Baines
Subject: 01/06: Include package details for the package derivation outputs JSON
Date: Tue, 13 Oct 2020 15:18:02 -0400 (EDT)

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

commit f15dc5ab0b48f4228a3c545052a1e4daf3e80f15
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Tue Oct 13 18:51:21 2020 +0100

    Include package details for the package derivation outputs JSON
    
    So it's easier to match the output back to the package.
---
 guix-data-service/model/derivation.scm        | 11 ++++++++---
 guix-data-service/web/revision/controller.scm |  9 ++++++---
 guix-data-service/web/revision/html.scm       |  3 ++-
 3 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/guix-data-service/model/derivation.scm 
b/guix-data-service/model/derivation.scm
index c18b548..6ec0266 100644
--- a/guix-data-service/model/derivation.scm
+++ b/guix-data-service/model/derivation.scm
@@ -463,7 +463,9 @@ ORDER BY derivations.file_name
   (define query
     (string-append
      "
-SELECT derivation_output_details.path,
+SELECT packages.name,
+       packages.version,
+       derivation_output_details.path,
        derivation_output_details.hash_algorithm,
        derivation_output_details.hash,
        derivation_output_details.recursive,
@@ -599,8 +601,11 @@ ORDER BY derivation_output_details.path
          "")))
 
   (map (match-lambda
-         ((path hash_algorithm hash recursive nars_json)
-          (list path
+         ((package_name package_version
+                        path hash_algorithm hash recursive nars_json)
+          (list package_name
+                package_version
+                path
                 hash
                 hash_algorithm
                 (string=? recursive "t")
diff --git a/guix-data-service/web/revision/controller.scm 
b/guix-data-service/web/revision/controller.scm
index a67c2df..9bedb4e 100644
--- a/guix-data-service/web/revision/controller.scm
+++ b/guix-data-service/web/revision/controller.scm
@@ -1127,9 +1127,12 @@
                 `((store_paths
                    . ,(list->vector
                        (map (match-lambda
-                              ((path hash-algorithm hash recursive
-                                     nars)
-                               `((path . ,path)
+                              ((package-name package-version
+                                             path hash-algorithm hash recursive
+                                             nars)
+                               `((package . ((name    . ,package-name)
+                                             (version . ,package-version)))
+                                 (path . ,path)
                                  (data
                                   . ,(if (null? hash-algorithm)
                                          (list->vector
diff --git a/guix-data-service/web/revision/html.scm 
b/guix-data-service/web/revision/html.scm
index b72dd9f..0e7a389 100644
--- a/guix-data-service/web/revision/html.scm
+++ b/guix-data-service/web/revision/html.scm
@@ -1790,7 +1790,8 @@ figure {
          (tbody
           ,@(map
              (match-lambda
-               ((path hash-algorithm hash recursive nars)
+               ((package-name package-version
+                              path hash-algorithm hash recursive nars)
                 `(tr
                   (td (a (@ (href ,path))
                          ,(display-store-item-short path)))



reply via email to

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