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.
master
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
1 changed files with 11 additions and 7 deletions

View File

@ -243,13 +243,17 @@ Download and deploy the latest version of Guix.\n"))
(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)