summaryrefslogtreecommitdiff
path: root/distro.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2012-10-27 22:30:42 +0200
committerLudovic Courtès <ludo@gnu.org>2012-10-27 22:30:42 +0200
commita9f60c421bc6e4ad622d46102617fef9d3a290c6 (patch)
tree4a11b3fd663a540e49640a38695006cb5f4de559 /distro.scm
parentcc9abfd0f451652be4d08874a8f5b25f026fd44e (diff)
downloadguix-patches-a9f60c421bc6e4ad622d46102617fef9d3a290c6.tar
guix-patches-a9f60c421bc6e4ad622d46102617fef9d3a290c6.tar.gz
distro: Change $DISTRO_{PATCH,BOOTSTRAP}_DIRECTORY to search paths.
* distro.scm (not-colon): New variable. (%patch-directory): Rename to... (%patch-path): ... this. Turn into a list. Expect $DISTRO_PATCH_PATH to be a colon-separated search path. (%bootstrap-binaries-directory): Rename to... (%bootstrap-binaries-path): ... this. Likewise. (search-patch, search-bootstrap-binary): Adjust accordingly. * pre-inst-env.in: Change to use `DISTRO_PATCH_PATH' and `DISTRO_BOOTSTRAP_PATH'.
Diffstat (limited to 'distro.scm')
-rw-r--r--distro.scm24
1 files changed, 16 insertions, 8 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