guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/04: guix package: Don't error out when failing to create ~/.guix-prof


From: guix-commits
Subject: 02/04: guix package: Don't error out when failing to create ~/.guix-profile.
Date: Thu, 27 Feb 2020 18:10:25 -0500 (EST)

civodul pushed a commit to branch master
in repository guix.

commit 6b0653e7ec8a9a842fb62e28fe83c9677f40d552
Author: Ludovic Courtès <address@hidden>
AuthorDate: Thu Feb 27 23:24:56 2020 +0100

    guix package: Don't error out when failing to create ~/.guix-profile.
    
    This is a followup to 7842ddcbc118cbc2799e22651732b7cdc06b93ee, which
    broke tests when 'HOME' is unset.
    
    * guix/scripts/package.scm (ensure-default-profile): Silently ignore
    'symlink' exceptions.
---
 guix/scripts/package.scm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index 1cb0d38..d2f4f1c 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -81,12 +81,15 @@
   "Ensure the default profile symlink and directory exist and are writable."
   (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
              %current-profile
              (not (false-if-exception
                    (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)
   "Delete GENERATIONS from PROFILE.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]