guix package: Don't error out when failing to create ~/.guix-profile.
This is a followup to 7842ddcbc1
, which
broke tests when 'HOME' is unset.
* guix/scripts/package.scm (ensure-default-profile): Silently ignore
'symlink' exceptions.
This commit is contained in:
parent
749b958206
commit
6b0653e7ec
1 changed files with 5 additions and 2 deletions
|
@ -81,12 +81,15 @@
|
||||||
"Ensure the default profile symlink and directory exist and are writable."
|
"Ensure the default profile symlink and directory exist and are writable."
|
||||||
(ensure-profile-directory)
|
(ensure-profile-directory)
|
||||||
|
|
||||||
;; Create ~/.guix-profile if it doesn't exist yet.
|
;; Try to create ~/.guix-profile if it doesn't exist yet.
|
||||||
(when (and %user-profile-directory
|
(when (and %user-profile-directory
|
||||||
%current-profile
|
%current-profile
|
||||||
(not (false-if-exception
|
(not (false-if-exception
|
||||||
(lstat %user-profile-directory))))
|
(lstat %user-profile-directory))))
|
||||||
(symlink %current-profile %user-profile-directory)))
|
(catch 'system-error
|
||||||
|
(lambda ()
|
||||||
|
(symlink %current-profile %user-profile-directory))
|
||||||
|
(const #t))))
|
||||||
|
|
||||||
(define (delete-generations store profile generations)
|
(define (delete-generations store profile generations)
|
||||||
"Delete GENERATIONS from PROFILE.
|
"Delete GENERATIONS from PROFILE.
|
||||||
|
|
Reference in a new issue