Skip to content

Commit

Permalink
Merge pull request #9 from 40ants/fix-inifinite-loop
Browse files Browse the repository at this point in the history
Fix initite loop when the system is unknown to ASDF yet.
  • Loading branch information
svetlyak40wt authored Mar 11, 2024
2 parents 55758c8 + 0e97024 commit d6cb351
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/changelog.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"ERROR-ON-WARNINGS"
"DYNAMIC-BINDINGS")
:external-docs ("https://40ants.com/doc/"))
(0.11.1 2024-03-11
"* Fixed initite loop when the system is unknown to ASDF yet.")
(0.11.0 2023-06-05
"* Now docs builder tries to load system using either Quicklisp client or ASDF if system is not already loaded.
* Also a bug was fixed - previously DOCS-BUILDER:BUILD function hanged in recursion in case if asdf system wasn't found.
Expand Down
14 changes: 9 additions & 5 deletions src/utils.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@
(labels ((recurse (system)
(typecase system
((or string symbol)
(recurse (asdf:registered-system system)))
(let ((found-system (asdf:registered-system system)))
(unless found-system
(error "Unable to find system \"~A\". Try to load it using ASDF or Quicklisp."
system))
(recurse found-system)))

(asdf:system
(loop for item in (asdf:system-depends-on system)
Expand All @@ -60,14 +64,14 @@
when (and real-item
(not seen)
(asdf/system:primary-system-p real-item))
do (pushnew real-item results
:test #'string=)
do (pushnew real-item results
:test #'string=)
when (and real-item
(not seen)
(or all
(not (asdf/system:primary-system-p real-item))))
do (push real-item visited)
(recurse real-item))))))
do (push real-item visited)
(recurse real-item))))))
(recurse system)
(values (sort results
#'string<)))))
Expand Down

0 comments on commit d6cb351

Please sign in to comment.