summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-01-09 11:21:31 +0100
committerLudovic Courtès <ludo@gnu.org>2020-01-09 23:33:04 +0100
commitf75243e17e3ff88582314bcb8450e654bb0b556b (patch)
tree3ef99837b3eeb140071a48d5b705a8cc4cb20f8a
parentbbd9063afcb204b3f81c59d09f5c54d3b67f1e91 (diff)
downloadguix-f75243e17e3ff88582314bcb8450e654bb0b556b.tar.gz
channels: Provide a hint when the 'guix' channel is lacking.
Fixes <https://bugs.gnu.org/39043>.
Reported by Jesse Gibbons <jgibbons2357@gmail.com>.

* guix/channels.scm (channel-instance-derivations): Raise '&fix-hint'
condition in addition to the '&message' condition.
-rw-r--r--guix/channels.scm8
1 files changed, 6 insertions, 2 deletions
diff --git a/guix/channels.scm b/guix/channels.scm
index 826ee729ad..f0261dc2da 100644
--- a/guix/channels.scm
+++ b/guix/channels.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;;
@@ -36,7 +36,8 @@
   #:use-module (guix i18n)
   #:use-module ((guix utils)
                 #:select (source-properties->location
-                          &error-location))
+                          &error-location
+                          &fix-hint))
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-2)
   #:use-module (srfi srfi-9)
@@ -457,6 +458,9 @@ INSTANCES."
       (raise (apply make-compound-condition
                     (condition
                      (&message (message "'guix' channel is lacking")))
+                    (condition
+                     (&fix-hint (hint (G_ "Make sure your list of channels
+contains one channel named @code{guix} providing the core of Guix."))))
                     (if loc
                         (list (condition (&error-location (location loc))))
                         '())))))