[asdf-devel] creating a distribution using asdf

Faré fahree at gmail.com
Fri Dec 31 00:52:10 UTC 2010


>> (defun all-files-for-system (system)
>>   (loop :for (operation . component) :in (all-steps-for-system system)
>>      :for output-files = (asdf:output-files operation component)
>>      :append output-files))
>
> this is a good start: I can take all files in the list up to the file
> which I actually need.
> however, this might include files which I don't need.
> e.g., supposed my system includes file A,B,C and B&C depend on A but not
> on each other.

Unhappily, ASDF isn't designed to deal with individual files as targets.
(XCVB is, but that might not doesn't help you much unless you convert
all the dependencies to use XCVB, which is easy in the easy case, but
can be work in the hard case).

(defun all-steps-for-component (component)
  (asdf::traverse
    (make-instance 'asdf:load-op :force t)
    (asdf:find-component component nil)))

(defun all-files-for-component (component)
  (loop :for (operation . component) :in (all-steps-for-component component)
        :for output-files = (asdf:output-files operation component)
        :append output-files))

You could kind of do it manually: first use all-files-for-component to
collect the files for all the dependencies for each of the systems
that your system depends on, then use
     (all-files-for-component '(:foo "module" "file"))
e.g.
     (all-files-for-component '(:fare-utils "base" "macros"))
to get the dependencies for the specific file within the system.
Concatenate the whole thing, and finally use remove-duplicates :from-end t.
Good luck!

[ François-René ÐVB Rideau | Reflection&Cybernethics | http://fare.tunes.org ]
Reality must take precedence over public relations,
for Mother Nature cannot be fooled.
		— R.P. Feynman




More information about the asdf-devel mailing list