gnu: home: Replace rename in update-symlinks scripts.

* gnu/home/services/symlink-manager.scm (update-symlinks): Use
copy-file and delete-file instead of rename-file to avoid an error
when the target and backup are not in the same filesystem.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Nicolas Graves 2024-12-14 12:38:14 +01:00 committed by Ludovic Courtès
parent f1c2681542
commit 4b9b223bff
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -106,7 +106,8 @@ (define backup
(mkdir-p backup-directory)
(format #t (G_ "Backing up ~a...") (target-file file))
(mkdir-p (dirname backup))
(rename-file (target-file file) backup)
(copy-file (target-file file) backup)
(delete-file (target-file file))
(display (G_ " done\n")))
(define (cleanup-symlinks home-generation)