summaryrefslogtreecommitdiffstats
path: root/src/libs/installer
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@theqtcompany.com>2014-11-18 12:16:17 +0100
committerKai Koehne <kai.koehne@theqtcompany.com>2014-11-18 12:16:17 +0100
commit4fb5d0f0390b1ddc150fe28b191fc3dbbb0ad77c (patch)
tree4ed0fd2aa8f31501ea466e659f623453bd9d1b02 /src/libs/installer
parent778af9e97d5652c84e027b3e3ccad62122fc92b6 (diff)
parent3fb00b56b473bd8c71b5b8a19db4d61fa2279763 (diff)
Merge remote-tracking branch 'origin/1.6'
Conflicts: src/libs/installer/packagemanagercore.cpp src/sdk/installerbase.cpp tests/auto/installer/packagemanagercore/tst_packagemanagercore.cpp Change-Id: I807686f154249930d31de80289389f4655c27525
Diffstat (limited to 'src/libs/installer')
-rw-r--r--src/libs/installer/packagemanagercore.cpp33
-rw-r--r--src/libs/installer/qtpatchoperation.cpp15
-rw-r--r--src/libs/installer/resources/files-to-patch-macx-emb-arm-qt54
3 files changed, 44 insertions, 8 deletions
diff --git a/src/libs/installer/packagemanagercore.cpp b/src/libs/installer/packagemanagercore.cpp
index d97985e46..3c809ded5 100644
--- a/src/libs/installer/packagemanagercore.cpp
+++ b/src/libs/installer/packagemanagercore.cpp
@@ -483,8 +483,8 @@ quint64 PackageManagerCore::requiredDiskSpace() const
{
quint64 result = 0;
- foreach (QInstaller::Component *component, components(ComponentType::Root))
- result += component->updateUncompressedSize();
+ foreach (QInstaller::Component *component, orderedComponentsToInstall())
+ result += size(component, scUncompressedSize);
return result;
}
@@ -691,6 +691,35 @@ PackageManagerCore::PackageManagerCore(qint64 magicmaker, const QList<OperationB
qRegisterMetaType<QInstaller::PackageManagerCore::WizardPage>("QInstaller::PackageManagerCore::WizardPage");
d->initialize(QHash<QString, QString>());
+
+
+ //
+ // Sanity check to detect a broken installations with missing operations.
+ // Every installed package should have at least one MinimalProgress operation.
+ //
+ QSet<QString> installedPackages = d->m_core->localInstalledPackages().keys().toSet();
+ QSet<QString> operationPackages;
+ foreach (QInstaller::Operation *operation, d->m_performedOperationsOld) {
+ if (operation->hasValue(QLatin1String("component")))
+ operationPackages.insert(operation->value(QLatin1String("component")).toString());
+ }
+
+ QSet<QString> packagesWithoutOperation = installedPackages - operationPackages;
+ QSet<QString> orphanedOperations = operationPackages - installedPackages;
+ if (!packagesWithoutOperation.isEmpty() || !orphanedOperations.isEmpty()) {
+ qCritical() << "Operations missing for installed packages" << packagesWithoutOperation.toList();
+ qCritical() << "Orphaned operations" << orphanedOperations.toList();
+ MessageBoxHandler::critical(
+ MessageBoxHandler::currentBestSuitParent(),
+ QLatin1String("Corrupt_Installation_Error"),
+ QCoreApplication::translate("QInstaller", "Corrupt installation"),
+ QCoreApplication::translate("QInstaller",
+ "Your installation seems to be corrupted. "
+ "Please consider re-installing from scratch."
+ ));
+ } else {
+ qDebug() << "Operations sanity check succeeded.";
+ }
}
PackageManagerCore::~PackageManagerCore()
diff --git a/src/libs/installer/qtpatchoperation.cpp b/src/libs/installer/qtpatchoperation.cpp
index 811b5b051..0342d8bec 100644
--- a/src/libs/installer/qtpatchoperation.cpp
+++ b/src/libs/installer/qtpatchoperation.cpp
@@ -50,7 +50,7 @@
using namespace QInstaller;
static QHash<QByteArray, QByteArray> generatePatchValueHash(const QByteArray &newQtPath,
- const QHash<QString, QByteArray> &qmakeValueHash)
+ const QHash<QString, QByteArray> &qmakeValueHash, const QString &type)
{
QHash<QByteArray, QByteArray> replaceHash; //first == searchstring: second == replace string
char nativeSeperator = QDir::separator().toLatin1();
@@ -77,8 +77,15 @@ static QHash<QByteArray, QByteArray> generatePatchValueHash(const QByteArray &ne
QByteArray("qt_libspath=%1/lib").replace("%1/", newQtPath + nativeSeperator));
oldValue = qmakeValueHash.value(QLatin1String("QT_INSTALL_LIBEXECS"));
- replaceHash.insert(QByteArray("qt_lbexpath=%1").replace("%1", oldValue),
- QByteArray("qt_lbexpath=%1/libexec").replace("%1/", newQtPath + nativeSeperator));
+ if (type == QLatin1String("windows")) {
+ replaceHash.insert(QByteArray("qt_lbexpath=%1").replace("%1", oldValue),
+ QByteArray("qt_lbexpath=%1/bin").replace("%1/",
+ newQtPath + nativeSeperator));
+ } else {
+ replaceHash.insert(QByteArray("qt_lbexpath=%1").replace("%1", oldValue),
+ QByteArray("qt_lbexpath=%1/libexec").replace("%1/",
+ newQtPath + nativeSeperator));
+ }
oldValue = qmakeValueHash.value(QLatin1String("QT_INSTALL_BINS"));
replaceHash.insert(QByteArray("qt_binspath=%1").replace("%1", oldValue),
@@ -398,7 +405,7 @@ bool QtPatchOperation::performOperation()
prefix += QLatin1Char('/');
//BEGIN - patch binary files
- QHash<QByteArray, QByteArray> patchValueHash = generatePatchValueHash(newQtPath, qmakeValueHash);
+ QHash<QByteArray, QByteArray> patchValueHash = generatePatchValueHash(newQtPath, qmakeValueHash, type);
foreach (QString fileName, filesToPatch) {
fileName.prepend(prefix);
diff --git a/src/libs/installer/resources/files-to-patch-macx-emb-arm-qt5 b/src/libs/installer/resources/files-to-patch-macx-emb-arm-qt5
index c01fe17a1..e4eeddefb 100644
--- a/src/libs/installer/resources/files-to-patch-macx-emb-arm-qt5
+++ b/src/libs/installer/resources/files-to-patch-macx-emb-arm-qt5
@@ -5,5 +5,5 @@ bin/qdoc
*.la
*.prl
*.pc
-
-
+*.pri
+*.cmake