From 105d0d26648e6b3c221ac287bdd5b06c29a3c5b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 22 Oct 2025 21:39:57 +0200 Subject: [PATCH] pull: Remove old code to migrate generations to /var/guix/profiles. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This code was added in 2018 (commit 795d430d90e41eb172315bfccf79c9f13fc0ebfa) to move profile generations created before that from ~/.config/guix to /var/guix/profiles. It has long become useless. * guix/scripts/pull.scm (migrate-generations): Remove. (ensure-default-profile): Remove call to ‘migrate-generations’. Change-Id: I43d3860995be300a065814db6c0482514035bda9 --- guix/scripts/pull.scm | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm index 76aed0b5ccab4527f5dff37aff360db2f9ccbcbb..70141e2d639bd56c45c90f62404f99d8b652b57d 100644 --- a/guix/scripts/pull.scm +++ b/guix/scripts/pull.scm @@ -512,43 +512,9 @@ true, display what would be built without actually building it." ;; The user-friendly name of %CURRENT-PROFILE. (string-append (config-directory #:ensure? #f) "/current")) -(define (migrate-generations profile directory) - "Migrate the generations of PROFILE to DIRECTORY." - (format (current-error-port) - (G_ "Migrating profile generations to '~a'...~%") - %profile-directory) - (let ((current (generation-number profile))) - (for-each (lambda (generation) - (let ((source (generation-file-name profile generation)) - (target (string-append directory "/current-guix-" - (number->string generation) - "-link"))) - ;; Note: Don't use 'rename-file' as SOURCE and TARGET might - ;; live on different file systems. - (symlink (readlink source) target) - (delete-file source))) - (profile-generations profile)) - (symlink (string-append "current-guix-" - (number->string current) "-link") - (string-append directory "/current-guix")))) - (define (ensure-default-profile) (ensure-profile-directory) - ;; In 0.15.0+ we'd create ~/.config/guix/current-[0-9]*-link symlinks. Move - ;; them to %PROFILE-DIRECTORY. - ;; - ;; XXX: Ubuntu's 'sudo' preserves $HOME by default, and thus the second - ;; condition below is always false when one runs "sudo guix pull". As a - ;; workaround, skip this code when $SUDO_USER is set. See - ;; . - (unless (or (getenv "SUDO_USER") - (not (file-exists? %user-profile-directory)) - (string=? %profile-directory - (dirname - (canonicalize-profile %user-profile-directory)))) - (migrate-generations %user-profile-directory %profile-directory)) - ;; Make sure ~/.config/guix/current points to /var/guix/profiles/…. (let ((link %user-profile-directory)) (unless (equal? (false-if-exception (readlink link))