[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/10: discovery: 'scheme-files' ignores hidden files.
From: |
guix-commits |
Subject: |
01/10: discovery: 'scheme-files' ignores hidden files. |
Date: |
Fri, 26 Jul 2019 19:06:05 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 548e0af4da4e2e9311bc696831a80eedbc5b5798
Author: Ludovic Courtès <address@hidden>
Date: Fri Jul 26 21:49:25 2019 +0200
discovery: 'scheme-files' ignores hidden files.
* guix/discovery.scm (scheme-files)[dot-prefixed?]: New procedure.
Use it to exclude any file starting with ".".
---
guix/discovery.scm | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/guix/discovery.scm b/guix/discovery.scm
index 468b6c5..7c5fed7 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)))
- branch master updated (d23a00b -> 4b03565), guix-commits, 2019/07/26
- 01/10: discovery: 'scheme-files' ignores hidden files.,
guix-commits <=
- 02/10: gexp: 'compiled-modules' can cross-compile., guix-commits, 2019/07/26
- 04/10: gnu: Add emacs-bug-hunter., guix-commits, 2019/07/26
- 03/10: gexp: 'program-file' honors the current system and cross-compilation target., guix-commits, 2019/07/26
- 08/10: gnu: Add emacs-wc-mode., guix-commits, 2019/07/26
- 10/10: gnu: hpcguix-web: Update to f39c90b., guix-commits, 2019/07/26
- 09/10: gnu: Add emacs-mastodon., guix-commits, 2019/07/26
- 05/10: Add emacs-gnus-alias., guix-commits, 2019/07/26
- 07/10: gnu: Add emacs-ox-pandoc., guix-commits, 2019/07/26
- 06/10: gnu: Add emacs-ox-epub., guix-commits, 2019/07/26