From: ericbavier@openmailbox.org
To: guix-devel@gnu.org
Cc: Eric Bavier <bavier@member.fsf.org>
Subject: [PATCH 1/2] utils: Have search-path-as-list pattern search for directories.
Date: Tue, 6 Oct 2015 16:26:16 -0500 [thread overview]
Message-ID: <1444166777-27350-2-git-send-email-ericbavier@openmailbox.org> (raw)
In-Reply-To: <1444166777-27350-1-git-send-email-ericbavier@openmailbox.org>
From: Eric Bavier <bavier@member.fsf.org>
* 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.
---
guix/build/utils.scm | 9 ++++++---
guix/search-paths.scm | 6 ------
2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index 676a012..d4686c0 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -337,10 +337,13 @@ for under the directories designated by FILES. For example:
(append-map (lambda (input)
(append-map (lambda (file)
(let ((file (string-append input "/" file)))
- ;; XXX: By using 'find-files', we implicitly
- ;; assume #:type 'regular.
(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)))
(if (and stat (eq? type (stat:type stat)))
(list file)
diff --git a/guix/search-paths.scm b/guix/search-paths.scm
index 7fd15d4..7a6fe67 100644
--- a/guix/search-paths.scm
+++ b/guix/search-paths.scm
@@ -139,12 +139,6 @@ report only settings not already effective."
(let* ((values (or (and=> (getenv variable)
(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
;; directories (see
;; <http://lists.gnu.org/archive/html/guix-devel/2015-01/msg00269.html>.)
--
2.4.3
next prev parent reply other threads:[~2015-10-07 2:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-06 21:26 [PATCH 0/2] native-search-paths for GHC ericbavier
2015-10-06 21:26 ` ericbavier [this message]
2015-10-06 21:26 ` [PATCH 2/2] gnu: ghc: Add GHC_PACKAGE_PATH native search path ericbavier
2015-10-07 4:44 ` Ian Denhardt
2015-10-16 13:35 ` [PATCH 0/2] native-search-paths for GHC Eric Bavier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1444166777-27350-2-git-send-email-ericbavier@openmailbox.org \
--to=ericbavier@openmailbox.org \
--cc=bavier@member.fsf.org \
--cc=guix-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.