guix: home: Do not relink correct link. * guix/scripts/home.scm (ensure-home-profile): Do not relink when $HOME is already correctly linked.
guix/scripts/home.scm
| 160 | 160 | report an error." | |
| 161 | 161 | (ensure-profile-directory) | |
| 162 | 162 | ||
| 163 | - | (when %home %current-home | |
| 163 | + | (when (and %home %current-home) | |
| 164 | 164 | (let ((home (false-if-exception (lstat %home)))) | |
| 165 | 165 | (cond | |
| 166 | 166 | ((equal? (stat:type home) 'symlink) | |
| 167 | - | (delete-file %home) | |
| 168 | - | (symlink %current-home %home)) | |
| 167 | + | (unless (equal? (readlink %home) %current-home) | |
| 168 | + | (delete-file %home) | |
| 169 | + | (symlink %current-home %home))) | |
| 169 | 170 | ((false-if-exception (lstat data-directory)) | |
| 170 | 171 | (leave (G_ "Your $HOME directory (~a) is not a symlink to the home | |
| 171 | 172 | profile, and it cannot be moved as ~a already exists on the filesystem.~%") |