summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-11-06 23:21:08 +0100
committerLudovic Courtès <ludo@gnu.org>2017-11-07 00:12:10 +0100
commit96dc8f3527a6ac0c84b51f7a0cac1d8052cf0e72 (patch)
tree2bbd73d09e9e552d12ec5d66566fc53670022eac /gnu
parentc9405c461b1b37740bc0bb33c7043313978c0014 (diff)
downloadguix-96dc8f3527a6ac0c84b51f7a0cac1d8052cf0e72.tar.gz
packages: 'fold-packages' takes #:select? parameter.
* gnu/packages.scm (fold-packages): Add #:select? parameter and honor it.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages.scm10
1 files changed, 5 insertions, 5 deletions
diff --git a/gnu/packages.scm b/gnu/packages.scm
index b4ac6661ca..97e6cb347f 100644
--- a/gnu/packages.scm
+++ b/gnu/packages.scm
@@ -142,13 +142,13 @@ for system '~a'")
 
 (define* (fold-packages proc init
                         #: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
-MODULES, using INIT as the initial value of RESULT.  It is guaranteed to never
-traverse the same package twice."
+MODULES that matches SELECT?, using INIT as the initial value of RESULT.  It
+is guaranteed to never traverse the same package twice."
   (fold-module-public-variables (lambda (object result)
-                                  (if (and (package? object)
-                                           (not (hidden-package? object)))
+                                  (if (and (package? object) (select? object))
                                       (proc object result)
                                       result))
                                 init