summaryrefslogtreecommitdiff
path: root/gnu/packages.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages.scm')
-rw-r--r--gnu/packages.scm31
1 files changed, 15 insertions, 16 deletions
diff --git a/gnu/packages.scm b/gnu/packages.scm
index ec2473422f4..0aa289d56c0 100644
--- a/gnu/packages.scm
+++ b/gnu/packages.scm
@@ -235,28 +235,27 @@ decreasing version order."
235 matching))))) 235 matching)))))
236 236
237(define find-newest-available-packages 237(define find-newest-available-packages
238 (memoize 238 (mlambda ()
239 (lambda () 239 "Return a vhash keyed by package names, and with
240 "Return a vhash keyed by package names, and with
241associated values of the form 240associated values of the form
242 241
243 (newest-version newest-package ...) 242 (newest-version newest-package ...)
244 243
245where the preferred package is listed first." 244where the preferred package is listed first."
246 245
247 ;; FIXME: Currently, the preferred package is whichever one 246 ;; FIXME: Currently, the preferred package is whichever one
248 ;; was found last by 'fold-packages'. Find a better solution. 247 ;; was found last by 'fold-packages'. Find a better solution.
249 (fold-packages (lambda (p r) 248 (fold-packages (lambda (p r)
250 (let ((name (package-name p)) 249 (let ((name (package-name p))
251 (version (package-version p))) 250 (version (package-version p)))
252 (match (vhash-assoc name r) 251 (match (vhash-assoc name r)
253 ((_ newest-so-far . pkgs) 252 ((_ newest-so-far . pkgs)
254 (case (version-compare version newest-so-far) 253 (case (version-compare version newest-so-far)
255 ((>) (vhash-cons name `(,version ,p) r)) 254 ((>) (vhash-cons name `(,version ,p) r))
256 ((=) (vhash-cons name `(,version ,p ,@pkgs) r)) 255 ((=) (vhash-cons name `(,version ,p ,@pkgs) r))
257 ((<) r))) 256 ((<) r)))
258 (#f (vhash-cons name `(,version ,p) r))))) 257 (#f (vhash-cons name `(,version ,p) r)))))
259 vlist-null)))) 258 vlist-null)))
260 259
261(define (find-best-packages-by-name name version) 260(define (find-best-packages-by-name name version)
262 "If version is #f, return the list of packages named NAME with the highest 261 "If version is #f, return the list of packages named NAME with the highest