From 7546a1d3c0a354ca7dc0b7e53c1505130c2d263d Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Mon, 14 Jun 2021 09:09:25 +0200 Subject: ci: Backport sexp->channel procedure. * gnu/ci.scm (sexp->channel): New procedure. --- gnu/ci.scm | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/gnu/ci.scm b/gnu/ci.scm index 7ef8365318..5a068167ae 100644 --- a/gnu/ci.scm +++ b/gnu/ci.scm @@ -80,6 +80,35 @@ (define-module (gnu ci) ;;; ;;; Code: +;; Backport from (guix channels) module. +(define* (sexp->channel sexp #:optional (name 'channel)) + "Read SEXP, a provenance sexp as created by 'channel-instance->sexp'; use +NAME as the channel name if SEXP does not specify it. Return #f if the sexp +does not have the expected structure." + (match sexp + (('repository ('version 0) + ('url url) + ('branch branch) + ('commit commit) + rest ...) + ;; Historically channel sexps did not include the channel name. It's OK + ;; for channels created by 'channel-instances->manifest' because the + ;; entry name is the channel name, but it was missing for entries created + ;; by 'manifest-entry-with-provenance'. + (channel (name (match (assq 'name rest) + (#f name) + (('name name) name))) + (url url) + (branch branch) + (commit commit) + (introduction + (match (assq 'introduction rest) + (#f #f) + (('introduction intro) + (sexp->channel-introduction intro)))))) + + (_ #f))) + (define* (derivation->job name drv #:key (max-silent-time 3600) -- cgit v1.2.3