mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2025-01-20 14:47:20 +01:00
home: symlink-manager: Avoid extra 'lstat' call.
* gnu/home/services/symlink-manager.scm (update-symlinks-script)[symlink-to-store?]: Avoid extra 'lstat' call.
This commit is contained in:
parent
a81bb1e4bb
commit
a3a76a8384
1 changed files with 7 additions and 2 deletions
|
@ -103,8 +103,13 @@ (define (get-backup-path path)
|
|||
(string-append backup-dir "/." path))
|
||||
|
||||
(define (symlink-to-store? path)
|
||||
(and (equal? (stat:type (lstat path)) 'symlink)
|
||||
(store-file-name? (readlink path))))
|
||||
(catch 'system-error
|
||||
(lambda ()
|
||||
(store-file-name? (readlink path)))
|
||||
(lambda args
|
||||
(if (= EINVAL (system-error-errno args))
|
||||
#f
|
||||
(apply throw args)))))
|
||||
|
||||
(define (backup-file path)
|
||||
(mkdir-p backup-dir)
|
||||
|
|
Loading…
Reference in a new issue