guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch version-1.2.0 updated: ci: Backport sexp->channel procedure.


From: guix-commits
Subject: branch version-1.2.0 updated: ci: Backport sexp->channel procedure.
Date: Mon, 14 Jun 2021 03:10:00 -0400

This is an automated email from the git hooks/post-receive script.

mothacehe pushed a commit to branch version-1.2.0
in repository guix.

The following commit(s) were added to refs/heads/version-1.2.0 by this push:
     new 7546a1d  ci: Backport sexp->channel procedure.
7546a1d is described below

commit 7546a1d3c0a354ca7dc0b7e53c1505130c2d263d
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Mon Jun 14 09:09:25 2021 +0200

    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 7ef8365..5a06816 100644
--- a/gnu/ci.scm
+++ b/gnu/ci.scm
@@ -80,6 +80,35 @@
 ;;;
 ;;; 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]