summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-11-22 17:52:37 +0100
committerLudovic Courtès <ludo@gnu.org>2015-11-22 17:52:37 +0100
commit8871eb5441b2e09c5d8ca02165d4aca08c8e233d (patch)
tree5ee66cd06e760a2569f66fe0821a200870c2669e
parent1d4f47e2196d6f113000759b00860a74bfccd732 (diff)
downloadguix-artwork-8871eb5441b2e09c5d8ca02165d4aca08c8e233d.tar
guix-artwork-8871eb5441b2e09c5d8ca02165d4aca08c8e233d.tar.gz
website: issues: Show a progress report.
* website/www/packages.scm (packages->issue-sxml)[total, processed]: New variables. [report-progress]: New procedure. Use it.
-rw-r--r--website/www/packages.scm10
1 files changed, 10 insertions, 0 deletions
diff --git a/website/www/packages.scm b/website/www/packages.scm
index caf54dd..f562366 100644
--- a/website/www/packages.scm
+++ b/website/www/packages.scm
@@ -37,6 +37,7 @@
#:use-module (web uri)
#:use-module (ice-9 match)
#:use-module (ice-9 i18n)
+ #:use-module (ice-9 format)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-19)
#:use-module (srfi srfi-26)
@@ -341,8 +342,17 @@ by CHECKERS."
(define* (packages->issue-sxml packages #:key (checkers %issue-checkers))
"Return an SXML tree representing the reports generated by CHECKERS for
PACKAGES."
+ (define total (length packages))
+ (define processed 0)
+ (define (report-progress)
+ (format (current-error-port) "~5,1f% of all the packages linted\r"
+ (* 100. (/ processed total)))
+ (force-output (current-error-port))
+ (set! processed (+ 1 processed)))
+
`(table
,@(map (lambda (package)
+ (report-progress)
(package->issue-sxml package #:checkers checkers))
packages)))