guix-commits
[Top][All Lists]
Advanced

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

02/02: weather: Call lookup-narinfos with a custom progress reporter.


From: guix-commits
Subject: 02/02: weather: Call lookup-narinfos with a custom progress reporter.
Date: Tue, 9 Mar 2021 15:21:27 -0500 (EST)

cbaines pushed a commit to branch master
in repository guix.

commit f5ffb3bd9cd59cfff5b4625d6d65e8d116d0a25b
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Wed Feb 24 19:28:05 2021 +0000

    weather: Call lookup-narinfos with a custom progress reporter.
    
    This means there's a useful progress bar when running guix weather.
    
    * guix/scripts/weather.scm (report-server-coverage): Pass
     #:make-progress-reporter to lookup-narinfos.
---
 guix/scripts/weather.scm | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/guix/scripts/weather.scm b/guix/scripts/weather.scm
index 9e94bff..26ec543 100644
--- a/guix/scripts/weather.scm
+++ b/guix/scripts/weather.scm
@@ -181,7 +181,11 @@ Return the coverage ratio, an exact number between 0 and 
1."
   (format #t (G_ "looking for ~h store items on ~a...~%")
           (length items) server)
 
-  (let/time ((time narinfos (lookup-narinfos server items)))
+  (let/time ((time narinfos (lookup-narinfos
+                             server items
+                             #:make-progress-reporter
+                             (lambda* (total #:key url #:allow-other-keys)
+                               (progress-reporter/bar total)))))
     (format #t "~a~%" server)
     (let ((obtained  (length narinfos))
           (requested (length items))



reply via email to

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