From mboxrd@z Thu Jan 1 00:00:00 1970 From: ericbavier@openmailbox.org Subject: [PATCH 1/2] utils: Have search-path-as-list pattern search for directories. Date: Tue, 6 Oct 2015 16:26:16 -0500 Message-ID: <1444166777-27350-2-git-send-email-ericbavier@openmailbox.org> References: <1444166777-27350-1-git-send-email-ericbavier@openmailbox.org> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjeKC-0003F2-SM for guix-devel@gnu.org; Tue, 06 Oct 2015 22:19:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZjeKB-0000az-P2 for guix-devel@gnu.org; Tue, 06 Oct 2015 22:19:24 -0400 Received: from smtp3.openmailbox.org ([62.4.1.37]:37781) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjeKB-0000aa-KA for guix-devel@gnu.org; Tue, 06 Oct 2015 22:19:23 -0400 In-Reply-To: <1444166777-27350-1-git-send-email-ericbavier@openmailbox.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org Cc: Eric Bavier From: Eric Bavier * 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 ;; .) -- 2.4.3