aboutsummaryrefslogtreecommitdiff
path: root/guix/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-09-14 23:16:54 +0200
committerLudovic Courtès <ludo@gnu.org>2019-09-23 10:38:44 +0200
commit8ba7fd3cd6962f1c1aaaa5f71eed7f9222094f25 (patch)
tree55b4dd25f2b16a9786f08e331b743f4289ccb053 /guix/tests
parent873f6f1334ab06a69e768a8aea0054404237542f (diff)
downloadgnu-guix-8ba7fd3cd6962f1c1aaaa5f71eed7f9222094f25.tar
gnu-guix-8ba7fd3cd6962f1c1aaaa5f71eed7f9222094f25.tar.gz
channels: Add support for a news file.
* guix/channels.scm (<channel-metadata>)[news-file]: New field. (read-channel-metadata): Set the 'news-file' field. (read-channel-metadata-from-source): Likewise. (<channel-news>, <channel-news-entry>): New record types. (sexp->channel-news-entry, read-channel-news) (channel-news-for-commit): New procedures. * guix/tests/git.scm (populate-git-repository): For 'add', allow CONTENTS to be a procedure. * tests/channels.scm ("channel-news, no news") ("channel-news, one entry"): New tests. * doc/guix.texi (Channels): Document it.
Diffstat (limited to 'guix/tests')
-rw-r--r--guix/tests/git.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/guix/tests/git.scm b/guix/tests/git.scm
index 52abe77c83..9d5b1ae321 100644
--- a/guix/tests/git.scm
+++ b/guix/tests/git.scm
@@ -18,6 +18,7 @@
(define-module (guix tests git)
#:use-module (git)
+ #:use-module ((guix git) #:select (with-repository))
#:use-module (guix utils)
#:use-module (guix build utils)
#:use-module (ice-9 match)
@@ -55,7 +56,11 @@ Return DIRECTORY on success."
(mkdir-p (dirname file))
(call-with-output-file file
(lambda (port)
- (display contents port)))
+ (display (if (string? contents)
+ contents
+ (with-repository directory repository
+ (contents repository)))
+ port)))
(git "add" file)
(loop rest)))
((('commit text) rest ...)