[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Mathieu Othacehe |
Date: |
Mon, 13 Sep 2021 16:42:29 -0400 (EDT) |
branch: master
commit 57d66cad1d8ee0e758bd1b140e0a18db26eed7fe
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Mon Sep 13 22:39:34 2021 +0200
Move latest-checkouts to base module.
* src/cuirass/scripts/evaluate.scm (latest-checkouts): Move it to ...
* src/cuirass/base.scm: ... here.
---
src/cuirass/base.scm | 11 +++++++++++
src/cuirass/scripts/evaluate.scm | 11 +----------
2 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/src/cuirass/base.scm b/src/cuirass/base.scm
index a7410af..73d9a96 100644
--- a/src/cuirass/base.scm
+++ b/src/cuirass/base.scm
@@ -76,6 +76,7 @@
prepare-git
process-specs
evaluation-log-file
+ latest-checkouts
;; Parameters.
%package-cachedir
@@ -672,6 +673,16 @@ by BUILD-OUTPUTS."
(guix-warning-port (%make-void-port "w")))
(apply latest-channel-instances args)))
+(define (latest-checkouts spec eval-id)
+ "Return the latest checkouts for the EVAL-ID evaluation of the SPEC
+specification."
+ (let ((name (specification-name spec))
+ (channels (specification-channels spec)))
+ (map (lambda (channel)
+ (let ((channel (channel-name channel)))
+ (db-get-latest-checkout name channel eval-id)))
+ channels)))
+
(define (process-specs jobspecs)
"Evaluate and build JOBSPECS and store results in the database."
(define (new-eval? spec)
diff --git a/src/cuirass/scripts/evaluate.scm b/src/cuirass/scripts/evaluate.scm
index 6284528..a07687f 100644
--- a/src/cuirass/scripts/evaluate.scm
+++ b/src/cuirass/scripts/evaluate.scm
@@ -20,6 +20,7 @@
;;; along with Cuirass. If not, see <http://www.gnu.org/licenses/>.
(define-module (cuirass scripts evaluate)
+ #:use-module (cuirass base)
#:use-module (cuirass database)
#:use-module (cuirass specification)
#:use-module (guix channels)
@@ -90,16 +91,6 @@ of channel instances."
(built-derivations (list profile))
(return (derivation->output-path profile)))))))
-(define (latest-checkouts spec eval-id)
- "Return the latest checkouts for the EVAL-ID evaluation of the SPEC
-specification."
- (let ((name (specification-name spec))
- (channels (specification-channels spec)))
- (map (lambda (channel)
- (let ((channel (channel-name channel)))
- (db-get-latest-checkout name channel eval-id)))
- channels)))
-
(define (cuirass-evaluate args)
"This procedure spawns an inferior on the given channels. An evaluation
procedure is called within that inferior, it returns a list of jobs that are