Skip to content

Commit

Permalink
Support multiple local project directories.
Browse files Browse the repository at this point in the history
  • Loading branch information
xach committed Nov 4, 2011
1 parent cfd745a commit 5e4a19f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
15 changes: 8 additions & 7 deletions local-projects.lisp
Expand Up @@ -31,8 +31,8 @@

(in-package #:quicklisp-client)

(defparameter *local-projects-directory*
(qmerge "local-projects/")
(defparameter *local-project-directories*
(list (qmerge "local-projects/"))
"The default local projects directory.")

(defun system-index-file (pathname)
Expand Down Expand Up @@ -84,12 +84,13 @@ SYSTEM, return its full pathname."
(defun local-projects-searcher (system-name)
"This function is added to ASDF:*SYSTEM-DEFINITION-SEARCH-FUNCTIONS*
to use the local project directory and cache to find systems."
(when (probe-directory *local-projects-directory*)
(let ((system-index (ensure-system-index *local-projects-directory*)))
(when system-index
(find-system-in-index system-name system-index)))))
(dolist (directory *local-project-directories*)
(when (probe-directory directory)
(let ((system-index (ensure-system-index directory)))
(when system-index
(return (find-system-in-index system-name system-index)))))))

(defun register-local-projects ()
"Force a scan of the local projects directory to create the system
file index."
(make-system-index *local-projects-directory*))
(map nil 'make-system-index *local-project-directories*))
4 changes: 3 additions & 1 deletion package.lisp
Expand Up @@ -266,7 +266,9 @@
#:write-asdf-manifest-file
#:where-is-system
#:help
#:register-local-projects))
#:register-local-projects
#:local-projects-searcher
#:*local-project-directories*))

(in-package #:quicklisp-client)

0 comments on commit 5e4a19f

Please sign in to comment.