summaryrefslogtreecommitdiff
path: root/guix/discovery.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2019-07-31 14:28:56 +0200
committerMarius Bakke <mbakke@fastmail.com>2019-07-31 14:28:56 +0200
commit6a2e54236e1b2c428c8fd478ee0f3bd8130703fa (patch)
treeaf70155a2f474d35d90d003f8584b2d9ee0bbaa8 /guix/discovery.scm
parent2cf1e37c109c8d03fae75bc84f7012f3afa956e5 (diff)
parent3d88855dfdcc4c8ce11f494fdf9f0ac1d8eef530 (diff)
downloadguix-patches-6a2e54236e1b2c428c8fd478ee0f3bd8130703fa.tar
guix-patches-6a2e54236e1b2c428c8fd478ee0f3bd8130703fa.tar.gz
Merge branch 'master' into core-updates
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)))