X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=contrib%2Fasdf%2Fasdf.lisp;h=9536f92406922fcfdd5ffe0c798687f3e3836ec6;hb=ecae2f9323086c64d026d4ce719590907f486c63;hp=a2e61e18898c092d5ae4dc9dc4ff093d27c86392;hpb=9f8b254664d2864ae524c3a12c912437accfdb20;p=sbcl.git diff --git a/contrib/asdf/asdf.lisp b/contrib/asdf/asdf.lisp index a2e61e1..9536f92 100644 --- a/contrib/asdf/asdf.lisp +++ b/contrib/asdf/asdf.lisp @@ -1,4 +1,4 @@ -;;; This is asdf: Another System Definition Facility. 1.72 +;;; This is asdf: Another System Definition Facility. 1.79 ;;; ;;; Feedback, bug reports, and patches are all welcome: please mail to ;;; . But note first that the canonical @@ -71,15 +71,33 @@ #:component-property #:component-depends-on + + #:system-description + #:system-long-description + #:system-author + #:system-maintainer + #:system-license + + #:operation-on-warnings + #:operation-on-failure ;#:*component-parent-pathname* + #:*system-definition-search-functions* #:*central-registry* ; variables + #:*compile-file-warnings-behaviour* + #:*compile-file-failure-behaviour* + #:*asdf-revision* #:operation-error #:compile-failed #:compile-warned #:compile-error + #:error-component #:error-operation #:system-definition-error #:missing-component #:missing-dependency #:circular-dependency ; errors + + #:retry + #:accept ; restarts + ) (:use :cl)) @@ -89,7 +107,7 @@ (in-package #:asdf) -(defvar *asdf-revision* (let* ((v "1.72") +(defvar *asdf-revision* (let* ((v "1.79") (colon (or (position #\: v) -1)) (dot (position #\. v))) (and v colon dot @@ -98,8 +116,10 @@ (parse-integer v :start (1+ dot) :junk-allowed t))))) -(defvar *compile-file-warnings-behaviour* :warn) -(defvar *compile-file-failure-behaviour* #+sbcl :error #-sbcl :warn) +(defvar *compile-file-warnings-behaviour* :warn) +(defvar *compile-file-failure-behaviour* #+sbcl :error #-sbcl :warn) + +(defvar *verbose-out* nil) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; utility stuff @@ -244,22 +264,21 @@ and NIL NAME and TYPE components" (defgeneric component-property (component property)) (defmethod component-property ((c component) property) - (cdr (assoc property (slot-value c 'properties)))) + (cdr (assoc property (slot-value c 'properties) :test #'equal))) (defgeneric (setf component-property) (new-value component property)) (defmethod (setf component-property) (new-value (c component) property) - (let ((a (assoc property (slot-value c 'properties)))) + (let ((a (assoc property (slot-value c 'properties) :test #'equal))) (if a (setf (cdr a) new-value) (setf (slot-value c 'properties) (acons property new-value (slot-value c 'properties)))))) - - (defclass system (module) ((description :accessor system-description :initarg :description) - (long-description :accessor long-description :initarg :long-description) + (long-description + :accessor system-long-description :initarg :long-description) (author :accessor system-author :initarg :author) (maintainer :accessor system-maintainer :initarg :maintainer) (licence :accessor system-licence :initarg :licence))) @@ -347,7 +366,7 @@ and NIL NAME and TYPE components" (< (car in-memory) (file-write-date on-disk)))) (let ((*package* (make-package (gensym (package-name #.*package*)) :use '(:cl :asdf)))) - (format t + (format *verbose-out* (formatter "~&~@<; ~@;loading system definition from ~A into ~A~@:>~%") ;; FIXME: This wants to be (ENOUGH-NAMESTRING ;; ON-DISK), but CMUCL barfs on that. @@ -361,7 +380,8 @@ and NIL NAME and TYPE components" (if error-p (error 'missing-component :requires name)))))) (defun register-system (name system) - (format t (formatter "~&~@<; ~@;registering ~A as ~A~@:>~%") system name) + (format *verbose-out* + (formatter "~&~@<; ~@;registering ~A as ~A~@:>~%") system name) (setf (gethash (coerce-name name) *defined-systems*) (cons (get-universal-time) system))) @@ -664,7 +684,7 @@ system.")) nil) (defmethod explain ((operation operation) (component component)) - (format *trace-output* "~&;;; ~A on ~A~%" + (format *verbose-out* "~&;;; ~A on ~A~%" operation component)) ;;; compile-op @@ -694,14 +714,18 @@ system.")) ;(declare (ignore output)) (when warnings-p (case (operation-on-warnings operation) - (:warn (warn "COMPILE-FILE warned while performing ~A on ~A" - c operation)) + (:warn (warn + (formatter "~@") + operation c)) (:error (error 'compile-warned :component c :operation operation)) (:ignore nil))) (when failure-p (case (operation-on-failure operation) - (:warn (warn "COMPILE-FILE failed while performing ~A on ~A" - c operation)) + (:warn (warn + (formatter "~@") + operation c)) (:error (error 'compile-failed :component c :operation operation)) (:ignore nil))) (unless output @@ -778,6 +802,10 @@ system.")) (defun operate (operation-class system &rest args) (let* ((op (apply #'make-instance operation-class :original-initargs args args)) + (*verbose-out* + (if (getf args :verbose t) + *trace-output* + (make-broadcast-stream))) (system (if (typep system 'component) system (find-system system))) (steps (traverse op system))) (with-compilation-unit () @@ -786,8 +814,23 @@ system.")) (restart-case (progn (perform op component) (return)) - (retry-component ()) - (skip-component () (return)))))))) + (retry () + :report + (lambda (s) + (format s + (formatter "~@") + op component))) + (accept () + :report + (lambda (s) + (format s + (formatter "~@") + op component)) + (setf (gethash (type-of op) + (component-operation-times component)) + (get-universal-time)) + (return)))))))) (defun oos (&rest args) "Alias of OPERATE function" @@ -829,7 +872,7 @@ system.")) :pathname (or ,pathname (pathname-sans-name+type - (resolve-symlinks *load-truename*)) + (resolve-symlinks *load-truename*)) *default-pathname-defaults*) ',component-options)))))) @@ -975,40 +1018,40 @@ Returns the new tree (which probably shares structure with the old one)" (defun run-shell-command (control-string &rest args) "Interpolate ARGS into CONTROL-STRING as if by FORMAT, and synchronously execute the result using a Bourne-compatible shell, with -output to *trace-output*. Returns the shell's exit code." +output to *verbose-out*. Returns the shell's exit code." (let ((command (apply #'format nil control-string args))) - (format *trace-output* "; $ ~A~%" command) + (format *verbose-out* "; $ ~A~%" command) #+sbcl (sb-impl::process-exit-code (sb-ext:run-program "/bin/sh" (list "-c" command) - :input nil :output *trace-output*)) + :input nil :output *verbose-out*)) #+(or cmu scl) (ext:process-exit-code (ext:run-program "/bin/sh" (list "-c" command) - :input nil :output *trace-output*)) + :input nil :output *verbose-out*)) #+allegro - (excl:run-shell-command command :input nil :output *trace-output*) + (excl:run-shell-command command :input nil :output *verbose-out*) #+lispworks (system:call-system-showing-output command :shell-type "/bin/sh" - :output-stream *trace-output*) + :output-stream *verbose-out*) - #+clisp ;XXX not exactly *trace-output*, I know + #+clisp ;XXX not exactly *verbose-out*, I know (ext:run-shell-command command :output :terminal :wait t) #+openmcl (nth-value 1 (ccl:external-process-status (ccl:run-program "/bin/sh" (list "-c" command) - :input nil :output *trace-output* + :input nil :output *verbose-out* :wait t))) #-(or openmcl clisp lispworks allegro scl cmu sbcl) @@ -1034,10 +1077,12 @@ output to *trace-output*. Returns the shell's exit code." #+(and sbcl sbcl-hooks-require) (progn (defun module-provide-asdf (name) - (let ((system (asdf:find-system name nil))) - (when system - (asdf:operate 'asdf:load-op name) - t))) + (handler-bind ((style-warning #'muffle-warning)) + (let* ((*verbose-out* (make-broadcast-stream)) + (system (asdf:find-system name nil))) + (when system + (asdf:operate 'asdf:load-op name) + t)))) (pushnew '(merge-pathnames "systems/" @@ -1055,3 +1100,5 @@ output to *trace-output*. Returns the shell's exit code." *central-registry*) (pushnew 'module-provide-asdf sb-ext:*module-provider-functions*)) + +(provide 'asdf)