guix-commits
[Top][All Lists]
Advanced

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

branch master updated: Include some useful numbers on the package deriva


From: Christopher Baines
Subject: branch master updated: Include some useful numbers on the package derivations comparison
Date: Wed, 15 Feb 2023 10:49:29 -0500

This is an automated email from the git hooks/post-receive script.

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

The following commit(s) were added to refs/heads/master by this push:
     new f68822c  Include some useful numbers on the package derivations 
comparison
f68822c is described below

commit f68822cad2f8cd5cbef06aad4e4570bb8afcf725
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Wed Feb 15 15:48:45 2023 +0000

    Include some useful numbers on the package derivations comparison
    
    As it's frequently useful to know how many packages/builds some change has
    affected.
---
 guix-data-service/web/compare/html.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/guix-data-service/web/compare/html.scm 
b/guix-data-service/web/compare/html.scm
index 17272e3..58fb514 100644
--- a/guix-data-service/web/compare/html.scm
+++ b/guix-data-service/web/compare/html.scm
@@ -18,10 +18,12 @@
 (define-module (guix-data-service web compare html)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-19)
+  #:use-module (srfi srfi-43)
   #:use-module (ice-9 match)
   #:use-module (ice-9 vlist)
   #:use-module (texinfo)
   #:use-module (texinfo html)
+  #:use-module (guix-data-service utils)
   #:use-module (guix-data-service web query-parameters)
   #:use-module (guix-data-service web util)
   #:use-module (guix-data-service web html-utils)
@@ -842,6 +844,33 @@ enough builds to determine a change")))
        (div
         (@ (class "col-sm-12"))
         (h1 ,page-header)
+        ,@(if (not (null? derivation-changes))
+              (match (vector-fold
+                      (lambda (_ result change)
+                        (match result
+                          ((names . new-drvs-count)
+                           (let ((count
+                                  (or
+                                   (and=> (assq-ref change 'target)
+                                          vector-length)
+                                   0)))
+                             (cons
+                              (if (= 0 count)
+                                  names
+                                  (cons (assq-ref change 'name)
+                                        names))
+                              (+ new-drvs-count count))))))
+                      (cons '() 0)
+                      derivation-changes)
+                ((names . new-drvs-count)
+                 (let ((distinct-packages
+                        (length
+                         (delete-duplicates/sort! names string<?))))
+                   `((p
+                      ,(simple-format #f "Showing ~A new derivations across ~A 
packages"
+                                      new-drvs-count
+                                      distinct-packages))))))
+              '())
         ,(if
           (null? derivation-changes)
           '(p "No derivation changes")



reply via email to

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