aboutsummaryrefslogtreecommitdiff
path: root/guix/channels.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-06-24 14:53:08 +0200
committerLudovic Courtès <ludo@gnu.org>2020-06-28 23:26:53 +0200
commitead5c46147ebf352ad4804d52a766dcf105eda4f (patch)
treed661f86f3f5be15f4920e42858019c41cc107a32 /guix/channels.scm
parent0a8dd8aae5fad365c2f429d48e4085a3b3388332 (diff)
downloadguix-ead5c46147ebf352ad4804d52a766dcf105eda4f.tar
guix-ead5c46147ebf352ad4804d52a766dcf105eda4f.tar.gz
channels: Error out when the 'guix' channel lacks an introduction.
* guix/channels.scm (latest-channel-instance): Raise an error instead of warning when 'guix is unauthenticated. * tests/channels.scm ("latest-channel-instances, missing introduction for 'guix'"): New test.
Diffstat (limited to 'guix/channels.scm')
-rw-r--r--guix/channels.scm13
1 files changed, 10 insertions, 3 deletions
diff --git a/guix/channels.scm b/guix/channels.scm
index 3eec5df883..1016b95045 100644
--- a/guix/channels.scm
+++ b/guix/channels.scm
@@ -406,9 +406,16 @@ their relation. When AUTHENTICATE? is false, CHANNEL is not authenticated."
;; TODO: Warn for all the channels once the authentication interface
;; is public.
(when (guix-channel? channel)
- (warning (G_ "channel '~a' lacks an introduction and \
-cannot be authenticated~%")
- (channel-name channel))))
+ (raise (condition
+ (&message
+ (message (format #f (G_ "channel '~a' lacks an \
+introduction and cannot be authenticated~%")
+ (channel-name channel))))
+ (&fix-hint
+ (hint (G_ "Add the missing introduction to your
+channels file to address the issue. Alternatively, you can pass
+@option{--disable-authentication}, at the risk of running unauthenticated and
+thus potentially malicious code.")))))))
(warning (G_ "channel authentication disabled~%")))
(when (guix-channel? channel)