summaryrefslogtreecommitdiff
path: root/guix/scripts
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-01-16 13:27:03 +0100
committerLudovic Courtès <ludo@gnu.org>2015-01-16 13:27:03 +0100
commit57b7e1a62d2269bfd9d37f88bae92c829222f8fc (patch)
tree5e6395e08025eb80de2040d77ac6febb558d2a72 /guix/scripts
parent72b703cdcaec260733a4e30800cef5eab3f071a6 (diff)
parentb01a0ba86e93012044f42c41ba5cbc7d7936c356 (diff)
Merge branch 'core-updates'
Conflicts: gnu/packages/bootstrap.scm
Diffstat (limited to 'guix/scripts')
-rw-r--r--guix/scripts/environment.scm8
-rw-r--r--guix/scripts/package.scm28
2 files changed, 20 insertions, 16 deletions
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index af196036d5..ffa3a09799 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -45,17 +45,15 @@ path value is appended."
(($ <search-path-specification>
variable directories separator)
(let* ((current (getenv variable))
- (path ((@@ (guix build utils) search-path-as-list)
- directories paths))
- (value (list->search-path-as-string path separator)))
+ (path (search-path-as-list directories paths))
+ (value (list->search-path-as-string path separator)))
(proc variable
(if (and current (not pure?))
(string-append value separator current)
value)))))
(cons* (search-path-specification
(variable "PATH")
- (directories '("bin" "sbin"))
- (separator ":"))
+ (files '("bin" "sbin")))
(delete-duplicates
(append-map package-native-search-paths inputs))))))
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index 21dc66cb75..30b0658198 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -29,7 +29,8 @@
#:use-module (guix utils)
#:use-module (guix config)
#:use-module (guix scripts build)
- #:use-module ((guix build utils) #:select (directory-exists? mkdir-p))
+ #:use-module ((guix build utils)
+ #:select (directory-exists? mkdir-p search-path-as-list))
#:use-module (ice-9 format)
#:use-module (ice-9 match)
#:use-module (ice-9 regex)
@@ -362,19 +363,24 @@ current settings and report only settings not already effective."
(define search-path-definition
(match-lambda
- (($ <search-path-specification> variable directories separator)
- (let ((values (or (and=> (getenv variable)
- (cut string-tokenize* <> separator))
- '()))
- (directories (filter file-exists?
- (map (cut string-append profile
- "/" <>)
- directories))))
- (if (every (cut member <> values) directories)
+ (($ <search-path-specification> variable files separator
+ type 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\""
variable
- (string-join directories separator)))))))
+ (string-join path separator)))))))
(let* ((packages (filter-map manifest-entry->package entries))
(search-paths (delete-duplicates