aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Bavier <bavier@member.fsf.org>2018-11-27 19:56:01 -0600
committerEric Bavier <bavier@member.fsf.org>2018-12-10 19:59:01 -0600
commitcba7ddcf603455c6692eb50c8bbf203a6bf17ab1 (patch)
tree6f4158ed6bafcf0326d913cf631a367309bcfa66
parent59c9d4f1085fbff6a5ca2c2d4123dc22f6b82356 (diff)
downloadpatches-cba7ddcf603455c6692eb50c8bbf203a6bf17ab1.tar
patches-cba7ddcf603455c6692eb50c8bbf203a6bf17ab1.tar.gz
refresh: Account for overlapping updater coverage.
* guix/scripts/refresh.scm (list-updaters-and-exit): Do not assume updater predicates are disjoint. Track covered packages directly.
-rw-r--r--guix/scripts/refresh.scm16
1 files changed, 8 insertions, 8 deletions
diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm
index 60e822b16b..1d86f949c8 100644
--- a/guix/scripts/refresh.scm
+++ b/guix/scripts/refresh.scm
@@ -179,24 +179,24 @@ specified with `--select'.\n"))
(let* ((packages (fold-packages cons '()))
(total (length packages)))
- (define covered
- (fold (lambda (updater covered)
- (let ((matches (count (upstream-updater-predicate updater)
- packages)))
+ (define uncovered
+ (fold (lambda (updater uncovered)
+ (let ((matches (filter (upstream-updater-predicate updater)
+ packages)))
;; TRANSLATORS: The parenthetical expression here is rendered
;; like "(42% coverage)" and denotes the fraction of packages
;; covered by the given updater.
(format #t (G_ " - ~a: ~a (~2,1f% coverage)~%")
(upstream-updater-name updater)
(G_ (upstream-updater-description updater))
- (* 100. (/ matches total)))
- (+ covered matches)))
- 0
+ (* 100. (/ (length matches) total)))
+ (lset-difference eq? uncovered matches)))
+ packages
(force %updaters)))
(newline)
(format #t (G_ "~2,1f% of the packages are covered by these updaters.~%")
- (* 100. (/ covered total))))
+ (* 100. (/ (- total (length uncovered)) total))))
(exit 0))
(define (warn-no-updater package)