components with missing input files

Andreas Fuchs <[email protected]>
Newsgroups gmane.lisp.cclan.general
Message-ID <87pst02qom.wl%[email protected]>
Hi,

deleting a source file in an ASDF system (for example, deleting a
:static-file like the README from the clx distribution) will result in
the error message "Invalid number of arguments: 0". IMHO, asdf should
check that the input files for a component/operation are intact to
give a better error message. This patch does just that:


Have fun,
-- 
Andreas Fuchs, <[email protected]>, [email protected], antifuchs
,asdf:max-nil.patch (application/octet-stream, 1.5 KB)
* looking for [email protected]/sbcl--main--0.9--patch-165 to compare with
* comparing to [email protected]/sbcl--main--0.9--patch-165
M  contrib/asdf/asdf.lisp

* modified files

--- orig/contrib/asdf/asdf.lisp
+++ mod/contrib/asdf/asdf.lisp
@@ -174,6 +174,14 @@
 (define-condition compile-error (operation-error) ())
 (define-condition compile-failed (compile-error) ())
 (define-condition compile-warned (compile-error) ())
+(define-condition missing-input-files (operation-error)
+  ((files :initarg :files :reader missing-input-files))
+  (:report (lambda (c s)
+             (format s "~@<Missing input file~p for operation ~A on ~A: ~S~@:>"
+                     (length (missing-input-files c))
+                     (error-operation c)
+                     (error-component c)
+                     (missing-input-files c)))))
 
 (defclass component ()
   ((name :accessor component-name :initarg :name :documentation
@@ -581,6 +591,11 @@
                                  (mapcar #'file-write-date in-files)) 0)))))
           ((not in-files) nil)
           (t
+           (let ((missing-in-files (delete-if #'probe-file in-files)))
+             (print (delete-if #'probe-file in-files))
+             (when (> (length missing-in-files) 0)
+               (error 'missing-input-files
+                      :operation o :component c :files missing-in-files)))
            (and
             (every #'probe-file out-files)
             (> (apply #'min (mapcar #'file-write-date out-files))
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.