diff --git a/asdf.lisp b/asdf.lisp index 34eb0d0..43e5bd0 100644 --- a/asdf.lisp +++ b/asdf.lisp @@ -848,7 +848,9 @@ actually-existing directory." (licence :accessor system-licence :initarg :licence :accessor system-license :initarg :license) (source-file :reader system-source-file :initarg :source-file - :writer %set-system-source-file))) + :writer %set-system-source-file) + (logical-hostname :reader system-logical-hostname :initarg :logical-hostname + :initform nil))) ;;;; ------------------------------------------------------------------------- ;;;; version-satisfies @@ -1749,11 +1751,24 @@ details." *load-pathname*))) *default-pathname-defaults*)) +(defun set-asdf-system-hostname (system logical-host pathname) + (setf (logical-pathname-translations logical-host) + (list (list + "**;*.*.*" + (merge-pathnames + (make-pathname :type :wild + :name :wild + :directory (list :relative :wild-inferiors)) + (make-pathname :directory (pathname-directory pathname) + :host (pathname-host pathname) + :device (pathname-device pathname))))))) + (defmacro defsystem (name &body options) (destructuring-bind (&key (pathname nil pathname-arg-p) (class 'system) + (logical-host nil) &allow-other-keys) options - (let ((component-options (remove-keyword :class options))) + (let ((component-options (remove-keys '(:logical-host :class) options))) `(progn ;; system must be registered before we parse the body, otherwise ;; we recur when trying to find an existing system of the same name @@ -1766,6 +1781,11 @@ details." (t (register-system (quote ,name) (make-instance ',class :name ',name)))) + ,(when logical-host + `(set-asdf-system-hostname + (cdr (system-registered-p ',name)) + ',logical-host + ',(determine-system-pathname pathname pathname-arg-p))) (%set-system-source-file *load-truename* (cdr (system-registered-p ',name)))) (parse-component-form