utils: Have search-path-as-list pattern search for directories.
* guix/build/utils.scm (search-path-as-list)[pattern]: Check requested file type. Check pattern against directory names. * guix/search-paths.scm (evaluate-search-paths)[pattern]: Remove symlink hack.
This commit is contained in:
parent
71eb843837
commit
c6e030b2e3
|
@ -385,10 +385,13 @@ for under the directories designated by FILES. For example:
|
||||||
(append-map (lambda (input)
|
(append-map (lambda (input)
|
||||||
(append-map (lambda (file)
|
(append-map (lambda (file)
|
||||||
(let ((file (string-append input "/" file)))
|
(let ((file (string-append input "/" file)))
|
||||||
;; XXX: By using 'find-files', we implicitly
|
|
||||||
;; assume #:type 'regular.
|
|
||||||
(if pattern
|
(if pattern
|
||||||
(find-files file pattern)
|
(find-files file (lambda (file stat)
|
||||||
|
(and stat
|
||||||
|
(eq? type (stat:type stat))
|
||||||
|
((file-name-predicate pattern) file stat)))
|
||||||
|
#:stat stat
|
||||||
|
#:directories? #t)
|
||||||
(let ((stat (stat file #f)))
|
(let ((stat (stat file #f)))
|
||||||
(if (and stat (eq? type (stat:type stat)))
|
(if (and stat (eq? type (stat:type stat)))
|
||||||
(list file)
|
(list file)
|
||||||
|
|
|
@ -139,12 +139,6 @@ report only settings not already effective."
|
||||||
(let* ((values (or (and=> (getenv variable)
|
(let* ((values (or (and=> (getenv variable)
|
||||||
(cut string-tokenize* <> separator))
|
(cut string-tokenize* <> separator))
|
||||||
'()))
|
'()))
|
||||||
;; Add a trailing slash to force symlinks to be treated as
|
|
||||||
;; directories when 'find-files' traverses them.
|
|
||||||
(files (if pattern
|
|
||||||
(map (cut string-append <> "/") files)
|
|
||||||
files))
|
|
||||||
|
|
||||||
;; XXX: Silence 'find-files' when it stumbles upon non-existent
|
;; XXX: Silence 'find-files' when it stumbles upon non-existent
|
||||||
;; directories (see
|
;; directories (see
|
||||||
;; <http://lists.gnu.org/archive/html/guix-devel/2015-01/msg00269.html>.)
|
;; <http://lists.gnu.org/archive/html/guix-devel/2015-01/msg00269.html>.)
|
||||||
|
|
Loading…
Reference in New Issue