Local ASDF-Install Sandbox

I needed an installation of ADSF-Install that wouldn’t interfere with system-wide, user-wide or even project-wide settings but that would allow me to fetch Tinaa and document my project. So, I want to create ASDF-install sandbox that would be completely self-contained. And I did. Here’s how:

First, download ASDF-Install from darcs:

darcs get http://common-lisp.net/project/asdf-install/darcs/asdf-install

Downloaded ASDF-install directory will be our sandox (yes, the self-contained sandbox is this self-contained it uses own local copy of ASDF-Install itself). Now, let’s create place for downloaded systems in sandbox and, to avoid overpopulating ASDF:*CENTRAL-REGISTRY*, symlink asdf-install itself there:

cd asdf-install
mkdir site/ systems/
cd systems/
ln -s ../asdf-install/*.asd .

Next, copy following file into sandbox directory as load.lisp:

(flet
    ((load-subdir (name)
       (make-pathname
        :name nil :type nil :version nil
        :defaults
        (merge-pathnames (concatenate 'string name "/")
                         *load-truename*)))
     (a-i-symbol (name)
       (intern (string name)
               (find-package #.(string '#:asdf-install)))))
  (pushnew (load-subdir "systems") asdf:*central-registry*)
  (asdf:operate 'asdf:load-op :asdf-install)
  (setf (symbol-value (a-i-symbol '#:*locations*))        
        `((,(load-subdir "site")
            ,(load-subdir "systems")
            "Semi-local installation")))
  (push '(:absolute "bin")
        (symbol-value (a-i-symbol '#:*shell-search-paths*))))

Ready, as my C64 used to say. Now, load load.lisp and enjoy.