guix-commits
[Top][All Lists]
Advanced

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

04/08: utils: 'current-source-directory' gracefully handles lack of sour


From: Ludovic Courtès
Subject: 04/08: utils: 'current-source-directory' gracefully handles lack of source info.
Date: Sun, 19 Jun 2016 22:53:14 +0000 (UTC)

civodul pushed a commit to branch master
in repository guix.

commit a68d0f6fd5a93dc80fe9d919413f5d3e8db2a5b4
Author: Ludovic Courtès <address@hidden>
Date:   Sun Jun 19 22:30:34 2016 +0200

    utils: 'current-source-directory' gracefully handles lack of source info.
    
    * guix/utils.scm (current-source-directory): Add case for when FILE-NAME
    is #f.
---
 guix/utils.scm |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/guix/utils.scm b/guix/utils.scm
index 0e20be3..69f4e78 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -727,9 +727,12 @@ be determined."
           ;; the absolute file name by looking at %LOAD-PATH; doing this at
           ;; run time rather than expansion time is necessary to allow files
           ;; to be moved on the file system.
-          (if (string-prefix? "/" file-name)
-              (dirname file-name)
-              #`(absolute-dirname #,file-name)))
+          (cond ((not file-name)
+                 #f)                ;raising an error would upset Geiser users
+                ((string-prefix? "/" file-name)
+                 (dirname file-name))
+                (else
+                 #`(absolute-dirname #,file-name))))
          (_
           #f))))))
 



reply via email to

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