[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
08/11: channels: Automatically add introduction for the official 'guix'
From: |
guix-commits |
Subject: |
08/11: channels: Automatically add introduction for the official 'guix' channel. |
Date: |
Tue, 16 Jun 2020 10:16:12 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit c3f6f564e909ebefe752d24b325871a4e3a02d40
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Mon Jun 8 22:22:36 2020 +0200
channels: Automatically add introduction for the official 'guix' channel.
This is useful when people run "guix time-machine -C channels.scm",
where 'channels.scm' misses channel introductions.
* guix/channels.scm (%default-channel-url): New variable.
(%default-channels): Use it.
(ensure-default-introduction): New procedure.
(latest-channel-instance): Call it.
---
guix/channels.scm | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/guix/channels.scm b/guix/channels.scm
index 02e361b..a82bd34 100644
--- a/guix/channels.scm
+++ b/guix/channels.scm
@@ -148,18 +148,32 @@
"BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA")))
#f)) ;TODO: Add an intro signature so it can be exported.
+(define %default-channel-url
+ ;; URL of the default 'guix' channel.
+ "https://git.savannah.gnu.org/git/guix.git")
+
(define %default-channels
;; Default list of channels.
(list (channel
(name 'guix)
(branch "master")
- (url "https://git.savannah.gnu.org/git/guix.git")
+ (url %default-channel-url)
(introduction %guix-channel-introduction))))
(define (guix-channel? channel)
"Return true if CHANNEL is the 'guix' channel."
(eq? 'guix (channel-name channel)))
+(define (ensure-default-introduction chan)
+ "If CHAN represents the \"official\" 'guix' channel and lacks an
+introduction, add it."
+ (if (and (guix-channel? chan)
+ (not (channel-introduction chan))
+ (string=? (channel-url chan) %default-channel-url))
+ (channel (inherit chan)
+ (introduction %guix-channel-introduction))
+ chan))
+
(define-record-type <channel-instance>
(channel-instance channel commit checkout)
channel-instance?
@@ -385,7 +399,9 @@ their relation."
(and (string=? (basename file) ".git")
(eq? 'directory (stat:type stat))))
- (let-values (((checkout commit relation)
+ (let-values (((channel)
+ (ensure-default-introduction channel))
+ ((checkout commit relation)
(update-cached-checkout (channel-url channel)
#:ref (channel-reference channel)
#:starting-commit starting-commit)))
- branch master updated (3646a44 -> 619972f), guix-commits, 2020/06/16
- 01/11: doc: Recommend "make authenticate" after ./bootstrap., guix-commits, 2020/06/16
- 02/11: git-authenticate: Cache takes a key parameter., guix-commits, 2020/06/16
- 03/11: git-authenticate: 'authenticate-commits' takes a #:keyring parameter., guix-commits, 2020/06/16
- 05/11: channels: 'latest-channel-instance' authenticates Git checkouts., guix-commits, 2020/06/16
- 06/11: channels: Make 'validate-pull' call right after clone/pull., guix-commits, 2020/06/16
- 07/11: .guix-channel: Add 'keyring-reference'., guix-commits, 2020/06/16
- 09/11: pull: Add '--disable-authentication'., guix-commits, 2020/06/16
- 04/11: tests: Move OpenPGP helpers to (guix tests gnupg)., guix-commits, 2020/06/16
- 08/11: channels: Automatically add introduction for the official 'guix' channel.,
guix-commits <=
- 11/11: maint: "make authenticate" behaves like 'guix pull' by default., guix-commits, 2020/06/16
- 10/11: time-machine: Add '--disable-authentication'., guix-commits, 2020/06/16