Skip to content

[fixed] avoid index-file being locked due to recursive calling #230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions quicklisp/local-projects.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,23 @@ and has a newer timestamp than PATHNAME."
(defun find-system-in-index (system index-file)
"If any system pathname in INDEX-FILE has a pathname-name matching
SYSTEM, return its full pathname."
(with-open-file (stream index-file)
(loop for namestring = (read-line stream nil)
while namestring
when (string= system (pathname-name namestring))
return (or (probe-file (merge-pathnames namestring index-file))
;; If the indexed .asd file doesn't exist anymore
;; then regenerate the index and restart the search.
(find-system-in-index system (make-system-index (directory-namestring index-file)))))))
(let ((matched-file
(with-open-file (stream index-file)
(loop for namestring = (let ((content (read-line stream nil)))
(if content
(string-trim '(#\Return #\Newline)
content)
content))
while namestring
when (string= system (pathname-name namestring))
return (merge-pathnames namestring index-file)))))
(when matched-file
(or (probe-file matched-file)
;; If the indexed .asd file doesn't exist anymore
;; then regenerate the index and restart the search.
(find-system-in-index
system
(make-system-index (uiop:pathname-directory-pathname index-file)))))))

(defun local-projects-searcher (system-name)
"This function is added to ASDF:*SYSTEM-DEFINITION-SEARCH-FUNCTIONS*
Expand Down