2.019.5: Fixed a minor bug in WEAKLY-DEPENDS-ON handling and added test. 2.019.5
authorRobert P. Goldman <rpgoldman@real-time.com>
Wed, 14 Dec 2011 04:22:13 +0000 (22:22 -0600)
committerRobert P. Goldman <rpgoldman@real-time.com>
Wed, 14 Dec 2011 04:42:01 +0000 (22:42 -0600)
WEAKLY-DEPENDS-ON needed to pass the ERROR-P NIL to FIND-SYSTEM in order
to behave properly.

Added documentation for previously-undocumented weakly-depends-on.

asdf.asd
asdf.lisp
doc/asdf.texinfo
test/test-weakly-depends-on.asd [new file with mode: 0644]
test/test-weakly-depends-on.script [new file with mode: 0644]

index f9609d1..94552ac 100644 (file)
--- a/asdf.asd
+++ b/asdf.asd
@@ -14,7 +14,7 @@
   :licence "MIT"
   :description "Another System Definition Facility"
   :long-description "ASDF builds Common Lisp software organized into defined systems."
-  :version "2.019.4" ;; to be automatically updated by bin/bump-revision
+  :version "2.019.5" ;; to be automatically updated by bin/bump-revision
   :depends-on ()
   :components
   ((:file "asdf")
index e7d2d40..c84e59e 100644 (file)
--- a/asdf.lisp
+++ b/asdf.lisp
@@ -1,5 +1,5 @@
 ;;; -*- mode: Common-Lisp; Base: 10 ; Syntax: ANSI-Common-Lisp -*-
-;;; This is ASDF 2.019.4: Another System Definition Facility.
+;;; This is ASDF 2.019.5: Another System Definition Facility.
 ;;;
 ;;; Feedback, bug reports, and patches are all welcome:
 ;;; please mail to <asdf-devel@common-lisp.net>.
          ;; "2.345.6" would be a development version in the official upstream
          ;; "2.345.0.7" would be your seventh local modification of official release 2.345
          ;; "2.345.6.7" would be your seventh local modification of development version 2.345.6
-         (asdf-version "2.019.4")
+         (asdf-version "2.019.5")
          (existing-asdf (find-class 'component nil))
          (existing-version *asdf-version*)
          (already-there (equal asdf-version existing-version)))
@@ -2793,7 +2793,7 @@ Returns the new tree (which probably shares structure with the old one)"
                          rest)))
            (ret (find-component parent name)))
       (when weakly-depends-on
-        (appendf depends-on (remove-if (complement #'find-system) weakly-depends-on)))
+        (appendf depends-on (remove-if (complement #'(lambda (x) (find-system x nil))) weakly-depends-on)))
       (when *serial-depends-on*
         (push *serial-depends-on* depends-on))
       (if ret ; preserve identity
index d467111..72e4fa0 100644 (file)
@@ -895,7 +895,8 @@ For more details on what these methods do, @pxref{Operations} in
 @example
 system-definition := ( defsystem system-designator @var{system-option}* )
 
-system-option := :defsystem-depends-on system-list 
+system-option := :defsystem-depends-on system-list
+                 | :weakly-depends-on @var{system-list}
                  | :class class-name (see discussion below)
                  | module-option
                  | option
@@ -980,6 +981,7 @@ extension loaded by @code{:defsystem-depends-on}, causing a name
 conflict in the current package.
 
 @subsection Defsystem depends on
+@cindex :defsystem-depends-on
 
 The @code{:defsystem-depends-on} option to @code{defsystem} allows the
 programmer to specify another ASDF-defined system or set of systems that
@@ -987,6 +989,22 @@ must be loaded @emph{before} the system definition is processed.
 Typically this is used to load an ASDF extension that is used in the
 system definition.
 
+@subsection Weakly depends on 
+@cindex :weakly-depends-on
+
+The @code{:weakly-depends-on} option to @code{defsystem} allows the
+programmer to specify another ASDF-defined system or set of systems that
+ASDF should @emph{try} to load, but need not load in order to be
+successful.  Typically this is used if there are a number of systems
+that, if present, could provide additional functionality, but which are
+not necessary for basic function.
+
+Currently, although it is specified to be an option only to
+@code{defsystem}, this option is accepted at any component, but it probably
+only makes sense at the @code{defsystem} level. Programmers are cautioned not
+to use this component option except at the @code{defsystem} level, as
+this anomalous behavior may be removed without warning.
+
 @subsection Pathname specifiers
 @cindex pathname specifiers
 
diff --git a/test/test-weakly-depends-on.asd b/test/test-weakly-depends-on.asd
new file mode 100644 (file)
index 0000000..e5ebf0d
--- /dev/null
@@ -0,0 +1,5 @@
+(defsystem test-weakly-depends-on
+  :weakly-depends-on (does-not-exist)
+  :if-component-dep-fails :ignore
+  :components ((:file "file1")))
+
diff --git a/test/test-weakly-depends-on.script b/test/test-weakly-depends-on.script
new file mode 100644 (file)
index 0000000..5ccab69
--- /dev/null
@@ -0,0 +1,15 @@
+;;; -*- Lisp -*-
+(load "script-support.lisp")
+(load-asdf)
+
+(quit-on-error
+ (setf asdf:*central-registry* '(*default-pathname-defaults*))
+ (asdf:load-system 'test-weakly-depends-on)
+ ;; test that it compiled
+ (let* ((file1 (asdf:compile-file-pathname* "file1"))
+        (file1-date (file-write-date file1)))
+
+   (format t "~&test1 1: ~S ~S~%" file1 file1-date)
+   (assert file1-date)
+   ;; and loaded
+   (assert (symbol-value (find-symbol (symbol-name :*file1*) :test-package)))))