X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Ftarget-pathname.lisp;fp=src%2Fcode%2Ftarget-pathname.lisp;h=b791566bd8ce2aa153b9ae3ce52516229a6f275b;hb=1a61f069111cb6f7263852b73eea1bd8cda9ef68;hp=ff023ee7cc604f7862979d41d70af838483964df;hpb=e072a8570d0fc3513ec7639b9c1c5d3b03e2695e;p=sbcl.git diff --git a/src/code/target-pathname.lisp b/src/code/target-pathname.lisp index ff023ee..b791566 100644 --- a/src/code/target-pathname.lisp +++ b/src/code/target-pathname.lisp @@ -1767,3 +1767,29 @@ experimental and subject to change." `(("SYS:SRC;**;*.*.*" ,src) ("SYS:CONTRIB;**;*.*.*" ,contrib) ("SYS:OUTPUT;**;*.*.*" ,output))))) + +(defun set-sbcl-source-location (pathname) + "Initialize the SYS logical host based on PATHNAME, which should be +the top-level directory of the SBCL sources. This will replace any +existing translations for \"SYS:SRC;\", \"SYS:CONTRIB;\", and +\"SYS:OUTPUT;\". Other \"SYS:\" translations are preserved." + (let ((truename (truename pathname)) + (current-translations + (remove-if (lambda (translation) + (or (pathname-match-p "SYS:SRC;" translation) + (pathname-match-p "SYS:CONTRIB;" translation) + (pathname-match-p "SYS:OUTPUT;" translation))) + (logical-pathname-translations "SYS") + :key #'first))) + (flet ((physical-target (component) + (merge-pathnames + (make-pathname :directory (list :relative component + :wild-inferiors) + :name :wild + :type :wild) + truename))) + (setf (logical-pathname-translations "SYS") + `(("SYS:SRC;**;*.*.*" ,(physical-target "src")) + ("SYS:CONTRIB;**;*.*.*" ,(physical-target "contrib")) + ("SYS:OUTPUT;**;*.*.*" ,(physical-target "output")) + ,@current-translations)))))