tests: Fix etc/profile test.
* tests/profiles.scm ("etc/profile"): Unset GUIX_PROFILE before sourcing etc/profile. Use '.' instead of 'source' for sourcing. Call 'echo $PATH' instead of using the output of 'set' to determine whether PATH is set.
This commit is contained in:
parent
56203284b6
commit
9e006fb3de
|
@ -237,14 +237,16 @@
|
||||||
(mbegin %store-monad
|
(mbegin %store-monad
|
||||||
(built-derivations (list drv))
|
(built-derivations (list drv))
|
||||||
(let* ((pipe (open-input-pipe
|
(let* ((pipe (open-input-pipe
|
||||||
(string-append "source "
|
(string-append "unset GUIX_PROFILE; "
|
||||||
profile "/etc/profile; "
|
;; 'source' is a Bashism; use '.' (dot).
|
||||||
"unset GUIX_PROFILE; set")))
|
". " profile "/etc/profile; "
|
||||||
(env (get-string-all pipe)))
|
;; Don't try to parse set(1) output because
|
||||||
|
;; it differs among shells; just use echo.
|
||||||
|
"echo $PATH")))
|
||||||
|
(path (get-string-all pipe)))
|
||||||
(return
|
(return
|
||||||
(and (zero? (close-pipe pipe))
|
(and (zero? (close-pipe pipe))
|
||||||
(string-contains env
|
(string-contains path (string-append profile "/bin"))))))))
|
||||||
(string-append "PATH=" profile "/bin"))))))))
|
|
||||||
|
|
||||||
(test-end "profiles")
|
(test-end "profiles")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue