opening it up with Common Lisp

Favorite weblogs

Lisp Related

Bill Clementson

Finding Lisp

Lemonodor

Lispmeister.com

Planet Lisp

Politics

Orcinus

Talking Points Memo

This Modern World

Working for Change

Other home

Polliblog

Recent Readings

Book review: Darwinia
Reviewed: Friday, August 11, 2006

Summer reading: Spin
Reviewed: Saturday, August 5, 2006

Runner
Reviewed: Tuesday, July 18, 2006

the Omnivoire's Delimma
Reviewed: Wednesday, July 12, 2006

the Golem's Eye
Reviewed: Wednesday, May 31, 2006





tinderbox
 width=

Somewhat pointless fun: ASDF-Install dependencies
Tuesday, December 27, 2005

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