From beab4babac39fe6f579e09fdc4670d9a74e30074 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sun, 9 Feb 2020 16:43:37 +0000 Subject: Further refactor channel->derivation-file-name To reduce the line length. --- guix-data-service/jobs/load-new-guix-revision.scm | 39 ++++++++++++----------- 1 file changed, 21 insertions(+), 18 deletions(-) (limited to 'guix-data-service') diff --git a/guix-data-service/jobs/load-new-guix-revision.scm b/guix-data-service/jobs/load-new-guix-revision.scm index 752e92c..6f57366 100644 --- a/guix-data-service/jobs/load-new-guix-revision.scm +++ b/guix-data-service/jobs/load-new-guix-revision.scm @@ -719,6 +719,24 @@ WHERE job_id = $1" 'open-inferior/container (resolve-module '(guix inferior)))) + (define inferior-code + `(lambda (store) + (let ((instances + (list + (channel-instance + (channel (name ',(channel-name channel)) + (url ,(channel-url channel)) + (branch ,(channel-branch channel)) + (commit ,(channel-commit channel))) + ,(channel-instance-commit channel-instance) + ,(channel-instance-checkout channel-instance))))) + (run-with-store store + (mlet* %store-monad ((manifest (channel-instances->manifest + instances)) + (derv (profile-derivation manifest))) + (mbegin %store-monad + (return (derivation-file-name derv)))))))) + (define (start-inferior-and-return-derivation-file-names) ;; /etc is only missing if open-inferior/container has been used (when use-container? @@ -745,30 +763,15 @@ WHERE job_id = $1" (@@ (guix channels) channel-instance)) inferior) - (let ((file-name + (let ((result (inferior-eval-with-store inferior store - `(lambda (store) - (let ((instances - (list - (channel-instance - (channel (name ',(channel-name channel)) - (url ,(channel-url channel)) - (branch ,(channel-branch channel)) - (commit ,(channel-commit channel))) - ,(channel-instance-commit channel-instance) - ,(channel-instance-checkout channel-instance))))) - (run-with-store store - (mlet* %store-monad ((manifest (channel-instances->manifest - instances)) - (derv (profile-derivation manifest))) - (mbegin %store-monad - (return (derivation-file-name derv)))))))))) + inferior-code))) (close-inferior inferior) - file-name))) + result))) (let ((inferior (if use-container? -- cgit v1.2.3