summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/installercalculator.cpp
diff options
context:
space:
mode:
authorKatja Marttila <katja.marttila@qt.io>2018-02-28 09:54:22 +0200
committerKatja Marttila <katja.marttila@qt.io>2018-04-05 06:54:21 +0000
commitd2ae9c16c3427c272d41e9a471f705ad8947a97a (patch)
tree4ed6b3cafd28b11f02ef4f4faa6164bcfbd85b63 /src/libs/installer/installercalculator.cpp
parent6664ca85f09d6ae195ac30f83a60d53c2355da0f (diff)
Add attribute to mark parts of install tree unstable
This commit adds new AllowUnstableComponents configuration. Setting AllowUnstablecomponents to true in config.xml will * allow installing other components when there are errors in scripts * allow installing other components when there are missing dependencies * will mark the 'broken' components uninstallable in treeview Task-number: QTIFW-930 Change-Id: I8d28cf9c4b0401e0bb76795e87d581f39b64f128 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Diffstat (limited to 'src/libs/installer/installercalculator.cpp')
-rw-r--r--src/libs/installer/installercalculator.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/libs/installer/installercalculator.cpp b/src/libs/installer/installercalculator.cpp
index d44450eb2..4e0d7fdfa 100644
--- a/src/libs/installer/installercalculator.cpp
+++ b/src/libs/installer/installercalculator.cpp
@@ -30,6 +30,7 @@
#include "component.h"
#include "packagemanagercore.h"
+#include "settings.h"
#include <QDebug>
@@ -94,7 +95,8 @@ QString InstallerCalculator::componentsToInstallError() const
void InstallerCalculator::realAppendToInstallComponents(Component *component, const QString &version)
{
- if (!component->isInstalled(version) || component->updateRequested()) {
+ if (!component->isUnstable() &&
+ (!component->isInstalled(version) || component->updateRequested())) {
m_orderedComponentsToInstall.append(component);
m_toInstallComponentIds.insert(component->name());
}
@@ -169,7 +171,12 @@ bool InstallerCalculator::appendComponentToInstall(Component *component, const Q
component->name());
qWarning().noquote() << errorMessage;
m_componentsToInstallError.append(errorMessage);
- return false;
+ if (component->packageManagerCore()->settings().allowUnstableComponents()) {
+ component->setUnstable();
+ return true;
+ } else {
+ return false;
+ }
}
//Check if component requires higher version than what might be already installed
bool isUpdateRequired = false;