Commit cf352002 authored by Robert P. Goldman's avatar Robert P. Goldman

Added :deprecated slot on system, documented and tested.

parent e3c0b6b2
......@@ -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"))
......
......@@ -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
......
;;; -*- 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
|#
;;; -*- 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))))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment