Finding depended-upon systems

Faré fahree at gmail.com
Tue Nov 17 21:10:53 UTC 2015


On Tue, Nov 17, 2015 at 3:37 PM, Robert Goldman <rpgoldman at sift.net> wrote:
> This seems like it might be a good FAQ, and we had some correspondence
> about a related query earlier.
>
> (sort (mapcar #'asdf:component-name
>                        (mapcar #'cdr
>                                (remove-if-not #'(lambda (x) (and (typep
> (cdr x) 'asdf/system:system) (typep (car x) 'asdf:load-op)))
>                                               (asdf::traverse
> (make-instance 'asdf::load-op) (asdf:find-system "hunchentoot") :force
> :all))))
>                #'string-lessp)
>
> This requires knowing a bit about the internals of ASDF and relies on an
> obsoleted function (TRAVERSE).
>
> Maybe we should wrap this up and provide it as part of an ASDF query API?
>
I believe that this should work:
((lambda (x) (sort (mapcar (lambda (a) (asdf:coerce-name (cdr a)) x 'string<)
 (asdf::required-components :hunchentoot :keep-component 'asdf:system
:other-systems t))

Actually, it won't work if you have direct dependencies from
non-system components to systems, but that's strongly frowned upon and
should probably be prevented by some future ASDF.

—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org
I'd rather write programs that write programs than write programs — Dick Sites



More information about the asdf-devel mailing list