From d774c7b1218a3cc20079b19812da119f9ed26b54 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 1 Jul 2020 23:32:25 +0200 Subject: channels: Dependencies listed in '.guix-channel' can have an introduction. Suggested by Ricardo Wurmus and Simon Tournier. * guix/channels.scm (sexp->channel-introduction): New procedure. (read-channel-metadata): Use it. (profile-channels)[sexp->channel-introduction]: Remove. * tests/channels.scm ("latest-channel-instances, authenticate dependency"): New test. * doc/guix.texi (Channels)[Declaring Channel Dependencies]: Augment example. --- guix/channels.scm | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'guix/channels.scm') diff --git a/guix/channels.scm b/guix/channels.scm index 32ada7bbc6..500c956f0f 100644 --- a/guix/channels.scm +++ b/guix/channels.scm @@ -223,6 +223,14 @@ introduction, add it." (#f `(branch . ,(channel-branch channel))) (commit `(commit . ,(channel-commit channel))))) +(define sexp->channel-introduction + (match-lambda + (('channel-introduction ('version 0) + ('commit commit) ('signer signer) + _ ...) + (make-channel-introduction commit (openpgp-fingerprint signer))) + (x #f))) + (define (read-channel-metadata port) "Read from PORT channel metadata in the format expected for the '.guix-channel' file. Return a record, or raise an error @@ -250,7 +258,9 @@ if valid metadata could not be read from PORT." (name name) (branch branch) (url url) - (commit (get 'commit)))))) + (commit (get 'commit)) + (introduction (and=> (get 'introduction) + sexp->channel-introduction)))))) dependencies) news-file keyring-reference @@ -948,14 +958,6 @@ to 'latest-channel-instances'." (define (profile-channels profile) "Return the list of channels corresponding to entries in PROFILE. If PROFILE is not a profile created by 'guix pull', return the empty list." - (define sexp->channel-introduction - (match-lambda - (('channel-introduction ('version 0) - ('commit commit) ('signer signer) - _ ...) - (make-channel-introduction commit (openpgp-fingerprint signer))) - (x #f))) - (filter-map (lambda (entry) (match (assq 'source (manifest-entry-properties entry)) (('source ('repository ('version 0) -- cgit v1.2.3