summaryrefslogtreecommitdiffstats
path: root/installerbuilder
diff options
context:
space:
mode:
authorTim Jenssen <tim.jenssen@nokia.com>2011-07-29 08:34:43 +0200
committerTim Jenssen <tim.jenssen@nokia.com>2011-07-29 08:45:14 +0200
commit468e8892e14181c31475dc4c8d69aae164f59420 (patch)
tree13c0ba4bbcd47398503a8e6d24d14a8387859f61 /installerbuilder
parent8219455b4c882f7f1509ad573a0fc757de99f85b (diff)
added new dependency check
Diffstat (limited to 'installerbuilder')
-rw-r--r--installerbuilder/libinstaller/packagemanagercore_p.cpp9
-rw-r--r--installerbuilder/libinstaller/packagemanagercore_p.h2
2 files changed, 8 insertions, 3 deletions
diff --git a/installerbuilder/libinstaller/packagemanagercore_p.cpp b/installerbuilder/libinstaller/packagemanagercore_p.cpp
index a72c826e7..cccf0e8c7 100644
--- a/installerbuilder/libinstaller/packagemanagercore_p.cpp
+++ b/installerbuilder/libinstaller/packagemanagercore_p.cpp
@@ -297,7 +297,7 @@ QHash<QString, QPair<Component*, Component*> > &PackageManagerCorePrivate::compo
void PackageManagerCorePrivate::clearComponentsToInstall() {
m_orderedToInstallComponents.clear();
- m_visitedDependencies.clear();
+ m_visitedComponents.clear();
m_toInstallComponentIds.clear();
m_toInstallComponentIdReasonHash.clear();
}
@@ -351,11 +351,16 @@ bool PackageManagerCorePrivate::appendComponentToInstall(Component* component)
if (!dependencyComponent->isInstalled()
&& !m_toInstallComponentIds.contains(dependencyComponent->name())) {
+ if (m_visitedComponents.value(component).contains(dependencyComponent))
+ return false;
+ m_visitedComponents[component].insert(dependencyComponent);
+
//add needed dependency components to the next run
insertInstallReason(dependencyComponent, QString(tr(
"added as dependency for %1")).arg(component->name()));
- appendComponentToInstall(dependencyComponent);
+ if (!appendComponentToInstall(dependencyComponent))
+ return false;
}
}
if (!m_toInstallComponentIds.contains(component->name())) {
diff --git a/installerbuilder/libinstaller/packagemanagercore_p.h b/installerbuilder/libinstaller/packagemanagercore_p.h
index 74788f7b9..11c4b6cdb 100644
--- a/installerbuilder/libinstaller/packagemanagercore_p.h
+++ b/installerbuilder/libinstaller/packagemanagercore_p.h
@@ -220,7 +220,7 @@ private:
//calculate installation order variables
QList<Component*> m_orderedToInstallComponents;
QHash<QString, QString> m_toInstallComponentIdReasonHash; //for faster lookups
- QSet<QString> m_visitedDependencies;
+ QHash<Component*, QSet<Component*> > m_visitedComponents;
//in some cases we have the reason a while before we can it really,
//so we can't use ReasonHash as a quick is allready added check