~ruther/guix-local

b15669f37daecd9d06e0d4b3c864ecdbb81c9b9c — Ludovic Courtès 12 years ago ee26820
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.
2 files changed, 11 insertions(+), 14 deletions(-)

M gnu/packages/guile.scm
M guix/build/utils.scm
M gnu/packages/guile.scm => gnu/packages/guile.scm +0 -11
@@ 142,17 142,6 @@ extensible.  It supports many SRFIs.")
    `(#:phases (alist-cons-before
                'configure 'pre-configure
                (lambda* (#:key inputs #:allow-other-keys)
                  ;; By default we end up with GUILE_LOAD_PATH="" and
                  ;; GUILE_LOAD_COMPILED_PATH="".  But that is equivalent to
                  ;; ".", and breaks the build system when cross-compiling.
                  ;; Thus, make sure they are unset.
                  ;; TODO: Eventually fix `set-path-environment-variable'
                  ;; for that case.
                  ,@(if (%current-target-system)
                        '((unsetenv "GUILE_LOAD_PATH")
                          (unsetenv "GUILE_LOAD_COMPILED_PATH"))
                        '())

                  ;; Tell (ice-9 popen) the file name of Bash.
                  (let ((bash (assoc-ref inputs "bash")))
                    (substitute* "module/ice-9/popen.scm"

M guix/build/utils.scm => guix/build/utils.scm +11 -3
@@ 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