diff mbox series

[bug#49522] weather: Don't look for exported package replacements twice.

Message ID 20210801154534.22051-1-mail@cbaines.net
State Accepted
Headers show
Series [bug#49522] weather: Don't look for exported package replacements twice. | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Christopher Baines Aug. 1, 2021, 3:45 p.m. UTC
* guix/scripts/weather.scm (all-packages): Delete duplicates, so that exported
replacements aren't included twice.
---
 guix/scripts/weather.scm | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

Comments

Ludovic Courtès Sept. 1, 2021, 9:30 p.m. UTC | #1
Hi,

Christopher Baines <mail@cbaines.net> skribis:

> * guix/scripts/weather.scm (all-packages): Delete duplicates, so that exported
> replacements aren't included twice.

LGTM, and apologies for the delay!

Ludo’.
Christopher Baines Sept. 3, 2021, 9:25 a.m. UTC | #2
Ludovic Courtès <ludo@gnu.org> writes:

> Hi,
>
> Christopher Baines <mail@cbaines.net> skribis:
>
>> * guix/scripts/weather.scm (all-packages): Delete duplicates, so that exported
>> replacements aren't included twice.
>
> LGTM, and apologies for the delay!

Great, I've pushed this now as 9540323458de87b0b8aa421e449a4fe27af7c393.
diff mbox series

Patch

diff --git a/guix/scripts/weather.scm b/guix/scripts/weather.scm
index 06312d65a2..60a697d1ac 100644
--- a/guix/scripts/weather.scm
+++ b/guix/scripts/weather.scm
@@ -54,16 +54,18 @@ 
 
 (define (all-packages)
   "Return the list of public packages we are going to query."
-  (fold-packages (lambda (package result)
-                   (match (package-replacement package)
-                     ((? package? replacement)
-                      (cons* replacement package result))
-                     (#f
-                      (cons package result))))
-                 '()
-
-                 ;; Dismiss deprecated packages but keep hidden packages.
-                 #:select? (negate package-superseded)))
+  (delete-duplicates
+   (fold-packages (lambda (package result)
+                    (match (package-replacement package)
+                      ((? package? replacement)
+                       (cons* replacement package result))
+                      (#f
+                       (cons package result))))
+                  '()
+
+                  ;; Dismiss deprecated packages but keep hidden packages.
+                  #:select? (negate package-superseded))
+   eq?))
 
 (define (call-with-progress-reporter reporter proc)
   "This is a variant of 'call-with-progress-reporter' that works with monadic