From aebad5184ddf75cb6e34331f4fd6325d0221b5a6 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Thu, 2 Feb 2017 10:13:13 +0100 Subject: base: Handle multi-directories in load-path. * src/cuirass/base.scm (set-guix-package-path!): Parse colon separated directories in load-path. Co-authored-by: Mathieu Lirzin --- src/cuirass/base.scm | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/cuirass/base.scm b/src/cuirass/base.scm index 21f53e0..9062ebf 100644 --- a/src/cuirass/base.scm +++ b/src/cuirass/base.scm @@ -193,8 +193,13 @@ if required. Return the last commit ID on success, #f otherwise." (define (set-guix-package-path! path) "Use PATH to find custom packages not defined in (gnu packages ...) -namespace or not already present in current Guile load paths." - (%package-module-path (cons path (%package-module-path))) - (%patch-path (cons path (%patch-path))) - (set! %load-path (cons path %load-path)) - (set! %load-compiled-path (cons path %load-compiled-path))) +namespace or not already present in current Guile load paths. PATH is +expected to be a colon-separated string of directories." + (define (set-paths! dir) + (%package-module-path (cons dir (%package-module-path))) + (%patch-path (cons dir (%patch-path))) + (set! %load-path (cons dir %load-path)) + (set! %load-compiled-path (cons dir %load-compiled-path))) + + (let ((dirs (parse-path path))) + (for-each set-paths! dirs))) -- cgit v1.2.3