pull: Create /var/guix/profiles/per-user/USER/current-guix.

Previously the migration code would fail to create that file, so
~/.config/guix/current would be dangling.

* guix/scripts/pull.scm (migrate-generations): Create
/var/guix/profiles/per-user/USER/current-guix.
This commit is contained in:
Ludovic Courtès 2018-10-11 23:53:18 +02:00
parent e1d1ec1435
commit 8155a20907
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -243,13 +243,17 @@ (define (migrate-generations profile directory)
(format (current-error-port)
(G_ "Migrating profile generations to '~a'...~%")
%profile-directory)
(for-each (lambda (generation)
(let ((source (generation-file-name profile generation))
(target (string-append directory "/current-guix-"
(number->string generation)
"-link")))
(rename-file source target)))
(profile-generations profile)))
(let ((current (basename
(generation-file-name profile
(generation-number profile)))))
(for-each (lambda (generation)
(let ((source (generation-file-name profile generation))
(target (string-append directory "/current-guix-"
(number->string generation)
"-link")))
(rename-file source target)))
(profile-generations profile))
(symlink current (string-append directory "/current-guix"))))
(define (ensure-default-profile)
(ensure-profile-directory)