aboutsummaryrefslogtreecommitdiff
path: root/guix/build
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-06-22 16:42:46 +0200
committerLudovic Courtès <ludo@gnu.org>2013-06-22 16:42:46 +0200
commitb15669f37daecd9d06e0d4b3c864ecdbb81c9b9c (patch)
treefa893fb209bc52b6c0201a6a1cb43bd1e03e6c6b /guix/build
parentee26820636c2521bb0a15bd960814bafa780635e (diff)
downloadgnu-guix-b15669f37daecd9d06e0d4b3c864ecdbb81c9b9c.tar
gnu-guix-b15669f37daecd9d06e0d4b3c864ecdbb81c9b9c.tar.gz
utils: `set-path-environment-variable' calls `unsetenv' for empty values.
* guix/build/utils.scm (set-path-environment-variable): When VALUE is the empty string, call `unsetenv' instead of `setenv'. * gnu/packages/guile.scm (guile-2.0)[arguments]: Remove `unsetenv' trick.
Diffstat (limited to 'guix/build')
-rw-r--r--guix/build/utils.scm14
1 files changed, 11 insertions, 3 deletions
diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index a4a82a5f8c..c0b150e016 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -248,9 +248,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