diff --git a/asdf.lisp b/asdf.lisp index 51bb36f7c3a6f2845c3f65adcdde21e3b8e7a52f..ad7094c322d6fa079392d8ceb37fc360e01aec14 100644 --- a/asdf.lisp +++ b/asdf.lisp @@ -248,6 +248,7 @@ #:asdf-version + ;; conditions #:operation-error #:compile-failed #:compile-warned #:compile-error #:error-name #:error-pathname @@ -260,6 +261,7 @@ #:missing-dependency-of-version #:circular-dependency ; errors #:duplicate-names + #:deprecated-system-warning #:try-recompiling #:retry @@ -930,6 +932,17 @@ with given pathname and if it exists return its truename." (define-condition compile-failed (compile-error) ()) (define-condition compile-warned (compile-error) ()) +(define-condition deprecated-system-warning (warning) + ((system + :initarg :system + :reader deprecated-system)) + (:report (lambda (c s) + (with-slots (system) c + (format s "~@<System ~a has been deprecated: ~a~@:>" + (component-name system) + (system-deprecated system)))))) + + (defclass component () ((name :accessor component-name :initarg :name :documentation "Component name: designator for a string composed of portable pathname characters") @@ -1065,16 +1078,23 @@ with given pathname and if it exists return its truename." new-value) (defclass system (module) - ((description :accessor system-description :initarg :description) + (;; metadata slots + (description :accessor system-description :initarg :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 :accessor system-license :initarg :license) + (deprecated :reader system-deprecated :initarg :deprecated + :type (or string null)) + ;; end of metadata slots (source-file :reader system-source-file :initarg :source-file :writer %set-system-source-file) - (defsystem-depends-on :reader system-defsystem-depends-on :initarg :defsystem-depends-on))) + (defsystem-depends-on :reader system-defsystem-depends-on :initarg :defsystem-depends-on)) + ;; FIXME -- I am not sure whether it's more appropriate to have a default-intarg here, or + ;; an initform. Reviewer eyeballs welcomed. [2010/10/22:rpg] + (:default-initargs :deprecated nil)) ;;;; ------------------------------------------------------------------------- ;;;; version-satisfies @@ -2059,6 +2079,8 @@ recursive calls to traverse.") (system (if (typep system 'component) system (find-system system)))) (unless (version-satisfies system version) (error 'missing-component-of-version :requires system :version version)) + (when (system-deprecated system) + (warn 'deprecated-system-warning :system system)) (let ((steps (traverse op system))) (with-compilation-unit () (loop :for (op . component) :in steps :do @@ -3313,6 +3335,7 @@ with a different configuration, so the configuration would be re-read then." (validate-configuration-form form :source-registry 'validate-source-registry-directive "a source registry")) + (defun* validate-source-registry-file (file) (validate-configuration-file file 'validate-source-registry-form "a source registry")) diff --git a/doc/asdf.texinfo b/doc/asdf.texinfo index e1d648f7891161e9496ac40d74b486794147571f..f4b6a894f08a9d8d05e54c2f599a8dcfe25024ee 100644 --- a/doc/asdf.texinfo +++ b/doc/asdf.texinfo @@ -803,9 +803,17 @@ For more details on what these methods do, @pxref{Operations} in system-definition := ( defsystem system-designator @var{system-option}* ) system-option := :defsystem-depends-on system-list + | metadata | module-option | option +metadata := :description string + | :long-description string + | :author string + | :maintainer string + | :license string + | :deprecated string + module-option := :components component-list | :serial [ t | nil ] | :if-component-dep-fails component-dep-fail-option @@ -819,6 +827,7 @@ option := | :operation-done-p method-form | :depends-on ( @var{dependency-def}* ) | :in-order-to ( @var{dependency}+ ) + | :version version-specifier system-list := ( @var{simple-component-name}* ) @@ -850,6 +859,8 @@ method-form := (operation-name qual lambda-list @&rest body) qual := method qualifier component-dep-fail-option := :fail | :try-next | :ignore + +version-string := " @var{digit}+ @{ . @var{digit}+ @} " @end example diff --git a/test/deprecated.asd b/test/deprecated.asd new file mode 100644 index 0000000000000000000000000000000000000000..7846919f9395ca76bfb8adb33ca9fccc00076903 --- /dev/null +++ b/test/deprecated.asd @@ -0,0 +1,13 @@ +;;; -*- Lisp -*- +(asdf:defsystem deprecated + :deprecated "This system is no longer worth the bits it's written on!" + :components ((:file "file2" :in-order-to ((compile-op (load-op "file1")))) + (:file "file1"))) + +#| +1) from clean, check that all fasl files build and that some function + defined in the second file is present + +2) delete the second fasl file, and build again. do test 1 again and + also check the date on file1.fasl +|# diff --git a/test/test-deprecation.script b/test/test-deprecation.script new file mode 100644 index 0000000000000000000000000000000000000000..2858d724e6c1d4b68b8af6bd2fe5031f2ac1d210 --- /dev/null +++ b/test/test-deprecation.script @@ -0,0 +1,19 @@ +;;; -*- Lisp -*- + +(load "script-support") +(load-asdf) + +(quit-on-error + (setf asdf:*central-registry* '(*default-pathname-defaults*)) + (assert (handler-case + (progn + (asdf:load-system 'deprecated :force t) + nil + ) + (asdf:deprecated-system-warning () t))) + (assert (handler-case + (progn + (asdf:load-system 'test1 :force t) + t + ) + (asdf:deprecated-system-warning () nil))))