summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkh1 <karsten.heimrich@digia.com>2014-06-17 11:54:58 +0200
committerKai Koehne <kai.koehne@digia.com>2014-08-26 14:23:10 +0200
commit83ba7dbfb42d9abd319d8c6ed4f0357973b808dc (patch)
tree411a7cbafdec8ffc1953d08210c2438dddbe4368
parent650e92ad761739af2f7670c9c84ff2c58d154e25 (diff)
Make cycles in component dependencies fatal
Warn the user when sorting operations fails due to cyclic dependencies. Previously we would just continue, saving an incomplete list of operations. This is a backport of commit b707ec04c971 to 1.6. Change-Id: I034007c2271b565d0d792d9a6cfc7f663c897428 Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
-rw-r--r--src/libs/installer/packagemanagercore_p.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libs/installer/packagemanagercore_p.cpp b/src/libs/installer/packagemanagercore_p.cpp
index c73a7fc82..a360997c2 100644
--- a/src/libs/installer/packagemanagercore_p.cpp
+++ b/src/libs/installer/packagemanagercore_p.cpp
@@ -2442,7 +2442,12 @@ OperationList PackageManagerCorePrivate::sortOperationsBasedOnComponentDependenc
componentGraph.addEdges(componentNode->name(), dependencies);
}
- foreach (const QString &componentName, componentGraph.sort())
+ const QStringList resolvedComponents = componentGraph.sort();
+ if (componentGraph.hasCycle()) {
+ throw Error(tr("Dependency cycle between components detected: '%1' and '%2'.")
+ .arg(componentGraph.cycle().first, componentGraph.cycle().second));
+ }
+ foreach (const QString &componentName, resolvedComponents)
sortedOperations.append(componentOperationHash.value(componentName));
return sortedOperations;