summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-05-09 17:31:44 +0200
committerLudovic Courtès <ludo@gnu.org>2019-05-09 17:42:31 +0200
commita0dc97a517cbc4c82640e30cacb2a564d128bbe9 (patch)
treecf69aedee93bea4660b029ad8a87b55e25ab1890 /guix
parent8deb65c37850bfca36429f3fe5239bd9236f969c (diff)
downloadgnu-guix-a0dc97a517cbc4c82640e30cacb2a564d128bbe9.tar
gnu-guix-a0dc97a517cbc4c82640e30cacb2a564d128bbe9.tar.gz
pull: Display 'hash guix' hint when the new and old 'guix' are different.
Fixes <https://bugs.gnu.org/35601>. Reported by Diego Nicola Barbato <dnbarbato@posteo.de>. Previously we were calling (which "guix") after the new profile had been built and symlinked, so in most cases the hint would not be triggered, even though it should have been triggered. * guix/scripts/pull.scm (build-and-install)[guix-command]: New variable. Compare PROFILE/bin/guix against GUIX-COMMAND.
Diffstat (limited to 'guix')
-rw-r--r--guix/scripts/pull.scm25
1 files changed, 15 insertions, 10 deletions
diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm
index 3929cd402e..2d428546c9 100644
--- a/guix/scripts/pull.scm
+++ b/guix/scripts/pull.scm
@@ -203,6 +203,10 @@ true, display what would be built without actually building it."
(define update-profile
(store-lift build-and-use-profile))
+ (define guix-command
+ ;; The 'guix' command before we've built the new profile.
+ (which "guix"))
+
(mlet %store-monad ((manifest (channel-instances->manifest instances)))
(mbegin %store-monad
(update-profile profile manifest
@@ -211,17 +215,18 @@ true, display what would be built without actually building it."
(munless dry-run?
(return (newline))
(return (display-profile-news profile #:concise? #t))
- (match (which "guix")
- (#f (return #f))
- (str
- (let ((new (map (cut string-append <> "/bin/guix")
- (list (user-friendly-profile profile)
- profile))))
- (unless (member str new)
- (display-hint (format #f (G_ "After setting @code{PATH}, run
+ (if guix-command
+ (let ((new (map (cut string-append <> "/bin/guix")
+ (list (user-friendly-profile profile)
+ profile))))
+ ;; Is the 'guix' command previously in $PATH the same as the new
+ ;; one? If the answer is "no", then suggest 'hash guix'.
+ (unless (member guix-command new)
+ (display-hint (format #f (G_ "After setting @code{PATH}, run
@command{hash guix} to make sure your shell refers to @file{~a}.")
- (first new))))
- (return #f))))))))
+ (first new))))
+ (return #f))
+ (return #f))))))
(define (honor-lets-encrypt-certificates! store)
"Tell Guile-Git to use the Let's Encrypt certificates."