From 0924619a15e0c01499dbefed2fad29686e876c2e Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 27 Mar 2021 13:44:51 -0700 Subject: resolve relative pathnames passed to TRY-REGISTER-DATA-SOURCE Signed-off-by: Sean Whitton --- src/data.lisp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/data.lisp') diff --git a/src/data.lisp b/src/data.lisp index 7cce283..2c3a7d9 100644 --- a/src/data.lisp +++ b/src/data.lisp @@ -98,7 +98,16 @@ sources are not expected to be available outside of the root Lisp.")) (defun try-register-data-source (&rest args) "Register sources of prerequisite data. -This function is typically called in consfigs." +This function is typically called in consfigs. Any relative pathnames in ARGS +will be resolved as paths under the home directory of the user Lisp is running +as, before being passed to implementations of REGISTER-DATA-SOURCE." + (let ((home (user-homedir-pathname))) + (setq args + (loop + for arg in args + if (pathnamep arg) + collect (ensure-pathname arg :defaults home :ensure-absolute t) + else collect arg))) (when-let ((pair (and (not (find args *data-source-registrations* :test #'equal)) (restart-case (apply #'register-data-source args) -- cgit v1.2.3