Ignore:
Timestamp:
Jun 12, 2009, 4:44:25 PM (10 years ago)
Author:
gb
Message:

If ASDF is loaded, try to use it to provide modules.
(I'm not necessarily advocating this and haven't even tested this
code, which tries to lookup ASDF-package symbols at runtime. We
used to ship a custom ASDF that did this, but that change got lost
in a merge. We can always have a *PROVIDE-USING-ASDF* flag that
controls whether the ASDF provider function works, but it seems better
to have the functionality in the lisp than to wrestle with getting
it in the upstream ASDF.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/l1-files.lisp

    r11988 r12260  
    13811381
    13821382(defparameter *loading-modules* () "Internal. Prevents circularity")
    1383 (defparameter *module-provider-functions* '(module-provide-search-path)
     1383(defparameter *module-provider-functions* '(module-provide-search-path module-provide-asdf)
    13841384  "A list of functions called by REQUIRE to satisfy an unmet dependency.
    13851385Each function receives a module name as a single argument; if the function knows how to load that module, it should do so, add the module's name as a string to *MODULES* (perhaps by calling PROVIDE) and return non-NIL."
     
    14421442                  (return path)))))))
    14431443
     1444(defun module-provide-asdf (module)
     1445  (let* ((asdf-package (find-package "ASDF")))
     1446    (when asdf-package
     1447      (let* ((verbose-out (find-symbol "*VERBOSE-OUT*" asdf-package))
     1448             (find-system (find-symbol "FIND-SYSTEM" asdf-package))
     1449             (operate (find-symbol "OPERATE" asdf-package))
     1450             (load-op (find-symbol "LOAD-OP" asdf-package)))
     1451        (when (and verbose-out find-system operate load-op)
     1452          (progv (list verbose-out) (list (make-broadcast-stream))
     1453            (let* ((system (funcall find-system module nil)))
     1454              (when system
     1455                (funcall operate load-op module)
     1456                t))))))))
     1457
    14441458(defun wild-pathname-p (pathname &optional field-key)
    14451459  "Predicate for determining whether pathname contains any wildcards."
Note: See TracChangeset for help on using the changeset viewer.