3 ;; author: cyrus harmon
8 (defun unix-name (pathname)
11 (logical-pathname (translate-logical-pathname pathname
))
14 (defun absolute-path-p (path)
15 (when (listp (pathname-directory path
))
16 (eql (car (car (pathname-directory path
)))
19 (defun asdf-lookup (path)
20 (cond ((and path
(listp path
))
21 (reduce #'asdf
:find-component
(cdr path
)
22 :initial-value
(asdf:find-system
(car path
))))
24 (let ((uri (puri:parse-uri path
)))
26 (let ((scheme (puri:uri-scheme uri
)))
27 (when (and (or (null scheme
)
29 (puri:uri-parsed-path uri
))
30 (asdf-lookup (cdr (puri:uri-parsed-path uri
))))))))))
32 (defun asdf-lookup-path (path)
33 (component-pathname (asdf-lookup path
)))
35 (defun merge-asdf-path (name path
)
36 (merge-pathnames name
(asdf-lookup-path path
)))
38 (defmacro with-component-directory
((component) &body body
)
39 `(ch-util::with-current-directory
41 :directory
(pathname-directory
42 (component-pathname ,component
)))
45 (flet ((asdf-op (op component
)
48 (asdf:operate
'asdf
:load-op
(asdf-lookup component
)))
49 (t (asdf:operate
'asdf
:load-op component
)))))
50 (defun asdf-load (component)
51 (asdf-op 'asdf
:load-op component
))
52 (defun asdf-compile (component)
53 (asdf-op 'asdf
:compile-op component
)))