summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--distro.scm24
-rw-r--r--pre-inst-env.in6
2 files changed, 19 insertions, 11 deletions
diff --git a/distro.scm b/distro.scm
index 760c7245e7..bbfe51c943 100644
--- a/distro.scm
+++ b/distro.scm
@@ -37,23 +37,31 @@
 
 (define _ (cut gettext <> "guix"))
 
-(define %patch-directory
+(define not-colon
+  ;; The char set that contains all the characters but `:'.
+  (char-set-complement (char-set #\:)))
+
+(define %patch-path
   (make-parameter
-   (or (getenv "DISTRO_PATCH_DIRECTORY")
-       (compile-time-value (getenv "DISTRO_INSTALLED_PATCH_DIRECTORY")))))
+   (or (and=> (getenv "DISTRO_PATCH_PATH")
+              (cut string-tokenize <> not-colon))
+       (compile-time-value
+        (list (getenv "DISTRO_INSTALLED_PATCH_DIRECTORY"))))))
 
-(define %bootstrap-binaries-directory
+(define %bootstrap-binaries-path
   (make-parameter
-   (or (getenv "DISTRO_BOOTSTRAP_DIRECTORY")
-       (compile-time-value (getenv "DISTRO_INSTALLED_BOOTSTRAP_DIRECTORY")))))
+   (or (and=> (getenv "DISTRO_BOOTSTRAP_PATH")
+              (cut string-tokenize <> not-colon))
+       (compile-time-value
+        (list (getenv "DISTRO_INSTALLED_BOOTSTRAP_DIRECTORY"))))))
 
 (define (search-patch file-name)
   "Search the patch FILE-NAME."
-  (search-path (list (%patch-directory)) file-name))
+  (search-path (%patch-path) file-name))
 
 (define (search-bootstrap-binary file-name system)
   "Search the bootstrap binary FILE-NAME for SYSTEM."
-  (search-path (list (%bootstrap-binaries-directory))
+  (search-path (%bootstrap-binaries-path)
                (string-append system "/" file-name)))
 
 (define %distro-module-directory
diff --git a/pre-inst-env.in b/pre-inst-env.in
index baea6da35a..0d1ca80b55 100644
--- a/pre-inst-env.in
+++ b/pre-inst-env.in
@@ -23,12 +23,12 @@
 # Run COMMAND in a pre-installation environment.  Typical use is
 # "./pre-inst-env guix-build hello".
 
-DISTRO_PATCH_DIRECTORY="@abs_top_srcdir@/distro/packages/patches"
-DISTRO_BOOTSTRAP_DIRECTORY="@abs_top_srcdir@/distro/packages/bootstrap"
+DISTRO_PATCH_PATH="@abs_top_srcdir@/distro/packages/patches"
+DISTRO_BOOTSTRAP_PATH="@abs_top_srcdir@/distro/packages/bootstrap"
 GUILE_LOAD_COMPILED_PATH="@abs_top_builddir@${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH"
 GUILE_LOAD_PATH="@abs_top_srcdir@${GUILE_LOAD_PATH:+:}:$GUILE_LOAD_PATH"
 
-export DISTRO_PATCH_DIRECTORY DISTRO_BOOTSTRAP_DIRECTORY
+export DISTRO_PATCH_PATH DISTRO_BOOTSTRAP_PATH
 export GUILE_LOAD_COMPILED_PATH GUILE_LOAD_PATH
 
 # Define $PATH so that `guix-build' and friends are easily found.