diff options
author | Ludovic Courtès <ludo@gnu.org> | 2018-04-07 18:18:37 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2018-04-07 18:33:27 +0200 |
commit | 2ba45edf2f4dfdd57e9416735128052ad4d5ee12 (patch) | |
tree | 6535b8c4c01e9c282416c90d32ac7621d8396d98 /src | |
parent | a3a7c09b06027bd30a96ae4607fa40bd790af840 (diff) | |
download | cuirass-2ba45edf2f4dfdd57e9416735128052ad4d5ee12.tar cuirass-2ba45edf2f4dfdd57e9416735128052ad4d5ee12.tar.gz |
base: Pass the correct load path to the 'evaluate' command.
The previous load path was potentially incorrect since commit
2fe7ff87e23b18d49bd33cffc4766b7eaa382054.
* src/cuirass/base.scm (evaluate)[tokenize, load-path]: New variables.
Assume #:load-path is colon-separated. Pass LOAD-PATH as the second
argument to 'evaluate'.
* doc/cuirass.texi (Database): Adjust documentation.
Diffstat (limited to 'src')
-rw-r--r-- | src/cuirass/base.scm | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/cuirass/base.scm b/src/cuirass/base.scm index c9c5ec1..9e930d4 100644 --- a/src/cuirass/base.scm +++ b/src/cuirass/base.scm @@ -253,12 +253,24 @@ in SOURCE directory. Return a list of jobs." (#:system . ,(derivation-system drv)) ,@job))) + (define (tokenize str) + (string-tokenize str (char-set-complement (char-set #\:)))) + + (define load-path + (match (assq-ref spec #:load-path) + (#f + "") + ((= tokenize path) + (string-join (map (lambda (entry) + (if (string-prefix? "/" entry) + entry + (string-append source "/" entry))) + path) + ":")))) + (let* ((port (non-blocking-port - (open-pipe* OPEN_READ - "evaluate" - (string-append (%package-cachedir) "/" - (assq-ref spec #:name) "/" - (assq-ref spec #:load-path)) + (open-pipe* OPEN_READ "evaluate" + load-path (%guix-package-path) source (object->string spec)))) (result (match (read/non-blocking port) |