Re: load-source-op

Michael Livshin <[email protected]>
Newsgroups gmane.lisp.cclan.general
Organization The Church of God the Utterly Indifferent
Message-ID <[email protected]>
hi Kevin!

Kevin Rosenberg <[email protected]> writes:

> I created a simple test case. Both in the current asdf code, and also
> using the patch that you sent to me, 'load-source-op is not working
> correctly.

well, the patch *is* a hack, and worked only with the released version
of asdf...

here's the one I'm using now, which works with the current asdf (both
for your testcase and for my needs) (I called the operation
'load-without-compiling-op, so that it doesn't conflict with the
"real" 'load-source-op):

(in-package #:asdf)

(defclass load-without-compiling-op (operation) ())

(export '(load-without-compiling-op))

(defmethod perform ((o load-without-compiling-op) (c cl-source-file))
  (let ((source (component-pathname c)))
    (setf (component-property c 'last-loaded-as-source)
          (and (load source)
               (get-universal-time)))))

(defmethod perform ((operation load-without-compiling-op) (c static-file))
  nil)

(defmethod output-files ((operation load-without-compiling-op) (c component))
  nil)

;;; FIXME: we simply copy load-op's dependencies.  this is Just Not Right.
(defmethod component-depends-on ((o load-without-compiling-op) (c component))
  (let ((what-would-load-op-do (cdr (assoc 'load-op
                                           (slot-value c 'in-order-to)))))
    (mapcar (lambda (dep)
              (if (eq (car dep) 'load-op)
                  (cons 'load-without-compiling-op (cdr dep))
                  dep))
            what-would-load-op-do)))

(defmethod operation-done-p ((o load-without-compiling-op) (c source-file))
  (if (or (not (component-property c 'last-loaded-as-source))
	  (> (file-write-date (component-pathname c))
	     (component-property c 'last-loaded-as-source)))
      nil t))



-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger 
for complex code. Debugging C/C++ programs can leave you feeling lost and 
disoriented. TotalView can help you find your way. Available on major UNIX 
and Linux platforms. Try it free. www.etnus.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.