mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-25 22:08:16 -05:00
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.
This commit is contained in:
parent
8deb65c378
commit
a0dc97a517
1 changed files with 15 additions and 10 deletions
|
@ -203,6 +203,10 @@ (define* (build-and-install instances profile
|
||||||
(define update-profile
|
(define update-profile
|
||||||
(store-lift build-and-use-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)))
|
(mlet %store-monad ((manifest (channel-instances->manifest instances)))
|
||||||
(mbegin %store-monad
|
(mbegin %store-monad
|
||||||
(update-profile profile manifest
|
(update-profile profile manifest
|
||||||
|
@ -211,17 +215,18 @@ (define update-profile
|
||||||
(munless dry-run?
|
(munless dry-run?
|
||||||
(return (newline))
|
(return (newline))
|
||||||
(return (display-profile-news profile #:concise? #t))
|
(return (display-profile-news profile #:concise? #t))
|
||||||
(match (which "guix")
|
(if guix-command
|
||||||
(#f (return #f))
|
(let ((new (map (cut string-append <> "/bin/guix")
|
||||||
(str
|
(list (user-friendly-profile profile)
|
||||||
(let ((new (map (cut string-append <> "/bin/guix")
|
profile))))
|
||||||
(list (user-friendly-profile profile)
|
;; Is the 'guix' command previously in $PATH the same as the new
|
||||||
profile))))
|
;; one? If the answer is "no", then suggest 'hash guix'.
|
||||||
(unless (member str new)
|
(unless (member guix-command new)
|
||||||
(display-hint (format #f (G_ "After setting @code{PATH}, run
|
(display-hint (format #f (G_ "After setting @code{PATH}, run
|
||||||
@command{hash guix} to make sure your shell refers to @file{~a}.")
|
@command{hash guix} to make sure your shell refers to @file{~a}.")
|
||||||
(first new))))
|
(first new))))
|
||||||
(return #f))))))))
|
(return #f))
|
||||||
|
(return #f))))))
|
||||||
|
|
||||||
(define (honor-lets-encrypt-certificates! store)
|
(define (honor-lets-encrypt-certificates! store)
|
||||||
"Tell Guile-Git to use the Let's Encrypt certificates."
|
"Tell Guile-Git to use the Let's Encrypt certificates."
|
||||||
|
|
Loading…
Reference in a new issue