From: Lady Date: Wed, 3 Jul 2024 01:42:56 +0000 (-0400) Subject: Fix/improve recursive dependency detection X-Git-Tag: 0.12.1^0 X-Git-Url: https://git.ladys.computer/Shushe/commitdiff_plain/c84c2b38caf34807fd1c52a8f19fcf0af7e9807e?ds=inline Fix/improve recursive dependency detection The old method of detecting recursive dependencies was overcomplicated and only worked in the simple case of A → B → C → A and not A → B → C → B. This new method works as follows: - Given a dependency path… - Get all of the links in the last document in the path. - If there are no links, return the path. - If there are links which point to a file in the path, it is a recursive dependency. Return the path ending at the point of recursion. - Otherwise (there are nonrecursive links), process each path which results from appending each link to the end of the current path and return all of them. The algorithm ends with a set of paths to leaf nodes in the dependency tree, and each nonroot node in this tree (leaf or branch) is a dependency. This is what the behaviour should have been from the beginning. (The old method attempted to process the tree in layers, rather than as a set of paths.) --- diff --git a/lib/expandmetadata.xslt b/lib/expandmetadata.xslt index 2501355..f2efd18 100644 --- a/lib/expandmetadata.xslt +++ b/lib/expandmetadata.xslt @@ -25,72 +25,56 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one > -