summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2022-10-04 09:28:01 +0200
committerLudovic Courtès <ludo@gnu.org>2022-10-04 18:15:35 +0200
commit5bc4b8e8e3960d431d66e3e4ac97f196059a875b (patch)
treed2a7e267cfaac488e06ba206d8f6e9ee97c94d37
parentgnu: guix: Update to 17134b9. (diff)
downloadguix-5bc4b8e8e3960d431d66e3e4ac97f196059a875b.tar.gz
guix-5bc4b8e8e3960d431d66e3e4ac97f196059a875b.tar.bz2
guix-5bc4b8e8e3960d431d66e3e4ac97f196059a875b.tar.xz
channels: Warn about missing introductions.
* guix/channels.scm (latest-channel-instance): Warn when CHANNEL has no introduction and CHECKOUT contains '.guix-authorizations'.
-rw-r--r--guix/channels.scm29
1 files changed, 19 insertions, 10 deletions
diff --git a/guix/channels.scm b/guix/channels.scm
index ad6d3fb8ac..f1c23c17fb 100644
--- a/guix/channels.scm
+++ b/guix/channels.scm
@@ -419,19 +419,28 @@ their relation. When AUTHENTICATE? is false, CHANNEL is not authenticated."
419 (if authenticate? 419 (if authenticate?
420 (if (channel-introduction channel) 420 (if (channel-introduction channel)
421 (authenticate-channel channel checkout commit) 421 (authenticate-channel channel checkout commit)
422 ;; TODO: Warn for all the channels once the authentication interface 422 (begin
423 ;; is public. 423 (when (file-exists?
424 (when (guix-channel? channel) 424 (string-append checkout "/.guix-authorizations"))
425 (raise (make-compound-condition 425 (warning (and=> (channel-location channel)
426 (formatted-message (G_ "channel '~a' lacks an \ 426 source-properties->location)
427 (G_ "channel '~a' lacks 'introduction' field but \
428'.guix-authorizations' found\n")
429 (channel-name channel)))
430
431 ;; TODO: Warn for all the channels once the authentication interface
432 ;; is public.
433 (when (guix-channel? channel)
434 (raise (make-compound-condition
435 (formatted-message (G_ "channel '~a' lacks an \
427introduction and cannot be authenticated~%") 436introduction and cannot be authenticated~%")
428 (channel-name channel)) 437 (channel-name channel))
429 (condition 438 (condition
430 (&fix-hint 439 (&fix-hint
431 (hint (G_ "Add the missing introduction to your 440 (hint (G_ "Add the missing introduction to your
432channels file to address the issue. Alternatively, you can pass 441channels file to address the issue. Alternatively, you can pass
433@option{--disable-authentication}, at the risk of running unauthenticated and 442@option{--disable-authentication}, at the risk of running unauthenticated and
434thus potentially malicious code.")))))))) 443thus potentially malicious code.")))))))))
435 (warning (G_ "channel authentication disabled~%"))) 444 (warning (G_ "channel authentication disabled~%")))
436 445
437 (when (guix-channel? channel) 446 (when (guix-channel? channel)