I didn't understand how to make a delivered Lisp image (where the source
directory may have moved or not be accessible) play well with the
versioning of CSS and JS files, which tries to grovel around in the source
directory to see if the files have been modified. This obviously won't
work if the source directory has moved.

My workaround was to put in a horrible ignore-errors. However, this is
clearly not a principled approach to solving the problem, and opens up a
whole festival of security issues as if someone finds out the path where
the application source resided when it was built, they could put files
there to subvert the client browser :-(

Is there a way of defining where the source of CSS and JS files should
be put which doesn't involve mucking about with ASDF (not popular
in delivered images)?


diff -r efc83a14156b src/versioning.lisp
--- a/src/versioning.lisp       Wed Jul 15 18:01:35 2009 +0200
+++ b/src/versioning.lisp       Fri Aug 07 14:03:09 2009 +0900
@@ -85,11 +85,14 @@
 (defun update-versioned-dependency-path (original-path &optional other-path)
   "If the file has been modified, it is copied and renamed with the correct 
version number in the same directory. If the file has never being modified 
before, its name is kept the same."
   (bordeaux-threads:with-lock-held (*version-dependencies-lock*)
-    (let ((mod-record (get-mod-record original-path :versioning-p t)))
-      (when (file-modified-p mod-record) (update-mod-record mod-record 
:versioning-p t))
-      (with-slots (last-version) mod-record
-       (values (make-versioned-path original-path last-version)
-               (make-versioned-path other-path last-version))))))
+    (let ((mod-record (ignore-errors (get-mod-record original-path 
:versioning-p t))))
+      (cond (mod-record
+            (when (file-modified-p mod-record) (update-mod-record mod-record 
:versioning-p t))
+            (with-slots (last-version) mod-record
+              (values (make-versioned-path original-path last-version)
+                      (make-versioned-path other-path last-version))))
+           (t
+            (values original-path other-path))))))
 
 
 ;;; Dealing with CSS import rules

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"weblocks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/weblocks?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to