[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Ludovic Courtès |
Date: |
Mon, 9 Apr 2018 04:35:24 -0400 (EDT) |
branch: master
commit 297b29190eb10576de1a5f736286bcbc3d4a6352
Author: Ludovic Courtès <address@hidden>
Date: Mon Apr 9 10:34:58 2018 +0200
evaluate: Change '%load-path' once and for all.
* bin/evaluate.in (main): Do not restore the original '%load-path'.
---
bin/evaluate.in | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/bin/evaluate.in b/bin/evaluate.in
index 39287c9..d973c44 100644
--- a/bin/evaluate.in
+++ b/bin/evaluate.in
@@ -58,17 +58,14 @@ exec ${GUILE:address@hidden@} --no-auto-compile -e main -s
"$0" "$@"
;; file names work as expected.
(chdir source)
+ ;; Change '%load-path' once and for all. We need it to be effective
+ ;; both when we load SPEC's #:file and when we later call the thunks.
+ (set! %load-path (append load-path %load-path))
+
(save-module-excursion
(lambda ()
(set-current-module %user-module)
- (let ((original-path %load-path))
- (dynamic-wind
- (lambda ()
- (set! %load-path (append load-path original-path)))
- (lambda ()
- (primitive-load (assq-ref spec #:file)))
- (lambda ()
- (set! %load-path original-path))))))
+ (primitive-load (assq-ref spec #:file))))
;; From there on we can access Guix modules.