Commit 90a2df2a authored by Robert Goldman's avatar Robert Goldman

Refactor COLLECT-SUB*DIRECTORIES-ASD-FILES for traceability.

Key functions used in the special-purpose COLLECT-SUB*DIRECTORIES call
were anonymous lambda functions.  That meant they were impossible to
trace for debugging.  Replaced them with FLET functions that can be
traced.
parent 61c5e895
......@@ -80,21 +80,19 @@ after having found a .asd file? True by default.")
(directory &key (exclude *default-source-registry-exclusions*) collect
(recurse-beyond-asds *recurse-beyond-asds*) ignore-cache)
(let ((visited (make-hash-table :test 'equalp)))
(collect-sub*directories
directory
#'(lambda (dir)
(unless (and (not ignore-cache) (process-source-registry-cache directory collect))
(let ((asds (collect-asds-in-directory dir collect)))
(or recurse-beyond-asds (not asds)))))
#'(lambda (x) ; x will be a directory pathname
(and
(not (member (car (last (pathname-directory x))) exclude :test #'equal))
(flet ((pathname-key (x)
(namestring (truename* x))))
(let ((visitedp (gethash (pathname-key x) visited)))
(if visitedp nil
(setf (gethash (pathname-key x) visited) t))))))
(constantly nil))))
(flet ((collectp (dir)
(unless (and (not ignore-cache) (process-source-registry-cache directory collect))
(let ((asds (collect-asds-in-directory dir collect)))
(or recurse-beyond-asds (not asds)))))
(recursep (x) ; x will be a directory pathname
(and
(not (member (car (last (pathname-directory x))) exclude :test #'equal))
(flet ((pathname-key (x)
(namestring (truename* x))))
(let ((visitedp (gethash (pathname-key x) visited)))
(if visitedp nil
(setf (gethash (pathname-key x) visited) t)))))))
(collect-sub*directories directory #'collectp #'recursep (constantly nil)))))
(defun validate-source-registry-directive (directive)
(or (member directive '(:default-registry))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment