From 2c05a6112b40c85dd0509052a6a6b97fa127f1c6 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 13 Jun 2022 16:57:40 +0530 Subject: utils: Move switch-symlinks to (guix build utils). * guix/utils.scm (switch-symlinks): Move to ... * guix/build/utils.scm (switch-symlinks): ... here. * guix/profiles.scm, guix/scripts/home.scm, guix/scripts/package.scm: Import switch-symlinks from (guix build utils). * guix/scripts/system/reconfigure.scm (switch-system-program): Import (guix build utils) in G-expression. --- guix/utils.scm | 8 -------- 1 file changed, 8 deletions(-) (limited to 'guix/utils.scm') diff --git a/guix/utils.scm b/guix/utils.scm index 5c36b15cfe..e7a576091e 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -121,7 +121,6 @@ (define-module (guix utils) file-sans-extension tarball-sans-extension compressed-file? - switch-symlinks call-with-temporary-directory with-atomic-file-output @@ -895,13 +894,6 @@ (define (compressed-file? file) (->bool (member (file-extension file) '("gz" "bz2" "xz" "lz" "lzma" "tgz" "tbz2" "zip")))) -(define (switch-symlinks link target) - "Atomically switch LINK, a symbolic link, to point to TARGET. Works -both when LINK already exists and when it does not." - (let ((pivot (string-append link ".new"))) - (symlink target pivot) - (rename-file pivot link))) - (define* (string-replace-substring str substr replacement #:optional (start 0) -- cgit v1.2.3