summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-01-03 19:46:07 +0100
committerLudovic Courtès <ludo@gnu.org>2015-01-03 19:46:07 +0100
commitcf81a2363989429f4af518e92e7404655d45dbc7 (patch)
tree9f1ea0289f3d55aca2d127637c19b79b4346689a /guix
parent7452806931216a5ec8712dd39327540a3307a6ce (diff)
guix package: Follow symlinks for pattern search paths.
* guix/scripts/package.scm (search-path-environment-variables): Add local 'files' variable. * tests/packages.scm ("--search-paths with pattern"): New test.
Diffstat (limited to 'guix')
-rw-r--r--guix/scripts/package.scm17
1 files changed, 11 insertions, 6 deletions
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index 2f694cd55f..30b0658198 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -365,12 +365,17 @@ current settings and report only settings not already effective."
(match-lambda
(($ <search-path-specification> variable files separator
type pattern)
- (let ((values (or (and=> (getenv variable)
- (cut string-tokenize* <> separator))
- '()))
- (path (search-path-as-list files (list profile)
- #:type type
- #:pattern pattern)))
+ (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))
+ (path (search-path-as-list files (list profile)
+ #:type type
+ #:pattern pattern)))
(if (every (cut member <> values) path)
#f
(format #f "export ~a=\"~a\""