me
/
guix
Archived
1
0
Fork 0

pull: Speed up the new/upgraded package computation.

* guix/scripts/pull.scm (new/upgraded-packages): OLD no longer stores
all the versions of each package.  Remove 'vhash-fold*' call and reduce
the number of 'version>?' calls when computing UPGRADED.
master
Ludovic Courtès 2019-02-12 22:51:23 +01:00
parent cf0eacceb4
commit 201253674b
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 11 additions and 6 deletions

View File

@ -353,7 +353,13 @@ pairs, and return two values: the list of packages new in ALIST2, and the list
of packages upgraded in ALIST2." of packages upgraded in ALIST2."
(let* ((old (fold (match-lambda* (let* ((old (fold (match-lambda*
(((name . version) table) (((name . version) table)
(vhash-cons name version table))) (match (vhash-assoc name table)
(#f
(vhash-cons name version table))
((_ . previous-version)
(if (version>? version previous-version)
(vhash-cons name version table)
table)))))
vlist-null vlist-null
alist1)) alist1))
(new (remove (match-lambda (new (remove (match-lambda
@ -362,11 +368,10 @@ of packages upgraded in ALIST2."
alist2)) alist2))
(upgraded (filter-map (match-lambda (upgraded (filter-map (match-lambda
((name . new-version) ((name . new-version)
(match (vhash-fold* cons '() name old) (match (vhash-assoc name old)
(() #f) (#f #f)
((= (cut sort <> version>?) old-versions) ((_ . old-version)
(and (version>? new-version (and (version>? new-version old-version)
(first old-versions))
(string-append name "@" (string-append name "@"
new-version)))))) new-version))))))
alist2))) alist2)))