summaryrefslogtreecommitdiff
path: root/guix/discovery.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2019-08-04 13:41:27 +0200
committerMarius Bakke <mbakke@fastmail.com>2019-08-04 13:41:27 +0200
commitf35d3132654bd1be5c7453f9eb43eb6e9de85a15 (patch)
treef62c3a069153d1612a5c270e991eebe43c4f5cae /guix/discovery.scm
parent1dff73acf908125b292de2ab2fc5b25155ad77d8 (diff)
parente920037793faeebf8fb2a918b50a1751b125a0af (diff)
downloadguix-patches-f35d3132654bd1be5c7453f9eb43eb6e9de85a15.tar
guix-patches-f35d3132654bd1be5c7453f9eb43eb6e9de85a15.tar.gz
Merge branch 'master' into staging
Diffstat (limited to 'guix/discovery.scm')
-rw-r--r--guix/discovery.scm8
1 files changed, 5 insertions, 3 deletions
diff --git a/guix/discovery.scm b/guix/discovery.scm
index 468b6c59de..7c5fed7f0e 100644
--- a/guix/discovery.scm
+++ b/guix/discovery.scm
@@ -51,13 +51,15 @@ DIRECTORY is not accessible."
((? symbol? type)
type)))
+ (define (dot-prefixed? file)
+ (string-prefix? "." file))
+
;; Use 'scandir*' so we can avoid an extra 'lstat' for each entry, as
;; opposed to Guile's 'scandir' or 'file-system-fold'.
(fold-right (lambda (entry result)
(match entry
- (("." . _)
- result)
- ((".." . _)
+ (((? dot-prefixed?) . _)
+ ;; Exclude ".", "..", and hidden files such as backups.
result)
((name . properties)
(let ((absolute (string-append directory "/" name)))