aboutsummaryrefslogtreecommitdiff
path: root/src/data.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-03-27 13:44:51 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-03-27 14:29:20 -0700
commit0924619a15e0c01499dbefed2fad29686e876c2e (patch)
tree9f3b92b05557925bbd2da50e7c39fe7176c76003 /src/data.lisp
parentc62eac2c5ceee606c9fab36a2c35330b0f8fa70c (diff)
downloadconsfigurator-0924619a15e0c01499dbefed2fad29686e876c2e.tar.gz
resolve relative pathnames passed to TRY-REGISTER-DATA-SOURCE
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/data.lisp')
-rw-r--r--src/data.lisp11
1 files changed, 10 insertions, 1 deletions
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)