aboutsummaryrefslogtreecommitdiff
path: root/bin/evaluate.in
diff options
context:
space:
mode:
Diffstat (limited to 'bin/evaluate.in')
-rw-r--r--bin/evaluate.in14
1 files changed, 9 insertions, 5 deletions
diff --git a/bin/evaluate.in b/bin/evaluate.in
index d1d0767..3918681 100644
--- a/bin/evaluate.in
+++ b/bin/evaluate.in
@@ -32,7 +32,7 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@"
(guix store))
(define* (main #:optional (args (command-line)))
- (match args
+ (match (peek "args" args)
((command load-path guix-package-path cachedir specstr database)
;; Load FILE, a Scheme file that defines Hydra jobs.
(let ((%user-module (make-fresh-user-module))
@@ -43,7 +43,7 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@"
(lambda ()
(set-current-module %user-module)
(with-directory-excursion
- (string-append cachedir "/" (assq-ref spec #:name))
+ (string-append cachedir "/" (assq-ref (peek "spec" spec) #:name))
(primitive-load (assq-ref spec #:file)))))
(with-store store
(unless (assoc-ref spec #:use-substitutes?)
@@ -60,11 +60,15 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@"
(parameterize ((%package-database database)
(%use-substitutes? (assoc-ref spec #:use-substitutes?)))
(unless (string-null? guix-package-path)
- (set-guix-package-path! guix-package-path))
+ (set-guix-package-path! guix-package-path))
+
;; Call the entry point of FILE and print the resulting job sexp.
(let* ((proc-name (assq-ref spec #:proc))
- (proc (module-ref %user-module proc-name))
- (thunks (proc store (assq-ref spec #:arguments)))
+ (proc (module-ref %user-module proc-name))
+ (thunks (with-directory-excursion
+ (string-append cachedir "/" (assq-ref (peek "spec" spec) #:name))
+
+ (proc store (assq-ref spec #:arguments))))
(db (db-open))
(commit (assq-ref spec #:current-commit))
(eval `((#:specification . ,(assq-ref spec #:name))