ASDF2-compatible delfasls

Submitted by Bill St. Clair on Wed, 15 Jun 2011 15:22:47 GMT  <== Lisp ==> 

I use ASDF2 via Quicklisp for a lot of my Lisp work these days (Quicklisp rocks!). I like to keep my systems warning-free, so I recompile often. In order to do that, I've always used a script named delfasls. It was simple when my fasls were stored in the same directory as my code:

find . -name "*.fasl" -delete

ASDF2 stores the fasls in a separate directory, however, so I needed delfasls to be smart about that. Just did that today:

#!/bin/bash

find . -name "*.*fsl" -delete
find . -name "*.fasl" -delete

# Delete the asdf2 cached fasl files for the current directory
DIR=`pwd`
if cd ~/.cache/common-lisp 2>/dev/null; then
  CACHE=`pwd`
  for D in `ls`; do
    FASLDIR="$CACHE/$D$DIR"
    #echo $FASLDIR
    if cd $FASLDIR 2>/dev/null; then
        find . -name "*.*fsl" -delete
        find . -name "*.fasl" -delete
    fi
  done
fi

Add comment Edit post Add post

Comments (3):

Nice

Submitted by Patrick on Wed, 15 Jun 2011 20:41:02 GMT

Nice script Bill. It neatly documents the entire multi-directory caching scheme at a glance. I'm not sure what each $D looks like, but it doesn't really matter does it?

Edit comment

The $D are one directory

Submitted by Bill St. Clair on Thu, 16 Jun 2011 01:31:53 GMT

The $D are one directory for each version of each Lisp implementation, e.g. ccl-1.5-f94-linux-amd64, ccl-1.6-f94-linux-amd64, sbcl-1.0.40.0.debian-linux-x86

Edit comment

find has a -delete action

Submitted by Bill St. Clair on Thu, 23 Jun 2011 13:33:24 GMT

I just learned from a co-worker about find's -delete action, so I changed my script to use it, instead of piping to xargs rm -f.

Edit comment