summaryrefslogtreecommitdiff
path: root/guix/build
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-04-01 15:43:54 +0200
committerLudovic Courtès <ludo@gnu.org>2015-04-01 15:43:54 +0200
commit4ba3a84d07168f85f13984e6bd143afc4b70a319 (patch)
tree80ee819adc2e8927cebf24897e0f40b88c9e077d /guix/build
parent8ff3df5baa061d1de4fb999921a7db33bcbeb2ff (diff)
downloadgnu-guix-4ba3a84d07168f85f13984e6bd143afc4b70a319.tar
gnu-guix-4ba3a84d07168f85f13984e6bd143afc4b70a319.tar.gz
utils: Make the second 'find-files' argument optional.
* guix/build/utils.scm (find-files): Make 'pred' optional.
Diffstat (limited to 'guix/build')
-rw-r--r--guix/build/utils.scm7
1 files changed, 4 insertions, 3 deletions
diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index 74165c717f..5d229b5f83 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -273,11 +273,12 @@ name matches REGEXP."
(lambda (file stat)
(regexp-exec file-rx (basename file)))))
-(define (find-files dir pred)
+(define* (find-files dir #:optional (pred (const #t)))
"Return the lexicographically sorted list of files under DIR for which PRED
returns true. PRED is passed two arguments: the absolute file name, and its
-stat buffer. PRED can also be a regular expression, in which case it is
-equivalent to (file-name-predicate PRED)."
+stat buffer; the default predicate always returns true. PRED can also be a
+regular expression, in which case it is equivalent to (file-name-predicate
+PRED)."
(let ((pred (if (procedure? pred)
pred
(file-name-predicate pred))))