pull: Don't trigger 'hash guix' hint needlessly.

Previously if ~/.config/guix/current/bin was in $PATH, we'd still
suggest to run 'hash guix' because we'd compare (which "guix") against
/var/guix/profiles/per-user/….

* guix/scripts/pull.scm (build-and-install): Check whether (which
"guix") matches PROFILE or its user-friendly variant.
master
Ludovic Courtès 2019-01-28 23:03:38 +01:00
parent 3a8c4860fb
commit d1d72830f2
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 5 additions and 3 deletions

View File

@ -197,11 +197,13 @@ true, display what would be built without actually building it."
(match (which "guix") (match (which "guix")
(#f (return #f)) (#f (return #f))
(str (str
(let ((command (string-append profile "/bin/guix"))) (let ((new (map (cut string-append <> "/bin/guix")
(unless (string=? command str) (list (user-friendly-profile profile)
profile))))
(unless (member str 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}.")
command))) (first new))))
(return #f)))))))) (return #f))))))))
(define (honor-lets-encrypt-certificates! store) (define (honor-lets-encrypt-certificates! store)