packages: 'fold-packages' takes #:select? parameter.
* gnu/packages.scm (fold-packages): Add #:select? parameter and honor it.
This commit is contained in:
parent
c9405c461b
commit
96dc8f3527
|
@ -142,13 +142,13 @@ for system '~a'")
|
||||||
|
|
||||||
(define* (fold-packages proc init
|
(define* (fold-packages proc init
|
||||||
#:optional
|
#:optional
|
||||||
(modules (all-modules (%package-module-path))))
|
(modules (all-modules (%package-module-path)))
|
||||||
|
#:key (select? (negate hidden-package?)))
|
||||||
"Call (PROC PACKAGE RESULT) for each available package defined in one of
|
"Call (PROC PACKAGE RESULT) for each available package defined in one of
|
||||||
MODULES, using INIT as the initial value of RESULT. It is guaranteed to never
|
MODULES that matches SELECT?, using INIT as the initial value of RESULT. It
|
||||||
traverse the same package twice."
|
is guaranteed to never traverse the same package twice."
|
||||||
(fold-module-public-variables (lambda (object result)
|
(fold-module-public-variables (lambda (object result)
|
||||||
(if (and (package? object)
|
(if (and (package? object) (select? object))
|
||||||
(not (hidden-package? object)))
|
|
||||||
(proc object result)
|
(proc object result)
|
||||||
result))
|
result))
|
||||||
init
|
init
|
||||||
|
|
Loading…
Reference in New Issue