diff options
author | Ludovic Courtès <ludo@gnu.org> | 2018-10-11 23:53:18 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2018-10-12 00:13:14 +0200 |
commit | 8155a209071f981fbf359975f463be4bcf8fa23e (patch) | |
tree | ac1ee0ce6eb551e8b2b47b1fd2fe395ff6d9eba0 /guix/scripts/pull.scm | |
parent | e1d1ec143569d35eb3e222e6f49d1db0e5423be9 (diff) | |
download | gnu-guix-8155a209071f981fbf359975f463be4bcf8fa23e.tar gnu-guix-8155a209071f981fbf359975f463be4bcf8fa23e.tar.gz |
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.
Diffstat (limited to 'guix/scripts/pull.scm')
-rw-r--r-- | guix/scripts/pull.scm | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm index 5fecc11de3..8e0595076a 100644 --- a/guix/scripts/pull.scm +++ b/guix/scripts/pull.scm @@ -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) |