pull: Create the "${XDG_CONFIG_HOME}/guix" directory when needed.
author宋文武 <iyzsong@member.fsf.org>
Fri, 12 Feb 2021 12:48:20 +0000 (20:48 +0800)
committer宋文武 <iyzsong@member.fsf.org>
Fri, 12 Feb 2021 12:54:33 +0000 (20:54 +0800)
This fixes <https://bugs.gnu.org/46269>.

* guix/scripts/pull.scm (ensure-default-profile): Add a 'mkdir-p' call before
'symlink'.

guix/scripts/pull.scm

index 4e0ab5d..13d5ece 100644 (file)
@@ -39,7 +39,7 @@
                                 close-inferior)
   #:use-module (guix scripts build)
   #:use-module (guix scripts describe)
-  #:autoload   (guix build utils) (which)
+  #:autoload   (guix build utils) (which mkdir-p)
   #:use-module ((guix build syscalls)
                 #:select (with-file-lock/no-wait))
   #:use-module (guix git)
@@ -521,6 +521,7 @@ true, display what would be built without actually building it."
       (catch 'system-error
         (lambda ()
           (false-if-exception (delete-file link))
+          (mkdir-p (dirname link))
           (symlink %current-profile link))
         (lambda args
           (leave (G_ "while creating symlink '~a': ~a~%")