aboutsummaryrefslogtreecommitdiff
path: root/guix/scripts/pull.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-10-11 23:53:18 +0200
committerLudovic Courtès <ludo@gnu.org>2018-10-12 00:13:14 +0200
commit8155a209071f981fbf359975f463be4bcf8fa23e (patch)
treeac1ee0ce6eb551e8b2b47b1fd2fe395ff6d9eba0 /guix/scripts/pull.scm
parente1d1ec143569d35eb3e222e6f49d1db0e5423be9 (diff)
downloadgnu-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.scm18
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)