From 3bb168b0997d2ba2ef15e8eef2890582c8a6df9c Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 26 Oct 2015 22:17:25 +0100 Subject: utils: Add 'switch-symlinks', moved from (guix ui). * guix/ui.scm (switch-symlinks): Move to... * guix/utils.scm: ... here. New procedure. * guix/scripts/pull.scm: Use it. --- guix/ui.scm | 8 -------- 1 file changed, 8 deletions(-) (limited to 'guix/ui.scm') diff --git a/guix/ui.scm b/guix/ui.scm index c45c50fa16..b7ed5e7d4d 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -73,7 +73,6 @@ (define-module (guix ui) read/eval read/eval-package-expression location->string - switch-symlinks config-directory fill-paragraph texi->plain-text @@ -715,13 +714,6 @@ (define (location->string loc) (($ file line column) (format #f "~a:~a:~a" file line column)))) -(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 (config-directory) "Return the name of the configuration directory, after making sure that it exists. Honor the XDG specs, -- cgit v1.2.3