root/trunk/thirdparty/asdf/wild-modules.lisp

Revision 2236, 1.7 kB (checked in by hhubner, 1 year ago)

update asdf from cvs

Line 
1 (in-package :asdf)
2
3 (defclass wild-module (module)
4   ((component-class :accessor wild-module-component-class
5                     :initform 'static-file :initarg :component-class)
6    (component-options :accessor wild-module-component-options
7                       :initform nil :initarg :component-options)))
8
9 (defmethod (setf module-components) (new-value (module wild-module))
10   (when  new-value
11     (sysdef-error "Cannot explicitly set wild-module ~A's components. Please ~
12 use a wild pathname instead." module)))
13
14 (defmethod reinitialize-instance :after ((self wild-module) &key)
15   (let ((pathname (slot-value self 'relative-pathname)))
16     (and pathname
17          (not (wild-pathname-p pathname))
18          (sysdef-error "Wild-module ~A specified with non-wild pathname ~A."
19                        self pathname))
20     (setf (slot-value self 'components)
21           (let* ((*default-pathname-defaults* (component-parent-pathname self))
22                  (files (directory (merge-pathnames (component-relative-pathname self))))
23                  (class (wild-module-component-class self))
24                  (options (wild-module-component-options self)))
25             (mapcar (lambda (file)
26                       (apply #'make-instance class
27                              :name (file-namestring file)
28                                         ;; XXX fails when wildcards are in
29                                         ;; the directory or higher parts.
30                              :pathname file
31                              :parent self
32                              options))
33                     files)))))
34
35 ;; Don't export wild-module or else will get a full warning
36 ;; when (require 'asdf) if asdf is already loaded
37
38 ;;(export '(wild-module))
Note: See TracBrowser for help on using the browser.