[slime-cvs] CVS slime

CVS User heller heller at common-lisp.net
Sat Dec 10 12:33:28 UTC 2011


Update of /project/slime/cvsroot/slime
In directory tiger.common-lisp.net:/tmp/cvs-serv29573

Modified Files:
	ChangeLog swank-loader.lisp 
Log Message:
* swank-loader.lisp (delete-stale-contrib-fasl-files): New.
(compile-contribs): Use it.

--- /project/slime/cvsroot/slime/ChangeLog	2011/12/09 11:02:03	1.2281
+++ /project/slime/cvsroot/slime/ChangeLog	2011/12/10 12:33:28	1.2282
@@ -1,3 +1,8 @@
+2011-12-10  Helmut Eller  <heller at common-lisp.net>
+
+	* swank-loader.lisp (delete-stale-contrib-fasl-files): New.
+	(compile-contribs): Use it.
+
 2011-12-09  Helmut Eller  <heller at common-lisp.net>
 
 	Create an extra thread for the indentation cache.
--- /project/slime/cvsroot/slime/swank-loader.lisp	2011/12/04 15:05:41	1.113
+++ /project/slime/cvsroot/slime/swank-loader.lisp	2011/12/10 12:33:28	1.114
@@ -10,13 +10,12 @@
 
 ;; If you want customize the source- or fasl-directory you can set
 ;; swank-loader:*source-directory* resp. swank-loader:*fasl-directory*
-;; before loading this files. (you also need to create the
-;; swank-loader package.)
+;; before loading this files. 
 ;; E.g.:
 ;;
-;;   (make-package :swank-loader)
-;;   (defparameter swank-loader::*fasl-directory* "/tmp/fasl/")
 ;;   (load ".../swank-loader.lisp")
+;;   (setq swank-loader::*fasl-directory* "/tmp/fasl/")
+;;   (swank-loader:init)
 
 (cl:defpackage :swank-loader
   (:use :cl)
@@ -242,11 +241,24 @@
            (list (contrib-dir fasl-dir)
                  (contrib-dir src-dir))))
 
+(defun delete-stale-contrib-fasl-files (swank-files contrib-files fasl-dir)
+  (let ((newest (reduce #'max (mapcar #'file-write-date swank-files))))
+    (dolist (src contrib-files)
+      (let ((fasl (binary-pathname src fasl-dir)))
+        (when (and (probe-file fasl)
+                   (<= (file-write-date fasl) newest))
+          (delete-file fasl))))))
+
 (defun compile-contribs (&key (src-dir (contrib-dir *source-directory*))
-                         (fasl-dir (contrib-dir *fasl-directory*))
-                         load)
-  (compile-files (src-files *contribs* src-dir) fasl-dir load))
-  
+                           (fasl-dir (contrib-dir *fasl-directory*))
+                           (swank-src-dir *source-directory*)
+                           load)
+  (let* ((swank-src-files (src-files *swank-files* swank-src-dir))
+         (contrib-src-files (src-files *contribs* src-dir)))
+    (delete-stale-contrib-fasl-files swank-src-files contrib-src-files 
+                                     fasl-dir)
+    (compile-files contrib-src-files fasl-dir load)))
+
 (defun loadup ()
   (load-swank)
   (compile-contribs :load t))





More information about the slime-cvs mailing list