GNU bug report logs - #33535
[PATCH] refresh: Account for overlapping updater coverage.

Previous Next

Package: guix-patches;

Reported by: ericbavier <at> centurylink.net

Date: Wed, 28 Nov 2018 02:29:02 UTC

Severity: normal

Tags: patch

Done: Eric Bavier <ericbavier <at> centurylink.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: ericbavier <at> centurylink.net
Subject: bug#33535: closed (Re: [bug#33535] [PATCH] refresh: Account for
 overlapping updater coverage.)
Date: Tue, 11 Dec 2018 05:00:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#33535: [PATCH] refresh: Account for overlapping updater coverage.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 33535 <at> debbugs.gnu.org.

-- 
33535: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=33535
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Eric Bavier <ericbavier <at> centurylink.net>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: 33535-done <at> debbugs.gnu.org
Subject: Re: [bug#33535] [PATCH] refresh: Account for overlapping updater
 coverage.
Date: Mon, 10 Dec 2018 22:59:41 -0600
[Message part 3 (text/plain, inline)]
On Thu, 29 Nov 2018 18:42:38 +0100
ludo <at> gnu.org (Ludovic Courtès) wrote:

> Hello!
> 
> ericbavier <at> centurylink.net skribis:
> 
> > From: Eric Bavier <bavier <at> member.fsf.org>
> >
> > It seams mostly packages covered by both the "hackage" and "stackage"
> > updaters.  And Fribidi is a GNU package but hosted on github.
> >
> > Currently this leads to double-counting while computing total package
> > coverage and a too optimistic result (by about 5.4%).
> >
> > The below patch fixes it by tracking the (un)covered packages directly.  
> 
> Oh, good catch.  LGTM!

Applied in cba7ddcf603455c6692eb50c8bbf203a6bf17ab1

> 
> That also means we’ll have to work on our updaters…  :-)
> 

Yup.  

I have a prototype for an "arch" importer that parses the Archlinux
PKGBUILD files (32% coverage even without any fancy package name
mapping).

I also have a patch to the github updater so that it can update
packages that use git-fetch.  This brings the coverage up to 15.9% from
9.6%.  I think this will be useful if we keep moving packages away from
github's generated tarballs.

`~Eric
[Message part 4 (application/pgp-signature, inline)]
[Message part 5 (message/rfc822, inline)]
From: ericbavier <at> centurylink.net
To: guix-patches <at> gnu.org
Cc: Eric Bavier <bavier <at> member.fsf.org>
Subject: [PATCH] refresh: Account for overlapping updater coverage.
Date: Tue, 27 Nov 2018 20:27:37 -0600
From: Eric Bavier <bavier <at> member.fsf.org>

* guix/scripts/refresh.scm (list-updaters-and-exit): Do not assume updater
predicates are disjoint.  Track covered packages directly.
---
Hello Guix,

Some of our packages are covered by more than one of our updaters:

scheme@(guile-user)> ,use(gnu packages)(guix packages)(guix upstream)
scheme@(guile-user)> ,use(srfi srfi-1)(srfi srfi-26)
scheme@(guile-user)> (define updaters (force (@@ (guix upstream) %updaters)))
scheme@(guile-user)> (define predicates (map upstream-updater-predicate updaters))
scheme@(guile-user)> (define doubles
  (fold-packages
    (lambda (pkg result)
      (if (> (count (cut <> pkg) predicates) 1)
         (cons pkg result)
       result))
    '()))
scheme@(guile-user)> (length doubles)
$1 = 469
scheme@(guile-user)> (map package-name doubles)
$2 = ("agda" "emacs-agda2-mode" "fribidi" "raincat" "ghc-tasty-quickcheck" ... "ghc-hxt")

It seams mostly packages covered by both the "hackage" and "stackage"
updaters.  And Fribidi is a GNU package but hosted on github.

Currently this leads to double-counting while computing total package
coverage and a too optimistic result (by about 5.4%).

The below patch fixes it by tracking the (un)covered packages directly.


 guix/scripts/refresh.scm | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm
index 58fc64db1..f7d2cffb7 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)
-- 
2.19.1




This bug report was last modified 6 years and 162 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.