summaryrefslogtreecommitdiff
path: root/guix/build/utils.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-07-09 22:17:18 +0200
committerLudovic Courtès <ludo@gnu.org>2013-07-09 22:17:18 +0200
commitc769406010156190c76c435c90d5f08ae56c2ca4 (patch)
tree1088a364c987cc6e7dc0bea4918cb498b34649b5 /guix/build/utils.scm
parentee48b283fadca825ca08500eeb3870fd4141221e (diff)
parent91ef73d4642658829facee25ffdc91a48d6ccf73 (diff)
Merge branch 'core-updates'
Diffstat (limited to 'guix/build/utils.scm')
-rw-r--r--guix/build/utils.scm16
1 files changed, 13 insertions, 3 deletions
diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index a4a82a5f8c..06e88b1ff8 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -27,6 +27,8 @@
#:use-module (ice-9 rdelim)
#:use-module (rnrs bytevectors)
#:use-module (rnrs io ports)
+ #:re-export (alist-cons
+ alist-delete)
#:export (directory-exists?
executable-file?
call-with-ascii-input-file
@@ -248,9 +250,17 @@ SEPARATOR-separated path accordingly. Example:
"
(let* ((path (search-path-as-list sub-directories input-dirs))
(value (list->search-path-as-string path separator)))
- (setenv env-var value)
- (format #t "environment variable `~a' set to `~a'~%"
- env-var value)))
+ (if (string-null? value)
+ (begin
+ ;; Never set ENV-VAR to an empty string because often, the empty
+ ;; string is equivalent to ".". This is the case for
+ ;; GUILE_LOAD_PATH in Guile 2.0, for instance.
+ (unsetenv env-var)
+ (format #t "environment variable `~a' unset~%" env-var))
+ (begin
+ (setenv env-var value)
+ (format #t "environment variable `~a' set to `~a'~%"
+ env-var value)))))
(define (which program)
"Return the complete file name for PROGRAM as found in $PATH, or #f if