pull: Avoid "Migrating profile" message on the first run.

* guix/scripts/pull.scm (ensure-default-profile): Do not call
'migrate-generations' when
%USER-PROFILE-DIRECTORY (~/.config/guix/current) does not exist.  This
avoids a confusing "Migrating profile" message when the user runs 'guix
pull' for the first time.
This commit is contained in:
Ludovic Courtès 2020-08-27 14:58:45 +02:00
parent c849446b82
commit 0c9d22c13f
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5

@ -507,6 +507,7 @@ true, display what would be built without actually building it."
;; workaround, skip this code when $SUDO_USER is set. See ;; workaround, skip this code when $SUDO_USER is set. See
;; <https://bugs.gnu.org/36785>. ;; <https://bugs.gnu.org/36785>.
(unless (or (getenv "SUDO_USER") (unless (or (getenv "SUDO_USER")
(not (file-exists? %user-profile-directory))
(string=? %profile-directory (string=? %profile-directory
(dirname (dirname
(canonicalize-profile %user-profile-directory)))) (canonicalize-profile %user-profile-directory))))