summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKatja Marttila <katja.marttila@qt.io>2019-10-11 07:42:48 +0300
committerKatja Marttila <katja.marttila@qt.io>2019-10-11 06:20:51 +0000
commitc706665c4f5efbe75633502b67c365be41d11a10 (patch)
tree63314d9707f824faa9c42ec38564a70a5522b05e
parent62eeab668c239a4a8a8ae4058d3f378464c2def2 (diff)
Fix essential package update
If there was essential update available and autodependency to already installed packages, the component containing autodependency was installed. If there was a Replaces at the same time, the Replaces was ignored. If there is an essential update, no other components should be installed nor updated except essentials and the components that have autodependency to essential component. Task-number: QTIFW-1215 Change-Id: Ib782335f98b6af6ec546aeecb9b032cf84254256 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
-rw-r--r--src/libs/installer/component.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libs/installer/component.cpp b/src/libs/installer/component.cpp
index 5a508f118..cd40d4a7b 100644
--- a/src/libs/installer/component.cpp
+++ b/src/libs/installer/component.cpp
@@ -1255,6 +1255,18 @@ bool Component::isAutoDependOn(const QSet<QString> &componentsToInstall) const
if (autoDependOnList.isEmpty())
return false;
+ // If there is an essential update and autodepend on is not for essential
+ // update component, do not add the autodependency to an installed component as
+ // essential updates needs to be installed first, otherwise non-essential components
+ // will be installed
+ if (packageManagerCore()->foundEssentialUpdate()) {
+ const QSet<QString> autoDependOnSet = autoDependOnList.toSet();
+ if (autoDependOnSet.intersects(componentsToInstall)) {
+ return true;
+ }
+ return false;
+ }
+
QSet<QString> components = componentsToInstall;
const QStringList installedPackages = d->m_core->localInstalledPackages().keys();
foreach (const QString &name, installedPackages)