From 8bf7e2114523b14b42470a8cc318075f31e10c84 Mon Sep 17 00:00:00 2001 From: Gunnar Wrobel
Date: Sat, 23 Oct 2010 00:02:33 +0200
Subject: [PATCH] Introduce artificial optional dependency recursion for the
installation test and readd the recursion safety we had in the old installer
version.
---
components/lib/Components/Helper/Tree/Element.php | 11 ++++++++---
.../test/Components/fixture/framework/Dependency/package.xml | 6 ++++++
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/components/lib/Components/Helper/Tree/Element.php b/components/lib/Components/Helper/Tree/Element.php
index 5594f75fb..4013ad9ca 100644
--- a/components/lib/Components/Helper/Tree/Element.php
+++ b/components/lib/Components/Helper/Tree/Element.php
@@ -80,12 +80,17 @@ class Components_Helper_Tree_Element
/**
* Install the tree of packages into the environment.
*
- * @param Components_Helper_InstallationRun $run The current installation run.
+ * @param Components_Helper_InstallationRun $run The current installation run.
+ * @param array $visited The packages already visited.
*
* @return NULL
*/
- public function installInTree(Components_Helper_InstallationRun $run)
+ public function installInTree(Components_Helper_InstallationRun $run, array $visited = array())
{
+ if (in_array($this->_package_file, $visited)) {
+ return;
+ }
+ $visited[] = $this->_package_file;
$run->installChannelsOnce($this->_package->listAllRequiredChannels());
foreach ($this->_package->listAllExternalDependencies() as $dependency) {
$run->installExternalPackageOnce(
@@ -97,7 +102,7 @@ class Components_Helper_Tree_Element
$this->_package->listAllHordeDependencies()
) as $child
) {
- $child->installInTree($run);
+ $child->installInTree($run, $visited);
}
$run->installHordePackageOnce($this->_package_file);
}
diff --git a/components/test/Components/fixture/framework/Dependency/package.xml b/components/test/Components/fixture/framework/Dependency/package.xml
index 59c2f7712..0cf1e60b8 100644
--- a/components/test/Components/fixture/framework/Dependency/package.xml
+++ b/components/test/Components/fixture/framework/Dependency/package.xml
@@ -44,6 +44,12 @@