From 1b179d7876f19f04009a2f9e248ac10711f4c660 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 19 Sep 2020 16:26:44 +0200 Subject: describe: Save the original value of (program-arguments). Fixes . Reported by pkill9 . This ensures that 'guix repl -s SCRIPT' give SCRIPT the right value of (current-profile), which in turn ensures that (%package-module-path) is initialized with the right set of channels. * guix/describe.scm (initial-program-arguments): New variable. (current-profile): Use it. * guix/scripts/repl.scm (guix-repl): Call 'current-profile' before 'set-program-arguments'. --- guix/scripts/repl.scm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'guix/scripts') diff --git a/guix/scripts/repl.scm b/guix/scripts/repl.scm index 7d4e474e92..9f20803efc 100644 --- a/guix/scripts/repl.scm +++ b/guix/scripts/repl.scm @@ -27,6 +27,7 @@ (define-module (guix scripts repl) #:use-module (srfi srfi-37) #:use-module (ice-9 match) #:use-module (rnrs bytevectors) + #:autoload (guix describe) (current-profile) #:autoload (system repl repl) (start-repl) #:autoload (system repl server) (make-tcp-server-socket make-unix-domain-server-socket) @@ -176,6 +177,13 @@ (define script ;; Run script (save-module-excursion (lambda () + ;; Invoke 'current-profile' so that it memoizes the correct value + ;; based on (program-arguments), before we call + ;; 'set-program-arguments'. This in turn ensures that + ;; (%package-module-path) will contain entries for the channels + ;; available in the current profile. + (current-profile) + (set-program-arguments script) (set-user-module) -- cgit v1.2.3