diff options
author | Ludovic Courtès <ludo@gnu.org> | 2020-07-01 23:32:25 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2020-07-01 23:34:51 +0200 |
commit | d774c7b1218a3cc20079b19812da119f9ed26b54 (patch) | |
tree | 62ac8a6f85d6c7f897c5fd7bb98ed6abe699da8c /guix/channels.scm | |
parent | 884df776408caa137456e91ba0f5fd71524cf6c3 (diff) | |
download | guix-patches-d774c7b1218a3cc20079b19812da119f9ed26b54.tar guix-patches-d774c7b1218a3cc20079b19812da119f9ed26b54.tar.gz |
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.
Diffstat (limited to 'guix/channels.scm')
-rw-r--r-- | guix/channels.scm | 20 |
1 files changed, 11 insertions, 9 deletions
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 <channel-metadata> 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) |