diff options
author | Ludovic Courtès <ludo@gnu.org> | 2016-06-19 22:30:34 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2016-06-20 00:52:53 +0200 |
commit | a68d0f6fd5a93dc80fe9d919413f5d3e8db2a5b4 (patch) | |
tree | 3595242a64446bdbad8a711978cde431f454e8e1 | |
parent | cbbbb7be0fbaa11ff75bce92f2d82131ff8db104 (diff) | |
download | patches-a68d0f6fd5a93dc80fe9d919413f5d3e8db2a5b4.tar patches-a68d0f6fd5a93dc80fe9d919413f5d3e8db2a5b4.tar.gz |
utils: 'current-source-directory' gracefully handles lack of source info.
* guix/utils.scm (current-source-directory): Add case for when FILE-NAME
is #f.
-rw-r--r-- | guix/utils.scm | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/guix/utils.scm b/guix/utils.scm index 0e20be3c18..69f4e78a85 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)))))) |