summaryrefslogtreecommitdiff
path: root/guix/utils.scm
diff options
context:
space:
mode:
authorAlex Sassmannshausen <alex@pompo.co>2019-04-08 15:18:23 +0100
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2019-11-18 13:18:41 +0900
commitb997d43214445462f23947afbbcadf24c6018217 (patch)
treee7422952d6bcaa90b4ed0ed78699dbd832735ba0 /guix/utils.scm
parent9c9982dc0c8c38ce3821b154b7e92509c1564317 (diff)
utils: Handle #f file-name.
* guix/utils.scm (current-source-directory): Change dispatch to handle #f file-name. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Diffstat (limited to 'guix/utils.scm')
-rw-r--r--guix/utils.scm12
1 files changed, 5 insertions, 7 deletions
diff --git a/guix/utils.scm b/guix/utils.scm
index 1f99c5b3f5..64853f2989 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -782,13 +782,11 @@ 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.
- (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
+ (if (string-prefix? "/" file-name)
+ (dirname file-name)
+ #`(absolute-dirname #,file-name)))
+ ((or ('filename . #f) #f)
+ ;; raising an error would upset Geiser users
#f))))))
;; A source location.