summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArttu Tarkiainen <arttu.tarkiainen@qt.io>2021-04-14 17:35:58 +0300
committerArttu Tarkiainen <arttu.tarkiainen@qt.io>2021-04-14 17:35:58 +0300
commit6ae894c26fa09806b48d1e8fa79231b0a63fcdf2 (patch)
tree7fa29232774731f433f31d66fbe4ac3e433e3499
parent93bd3bb5b98f63698602e66622b13fb91a063cc8 (diff)
parente98269889b6156b7b027e1848477607b6151dfa4 (diff)
Merge remote-tracking branch 'origin/4.1'
-rw-r--r--coin/instructions/make_instructions.yaml23
-rw-r--r--coin/qt-installer-package-config.json3
-rw-r--r--src/libs/installer/metadatajob.cpp7
-rw-r--r--src/libs/installer/packagemanagercore.cpp5
-rw-r--r--src/libs/installer/packagemanagercore_p.cpp12
-rw-r--r--tests/auto/installer/createoffline/data/repository-componentmeta-emptymetafile/A/1.0.2-1content.7zbin0 -> 182 bytes
-rw-r--r--tests/auto/installer/createoffline/data/repository-componentmeta-emptymetafile/A/1.0.2-1content.7z.sha11
-rw-r--r--tests/auto/installer/createoffline/data/repository-componentmeta-emptymetafile/A/1.0.2-1meta.7zbin0 -> 106 bytes
-rw-r--r--tests/auto/installer/createoffline/data/repository-componentmeta-emptymetafile/Updates.xml16
-rw-r--r--tests/auto/installer/createoffline/settings.qrc5
-rw-r--r--tests/auto/installer/createoffline/tst_createoffline.cpp3
11 files changed, 61 insertions, 14 deletions
diff --git a/coin/instructions/make_instructions.yaml b/coin/instructions/make_instructions.yaml
index 003e9d746..411a988eb 100644
--- a/coin/instructions/make_instructions.yaml
+++ b/coin/instructions/make_instructions.yaml
@@ -86,12 +86,12 @@ instructions:
- type: ChangeDirectory
directory: "{{.InstallRoot}}/{{.AgentWorkingDir}}"
- type: ExecuteCommand
- command: "python3 {{.SourceDir}}/coin/create_ifw_installer.py --src-dir {{.SourceDir}} --bld-dir {{.SourceDir}} --target-dir {{.SourceDir}} --target-name QtInstallerFramework-linux-x64-4.1.0.run"
+ command: "python3 {{.SourceDir}}/coin/create_ifw_installer.py --src-dir {{.SourceDir}} --bld-dir {{.SourceDir}} --target-dir {{.SourceDir}}/IfwInstaller --target-name QtInstallerFramework-linux-x64-4.1.0.run"
maxTimeInSeconds: 36000
maxTimeBetweenOutput: 3600
userMessageOnFailure: "Failed to create ifw installer."
- type: Rename
- sourcePath: "{{.SourceDir}}/QtInstallerFramework-linux-x64-4.1.0.run"
+ sourcePath: "{{.SourceDir}}/IfwInstaller/QtInstallerFramework-linux-x64-4.1.0.run"
targetPath: "{{.InstallRoot}}/{{.AgentWorkingDir}}/QtInstallerFramework-linux-x64-4.1.0.run"
userMessageOnFailure: "Failed to copy installer."
enable_if:
@@ -106,7 +106,7 @@ instructions:
- type: ChangeDirectory
directory: "{{.InstallRoot}}/{{.AgentWorkingDir}}"
- type: ExecuteCommand
- command: "python3 {{.SourceDir}}/coin/create_ifw_installer.py --src-dir {{.SourceDir}} --bld-dir {{.SourceDir}} --target-dir {{.SourceDir}} --target-name QtInstallerFramework-macOS-x86_64-4.1.0.app"
+ command: "python3 {{.SourceDir}}/coin/create_ifw_installer.py --src-dir {{.SourceDir}} --bld-dir {{.SourceDir}} --target-dir {{.SourceDir}}/IfwInstaller --target-name QtInstallerFramework-macOS-x86_64-4.1.0.app"
maxTimeInSeconds: 36000
maxTimeBetweenOutput: 3600
userMessageOnFailure: "Failed to create ifw installer."
@@ -114,17 +114,17 @@ instructions:
variableName: QT_CODESIGN_IDENTITY_KEY
variableValue: "A5GTH44LYL"
- type: ExecuteCommand
- command: "{{.AgentWorkingDir}}/qtsdk/qtsdk/packaging-tools/sign_installer.py mac --file={{.SourceDir}}/QtInstallerFramework-macOS-x86_64-4.1.0.app"
+ command: "{{.AgentWorkingDir}}/qtsdk/qtsdk/packaging-tools/sign_installer.py mac --file={{.SourceDir}}/IfwInstaller/QtInstallerFramework-macOS-x86_64-4.1.0.app"
maxTimeInSeconds: 36000
maxTimeBetweenOutput: 3600
userMessageOnFailure: "Failed to sign the ifw installer"
- type: ExecuteCommand
- command: "{{.AgentWorkingDir}}/qtsdk/qtsdk/packaging-tools/notarize.py --dmg={{.SourceDir}}/QtInstallerFramework-macOS-x86_64-4.1.0.dmg"
+ command: "{{.AgentWorkingDir}}/qtsdk/qtsdk/packaging-tools/notarize.py --dmg={{.SourceDir}}/IfwInstaller/QtInstallerFramework-macOS-x86_64-4.1.0.dmg"
maxTimeInSeconds: 36000
maxTimeBetweenOutput: 3600
userMessageOnFailure: "Failed to notarize the ifw installer"
- type: Rename
- sourcePath: "{{.SourceDir}}/QtInstallerFramework-macOS-x86_64-4.1.0.dmg"
+ sourcePath: "{{.SourceDir}}/IfwInstaller/QtInstallerFramework-macOS-x86_64-4.1.0.dmg"
targetPath: "{{.InstallRoot}}/{{.AgentWorkingDir}}/QtInstallerFramework-macOS-x86_64-4.1.0.dmg"
userMessageOnFailure: "Failed to copy installer."
enable_if:
@@ -139,7 +139,7 @@ instructions:
- type: ChangeDirectory
directory: "{{.SourceDir}}"
- type: ExecuteCommand
- command: "{{.Env.PYTHON3_PATH}}\\python {{.SourceDir}}\\coin\\create_ifw_installer.py --src-dir {{.SourceDir}} --bld-dir {{.SourceDir}} --target-dir C:\\{{.SourceDir}} --target-name QtInstallerFramework-windows-x86-4.1.0"
+ command: "{{.Env.PYTHON3_PATH}}\\python {{.SourceDir}}\\coin\\create_ifw_installer.py --src-dir {{.SourceDir}} --bld-dir {{.SourceDir}} --target-dir C:\\{{.SourceDir}}\\IfwInstaller --target-name QtInstallerFramework-windows-x86-4.1.0"
maxTimeInSeconds: 1200
maxTimeBetweenOutput: 1200
userMessageOnFailure: "Failed to create ifw installer."
@@ -151,7 +151,7 @@ instructions:
equals_value: Windows
- type: SignPackage
- directory: "{{.SourceDir}}"
+ directory: "{{.SourceDir}}/IfwInstaller"
maxTimeInSeconds: 1200
maxTimeBetweenOutput: 1200
enable_if:
@@ -160,7 +160,7 @@ instructions:
equals_value: Windows
- type: Rename
- sourcePath: "{{.SourceDir}}/QtInstallerFramework-windows-x86-4.1.0.exe"
+ sourcePath: "{{.SourceDir}}/IfwInstaller/QtInstallerFramework-windows-x86-4.1.0.exe"
targetPath: "{{.InstallRoot}}/{{.AgentWorkingDir}}/QtInstallerFramework-windows-x86-4.1.0.exe"
userMessageOnFailure: "Failed to copy installer."
enable_if:
@@ -168,6 +168,11 @@ instructions:
property: host.os
equals_value: Windows
+ - type: Rename
+ sourcePath: "{{.SourceDir}}/dist/packages/org.qtproject.ifw.binaries/data/data.7z"
+ targetPath: "{{.InstallRoot}}/{{.AgentWorkingDir}}/ifw_data.7z"
+ userMessageOnFailure: "Failed to copy IFW binary archive."
+
- type: UploadArtifact
archiveDirectory: "{{.InstallRoot}}/{{.AgentWorkingDir}}"
transferType: UploadModuleBuildArtifact
diff --git a/coin/qt-installer-package-config.json b/coin/qt-installer-package-config.json
index 563110519..9654c513d 100644
--- a/coin/qt-installer-package-config.json
+++ b/coin/qt-installer-package-config.json
@@ -2,7 +2,8 @@
"version": "1",
"module-split": {
"__extract__": [
- "**/*QtInstallerFramework-*"
+ "**/*QtInstallerFramework-*",
+ "**/*ifw_data*"
]
}
}
diff --git a/src/libs/installer/metadatajob.cpp b/src/libs/installer/metadatajob.cpp
index a8405a0e8..2a9cb5ae7 100644
--- a/src/libs/installer/metadatajob.cpp
+++ b/src/libs/installer/metadatajob.cpp
@@ -654,8 +654,11 @@ MetadataJob::Status MetadataJob::parseUpdatesXml(const QList<FileTaskResult> &re
metaFound = parsePackageUpdate(c2, packageName, packageVersion, packageHash,
online, testCheckSum);
- //If meta element (script, licenses, etc.) is not found, no need to fetch metadata
- if (metaFound) {
+ // If meta element (script, licenses, etc.) is not found, no need to fetch metadata.
+ // The offline-generator instance is an exception to this - if the Updates.xml contains
+ // checksum element for the meta-archive, we will fetch it, so that the temporary
+ // location contents match the remote repository.
+ if (metaFound || (m_core->isOfflineGenerator() && !packageHash.isEmpty())) {
const QString repoUrl = metadata.repository.url().toString();
addFileTaskItem(QString::fromLatin1("%1/%2/%3meta.7z").arg(repoUrl, packageName, packageVersion),
metadata.directory + QString::fromLatin1("/%1-%2-meta.7z").arg(packageName, packageVersion),
diff --git a/src/libs/installer/packagemanagercore.cpp b/src/libs/installer/packagemanagercore.cpp
index 26df043a0..375cb6018 100644
--- a/src/libs/installer/packagemanagercore.cpp
+++ b/src/libs/installer/packagemanagercore.cpp
@@ -733,7 +733,7 @@ quint64 PackageManagerCore::requiredDiskSpace() const
quint64 result = 0;
foreach (QInstaller::Component *component, orderedComponentsToInstall())
- result += size(component, scUncompressedSize);
+ result += size(component, isOfflineGenerator() ? scCompressedSize : scUncompressedSize);
return result;
}
@@ -2694,6 +2694,9 @@ bool PackageManagerCore::checkAvailableSpace(QString &message) const
// if we create a local repository, take that space into account as well
required += repositorySize;
}
+ // if we create offline installer, take current executable size into account
+ if (isOfflineGenerator())
+ required += QFile(QCoreApplication::applicationFilePath()).size();
qDebug() << "Installation space required:" << humanReadableSize(required) << "Temporary space "
"required:" << humanReadableSize(tempRequired) << "Local repository size:"
diff --git a/src/libs/installer/packagemanagercore_p.cpp b/src/libs/installer/packagemanagercore_p.cpp
index 1b14c306b..f5d3d3508 100644
--- a/src/libs/installer/packagemanagercore_p.cpp
+++ b/src/libs/installer/packagemanagercore_p.cpp
@@ -2285,6 +2285,11 @@ void PackageManagerCorePrivate::setComponentSelection(const QString &id, Qt::Che
{
ComponentModel *model = m_core->isUpdater() ? m_core->updaterComponentModel() : m_core->defaultComponentModel();
Component *component = m_core->componentByName(id);
+ if (!component) {
+ qCWarning(QInstaller::lcInstallerInstallLog).nospace()
+ << "Unable to set selection for: " << id << ". Component not found.";
+ return;
+ }
const QModelIndex &idx = model->indexFromComponentName(component->treeName());
if (idx.isValid())
model->setData(idx, state, Qt::CheckStateRole);
@@ -2812,7 +2817,12 @@ bool PackageManagerCorePrivate::calculateComponentsAndRun()
qCDebug(QInstaller::lcInstallerInstallLog) << "Installation canceled.";
} else if (componentsOk && acceptLicenseAgreements()) {
qCDebug(QInstaller::lcInstallerInstallLog).noquote() << htmlToString(htmlOutput);
- if (!(m_autoConfirmCommand || askUserConfirmCommand())) {
+
+ QString spaceInfo;
+ const bool spaceOk = m_core->checkAvailableSpace(spaceInfo);
+ qCDebug(QInstaller::lcInstallerInstallLog) << spaceInfo;
+
+ if (!spaceOk || !(m_autoConfirmCommand || askUserConfirmCommand())) {
qCDebug(QInstaller::lcInstallerInstallLog) << "Installation aborted.";
} else if (m_core->run()) {
// Write maintenance tool if required
diff --git a/tests/auto/installer/createoffline/data/repository-componentmeta-emptymetafile/A/1.0.2-1content.7z b/tests/auto/installer/createoffline/data/repository-componentmeta-emptymetafile/A/1.0.2-1content.7z
new file mode 100644
index 000000000..1c5ff001a
--- /dev/null
+++ b/tests/auto/installer/createoffline/data/repository-componentmeta-emptymetafile/A/1.0.2-1content.7z
Binary files differ
diff --git a/tests/auto/installer/createoffline/data/repository-componentmeta-emptymetafile/A/1.0.2-1content.7z.sha1 b/tests/auto/installer/createoffline/data/repository-componentmeta-emptymetafile/A/1.0.2-1content.7z.sha1
new file mode 100644
index 000000000..b36346655
--- /dev/null
+++ b/tests/auto/installer/createoffline/data/repository-componentmeta-emptymetafile/A/1.0.2-1content.7z.sha1
@@ -0,0 +1 @@
+5097e37368b44fc5242f3bb2fce08f5ade6c4c40 \ No newline at end of file
diff --git a/tests/auto/installer/createoffline/data/repository-componentmeta-emptymetafile/A/1.0.2-1meta.7z b/tests/auto/installer/createoffline/data/repository-componentmeta-emptymetafile/A/1.0.2-1meta.7z
new file mode 100644
index 000000000..408550be6
--- /dev/null
+++ b/tests/auto/installer/createoffline/data/repository-componentmeta-emptymetafile/A/1.0.2-1meta.7z
Binary files differ
diff --git a/tests/auto/installer/createoffline/data/repository-componentmeta-emptymetafile/Updates.xml b/tests/auto/installer/createoffline/data/repository-componentmeta-emptymetafile/Updates.xml
new file mode 100644
index 000000000..d3b180e43
--- /dev/null
+++ b/tests/auto/installer/createoffline/data/repository-componentmeta-emptymetafile/Updates.xml
@@ -0,0 +1,16 @@
+<Updates>
+ <ApplicationName>{AnyApplication}</ApplicationName>
+ <ApplicationVersion>1.0.0</ApplicationVersion>
+ <Checksum>true</Checksum>
+ <PackageUpdate>
+ <Name>A</Name>
+ <DisplayName>A</DisplayName>
+ <Description>Example component A</Description>
+ <Version>1.0.2-1</Version>
+ <ReleaseDate>2015-01-01</ReleaseDate>
+ <Default>true</Default>
+ <UpdateFile UncompressedSize="72" OS="Any" CompressedSize="222"/>
+ <DownloadableArchives>content.7z</DownloadableArchives>
+ <SHA1>65c0db5bcf28139d434dce0e21674e33c87ab6d9</SHA1>
+ </PackageUpdate>
+</Updates>
diff --git a/tests/auto/installer/createoffline/settings.qrc b/tests/auto/installer/createoffline/settings.qrc
index 2c546d7f2..4b7666b4a 100644
--- a/tests/auto/installer/createoffline/settings.qrc
+++ b/tests/auto/installer/createoffline/settings.qrc
@@ -23,5 +23,10 @@
<file>data/repository-unifiedmeta-script/Updates.xml</file>
<file>data/repository-unifiedmeta-script/org.qtproject.ifw.example/1.0.0-1content.7z</file>
<file>data/repository-unifiedmeta-script/org.qtproject.ifw.example/1.0.0-1content.7z.sha1</file>
+
+ <file>data/repository-componentmeta-emptymetafile/Updates.xml</file>
+ <file>data/repository-componentmeta-emptymetafile/A/1.0.2-1content.7z</file>
+ <file>data/repository-componentmeta-emptymetafile/A/1.0.2-1content.7z.sha1</file>
+ <file>data/repository-componentmeta-emptymetafile/A/1.0.2-1meta.7z</file>
</qresource>
</RCC>
diff --git a/tests/auto/installer/createoffline/tst_createoffline.cpp b/tests/auto/installer/createoffline/tst_createoffline.cpp
index 474b1d5de..3a3431442 100644
--- a/tests/auto/installer/createoffline/tst_createoffline.cpp
+++ b/tests/auto/installer/createoffline/tst_createoffline.cpp
@@ -85,6 +85,9 @@ private slots:
QTest::newRow("Unified metaformat | Script")
<< ":///data/repository-unifiedmeta-script" << "org.qtproject.ifw.example"
<< PackageManagerCore::Success;
+ QTest::newRow("Component metaformat | Empty component meta-archive")
+ << ":///data/repository-componentmeta-emptymetafile" << "A"
+ << PackageManagerCore::Success;
QTest::newRow("Non-existing component")
<< ":///data/repository-unifiedmeta-script" << "a.dummy.component"
<< PackageManagerCore::Canceled;