utils: 'current-source-directory' gracefully deals with lack of location info.
* guix/utils.scm (current-source-directory): Adjust for when 'syntax-source' returns #f.
This commit is contained in:
parent
d209ce434f
commit
82781d871f
@ -700,7 +700,7 @@ failure."
|
|||||||
be determined."
|
be determined."
|
||||||
(syntax-case s ()
|
(syntax-case s ()
|
||||||
((_)
|
((_)
|
||||||
(match (assq 'filename (syntax-source s))
|
(match (assq 'filename (or (syntax-source s) '()))
|
||||||
(('filename . (? string? file-name))
|
(('filename . (? string? file-name))
|
||||||
;; If %FILE-PORT-NAME-CANONICALIZATION is 'relative, then FILE-NAME
|
;; If %FILE-PORT-NAME-CANONICALIZATION is 'relative, then FILE-NAME
|
||||||
;; can be relative. In that case, we try to find out at run time
|
;; can be relative. In that case, we try to find out at run time
|
||||||
@ -713,7 +713,7 @@ be determined."
|
|||||||
(dirname file-name))
|
(dirname file-name))
|
||||||
(else
|
(else
|
||||||
#`(absolute-dirname #,file-name))))
|
#`(absolute-dirname #,file-name))))
|
||||||
(_
|
(#f
|
||||||
#f))))))
|
#f))))))
|
||||||
|
|
||||||
;; A source location.
|
;; A source location.
|
||||||
|
Loading…
Reference in New Issue
Block a user