From 96fe204e59dc6cbe4700afbca17463ea3af06feb Mon Sep 17 00:00:00 2001 From: Michael Pyne Date: Sun, 22 Feb 2015 18:59:07 -0500 Subject: [PATCH] dep-resolv: There's a reason I included a visit-guard before. Even without include-dependencies, without this visit guard the tree traversal code will add a ksb::Module dependency (when they are encountered) to the build list every time it is encountered, not just the first time it's encountered. --- modules/ksb/DependencyResolver.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/ksb/DependencyResolver.pm b/modules/ksb/DependencyResolver.pm index 8d39bda..789399b 100644 --- a/modules/ksb/DependencyResolver.pm +++ b/modules/ksb/DependencyResolver.pm @@ -325,6 +325,12 @@ sub _visitModuleAndDependencies my $item = _shortenModuleName($module->fullProjectPath()); my $branch = _getBranchOf($module) // '*'; + # Since the initial build list is visited start to finish it is + # possible for this module to already be in the ordered list if + # reordering has already happened or if dependencies are included (i.e. + # this was a dependency of some other module). + return if ($optionsRef->{visitedItems}->{$item} // 0) == 3; + $dependentName //= $item if $module->getOption('include-dependencies'); _visitDependencyItemAndDependencies($optionsRef, "$item:$branch", $level, $dependentName);