summaryrefslogtreecommitdiff
path: root/gnu/packages.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2024-11-25 14:30:28 +0100
committerLudovic Courtès <ludo@gnu.org>2024-12-01 20:14:15 +0100
commit4b5dae8defe4c0d5e98b5ce6abba853007485f23 (patch)
treeaa400c2eb90fc7a7d929f2c25c6daea00705133b /gnu/packages.scm
parenta6334223719bf6b2695d2dc0e75dbfe69e901bd7 (diff)
packages: Factorize ‘all-packages’.
* gnu/packages.scm (all-packages): New procedure. * etc/source-manifest.scm (all-packages): Remove. * guix/scripts/graph.scm (all-packages): Remove. * guix/scripts/refresh.scm (all-packages): Remove. * guix/scripts/weather.scm (all-packages): Remove. Change-Id: I6072952c4b877b541037ce86402cfb7744eeb0a0
Diffstat (limited to 'gnu/packages.scm')
-rw-r--r--gnu/packages.scm20
1 files changed, 19 insertions, 1 deletions
diff --git a/gnu/packages.scm b/gnu/packages.scm
index 80c22d1d7f5..1af3b8d440a 100644
--- a/gnu/packages.scm
+++ b/gnu/packages.scm
@@ -1,5 +1,5 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012-2020, 2022-2023 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2012-2020, 2022-2024 Ludovic Courtès <ludo@gnu.org>
3;;; Copyright © 2013 Mark H Weaver <mhw@netris.org> 3;;; Copyright © 2013 Mark H Weaver <mhw@netris.org>
4;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org> 4;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
5;;; Copyright © 2016, 2017 Alex Kost <alezost@gmail.com> 5;;; Copyright © 2016, 2017 Alex Kost <alezost@gmail.com>
@@ -56,6 +56,7 @@
56 cache-is-authoritative? 56 cache-is-authoritative?
57 57
58 fold-packages 58 fold-packages
59 all-packages
59 fold-available-packages 60 fold-available-packages
60 61
61 find-newest-available-packages 62 find-newest-available-packages
@@ -253,6 +254,23 @@ is guaranteed to never traverse the same package twice."
253 init 254 init
254 modules)) 255 modules))
255 256
257(define all-packages
258 (mlambda ()
259 "Return the list of all public packages, including replacements and hidden
260packages, excluding superseded packages."
261 (delete-duplicates
262 (fold-packages (lambda (package result)
263 (match (package-replacement package)
264 ((? package? replacement)
265 (cons* replacement package result))
266 (#f
267 (cons package result))))
268 '()
269
270 ;; Dismiss deprecated packages but keep hidden packages.
271 #:select? (negate package-superseded))
272 eq?)))
273
256(define %package-cache-file 274(define %package-cache-file
257 ;; Location of the package cache. 275 ;; Location of the package cache.
258 "/lib/guix/package.cache") 276 "/lib/guix/package.cache")