|
| |||
|
opening it up with Common Lisp |
|||
|
Favorite weblogs Lisp Related Politics Other home Recent Readings
Book review: Darwinia
Summer reading: Spin
Runner
the Omnivoire's Delimma
the Golem's Eye |
|
Somewhat pointless fun: ASDF-Install dependencies I realized sometime yesterday that ASDF-Install-Tester was collecting all of the information I needed to build a ASDF systems dependency graph. Here is a portion of it:
The whole thing includes only the systems that I was actually able to download but it still provides a good representation sample of the ASDF-Installable package universe. FWIW, here is the code I used to make the dot file that I gave to GraphViz. (in-package asdf-status) (defparameter *mcl-systems* (remove-if #'atom (mapcar (lambda (f) (with-open-file (in f) (handler-case (aprog1 (read in nil nil) (when (atom it) (warn "Parse error: ~A" f))) (error () (warn "Read error: ~A" f))))) (directory (make-pathname :name :wild :type "ait" :directory `(,@(pathname-directory *input-directory*) "openmcl" :wild-inferiors) :defaults *input-directory*))))) (defparameter *dependent-systems* (remove-if (lambda (system-info) (null (getf system-info :depends-on))) *mcl-systems*)) First, we read in all the system information that ASDF-Install-Tester saved in little AIT files. I just grab the OpenMCL files and filter out anything that doesn't look correct (because of ASDF-Install-Tester bugs, I suspect) and anything that has no dependencies. (defmethod coerce-system-name ((name string)) (string-downcase name)) (defmethod coerce-system-name ((name symbol)) (coerce-system-name (symbol-name name))) (defparameter *systems-graph* (let ((g (cl-graph:make-graph 'cl-graph:graph-container :vertex-test #'equal))) (iterate-elements *dependent-systems* (lambda (system-info) (let ((system (coerce-system-name (getf system-info :install)))) (cl-graph:add-vertex g system) (iterate-elements (getf system-info :depends-on) (lambda (other) (cl-graph:add-edge-between-vertexes g (coerce-system-name other) system :edge-type :directed)))))) g)) #+Export (cl-graph:graph->dot *systems-graph* "user-home:docs;foo.dot" :vertex-labeler (lambda (v s) (princ (element v) s)) :vertex-formatter (lambda (v s) (format s "URL=\"http://www.cliki.net/~(~A~)\"" (element v)))) Then we can build the graph and output to a dot format. | |
|
|
Home | About | Quotes | Recent | Archives Copyright -- Gary Warren King, 2004 - 2006 |