From 8155a209071f981fbf359975f463be4bcf8fa23e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 11 Oct 2018 23:53:18 +0200 Subject: [PATCH] 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. --- guix/scripts/pull.scm | 18 +++++++++++------- 1 file 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 @@ (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)