summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.qmake.conf2
-rw-r--r--coin/instructions/make_instructions.yaml22
-rw-r--r--dist/packages/org.qtproject.ifw.binaries/meta/package.xml4
-rw-r--r--dist/packages/org.qtproject.ifw/meta/package.xml4
-rw-r--r--doc/installerfw-using.qdoc6
-rw-r--r--doc/installerfw.qdoc15
-rw-r--r--doc/scripting-api/packagemanagercore.qdoc8
-rw-r--r--installerfw.pri6
-rw-r--r--src/libs/ifwtools/binarycreator.cpp10
-rw-r--r--src/libs/ifwtools/rcc/rcc.cpp22
-rw-r--r--src/libs/ifwtools/repositorygen.cpp122
-rw-r--r--src/libs/ifwtools/repositorygen.h16
-rw-r--r--src/libs/installer/adminauthorization_x11.cpp234
-rw-r--r--src/libs/installer/binarycontent.h9
-rw-r--r--src/libs/installer/commandlineparser.cpp9
-rw-r--r--src/libs/installer/component.cpp7
-rw-r--r--src/libs/installer/component_p.cpp1
-rw-r--r--src/libs/installer/componentmodel.cpp6
-rw-r--r--src/libs/installer/componentselectionpage_p.cpp54
-rw-r--r--src/libs/installer/componentselectionpage_p.h6
-rw-r--r--src/libs/installer/constants.h5
-rw-r--r--src/libs/installer/installiconsoperation.cpp10
-rw-r--r--src/libs/installer/keepaliveobject.cpp7
-rw-r--r--src/libs/installer/loggingutils.cpp2
-rw-r--r--src/libs/installer/packagemanagercore.cpp95
-rw-r--r--src/libs/installer/packagemanagercore.h9
-rw-r--r--src/libs/installer/packagemanagercore_p.cpp29
-rw-r--r--src/libs/installer/packagemanagercore_p.h8
-rw-r--r--src/libs/installer/packagemanagergui.cpp2
-rw-r--r--src/libs/installer/performinstallationform.cpp1
-rw-r--r--src/libs/installer/qsettingswrapper.cpp4
-rw-r--r--src/libs/installer/utils.cpp8
-rw-r--r--src/libs/kdtools/filedownloader.cpp2
-rw-r--r--src/libs/kdtools/localpackagehub.cpp8
-rw-r--r--src/libs/kdtools/localpackagehub.h4
-rw-r--r--src/libs/kdtools/selfrestarter.cpp14
-rw-r--r--src/libs/kdtools/updatefinder.cpp7
-rw-r--r--src/libs/kdtools/updateoperation.cpp2
-rw-r--r--src/libs/kdtools/updatesinfo.cpp8
-rw-r--r--src/sdk/commandlineinterface.cpp26
-rw-r--r--src/sdk/commandlineinterface.h3
-rw-r--r--src/sdk/tabcontroller.cpp19
-rw-r--r--src/sdk/translations/ifw_ar.ts33
-rw-r--r--src/sdk/translations/ifw_ca.ts32
-rw-r--r--src/sdk/translations/ifw_da.ts32
-rw-r--r--src/sdk/translations/ifw_de.ts17
-rw-r--r--src/sdk/translations/ifw_es.ts43
-rw-r--r--src/sdk/translations/ifw_fr.ts32
-rw-r--r--src/sdk/translations/ifw_hr.ts32
-rw-r--r--src/sdk/translations/ifw_it.ts32
-rw-r--r--src/sdk/translations/ifw_ja.ts32
-rw-r--r--src/sdk/translations/ifw_pl.ts32
-rw-r--r--src/sdk/translations/ifw_pt_BR.ts32
-rw-r--r--src/sdk/translations/ifw_ru.ts32
-rw-r--r--src/sdk/translations/ifw_zh_CN.ts32
-rw-r--r--tests/auto/installer/binaryformat/tst_binaryformat.cpp4
-rw-r--r--tests/auto/installer/clientserver/tst_clientserver.cpp2
-rw-r--r--tests/auto/installer/cliinterface/data/repository/A/1.0.2-1content.7zbin182 -> 0 bytes
-rw-r--r--tests/auto/installer/cliinterface/data/repository/A/1.0.2-1content.7z.sha11
-rw-r--r--tests/auto/installer/cliinterface/data/repository/A/1.0.2-1meta.7zbin106 -> 0 bytes
-rw-r--r--tests/auto/installer/cliinterface/data/repository/AB/1.0.2-1meta.7zbin114 -> 0 bytes
-rw-r--r--tests/auto/installer/cliinterface/data/repository/B/1.0.0-1content.7zbin182 -> 0 bytes
-rw-r--r--tests/auto/installer/cliinterface/data/repository/B/1.0.0-1content.7z.sha11
-rw-r--r--tests/auto/installer/cliinterface/data/repository/B/1.0.0-1meta.7zbin106 -> 0 bytes
-rw-r--r--tests/auto/installer/cliinterface/data/repository/C/1.0.0-1content.7zbin182 -> 0 bytes
-rw-r--r--tests/auto/installer/cliinterface/data/repository/C/1.0.0-1content.7z.sha11
-rw-r--r--tests/auto/installer/cliinterface/data/repository/C/1.0.0-1meta.7zbin106 -> 0 bytes
-rw-r--r--tests/auto/installer/cliinterface/data/repository/Updates.xml23
-rw-r--r--tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/A/2.0.0content.7zbin184 -> 0 bytes
-rw-r--r--tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/A/2.0.0content.7z.sha11
-rw-r--r--tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/A/2.0.0meta.7zbin106 -> 0 bytes
-rw-r--r--tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/AB/1.0.2-1meta.7zbin114 -> 0 bytes
-rw-r--r--tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/B/2.0.0content.7zbin184 -> 0 bytes
-rw-r--r--tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/B/2.0.0content.7z.sha11
-rw-r--r--tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/B/2.0.0meta.7zbin106 -> 0 bytes
-rw-r--r--tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/Updates.xml10
-rw-r--r--tests/auto/installer/cliinterface/tst_cliinterface.cpp34
-rw-r--r--tests/auto/installer/contentshaupdate/contentshaupdate.pro9
-rw-r--r--tests/auto/installer/contentshaupdate/data/repository/Updates.xml48
-rw-r--r--tests/auto/installer/contentshaupdate/data/repository/componentA/1.0.0content.7zbin0 -> 243 bytes
-rw-r--r--tests/auto/installer/contentshaupdate/data/repository/componentB/1.0.0content.7zbin0 -> 243 bytes
-rw-r--r--tests/auto/installer/contentshaupdate/data/repository/componentC/1.0.0content.7zbin0 -> 243 bytes
-rw-r--r--tests/auto/installer/contentshaupdate/data/repository/componentD/1.0.0content.7zbin0 -> 243 bytes
-rw-r--r--tests/auto/installer/contentshaupdate/data/repositoryUpdate/Updates.xml48
-rw-r--r--tests/auto/installer/contentshaupdate/data/repositoryUpdate/componentA/0.1.0content.7zbin0 -> 243 bytes
-rw-r--r--tests/auto/installer/contentshaupdate/data/repositoryUpdate/componentB/0.1.0content.7zbin0 -> 243 bytes
-rw-r--r--tests/auto/installer/contentshaupdate/data/repositoryUpdate/componentC/2.0.0content.7zbin0 -> 243 bytes
-rw-r--r--tests/auto/installer/contentshaupdate/data/repositoryUpdate/componentD/2.0.0content.7zbin0 -> 243 bytes
-rw-r--r--tests/auto/installer/contentshaupdate/settings.qrc14
-rw-r--r--tests/auto/installer/contentshaupdate/tst_contentshaupdate.cpp108
-rw-r--r--tests/auto/installer/factory/tst_factory.cpp8
-rw-r--r--tests/auto/installer/installer.pro3
-rw-r--r--tests/auto/installer/metadatajob/data/config.xml8
-rw-r--r--tests/auto/installer/metadatajob/settings.qrc1
-rw-r--r--tests/auto/installer/metadatajob/tst_metadatajob.cpp5
-rw-r--r--tests/auto/installer/packagemanagercore/tst_packagemanagercore.cpp6
-rw-r--r--tests/auto/installer/registerfiletypeoperation/tst_registerfiletypeoperation.cpp3
-rw-r--r--tests/auto/tools/repotest/settings.qrc24
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_1/A/2.0.0content.7zbin0 -> 32 bytes
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_1/A/2.0.0content.7z.sha11
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_1/A/2.0.0meta.7zbin0 -> 209 bytes
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_1/B/1.0.0content.7zbin0 -> 32 bytes
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_1/B/1.0.0content.7z.sha11
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_1/B/1.0.0meta.7zbin0 -> 106 bytes
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_1/Updates.xml28
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_2/A/1.0.0content.7zbin0 -> 32 bytes
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_2/A/1.0.0content.7z.sha11
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_2/A/1.0.0meta.7zbin0 -> 221 bytes
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_2/B/1.0.0content.7zbin0 -> 32 bytes
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_2/B/1.0.0content.7z.sha11
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_2/B/1.0.0meta.7zbin0 -> 106 bytes
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_2/Updates.xml28
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_3/A/1.0.0content.7zbin0 -> 32 bytes
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_3/A/1.0.0content.7z.sha11
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_3/A/1.0.0meta.7zbin0 -> 221 bytes
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_3/B/3.0.0content.7zbin0 -> 32 bytes
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_3/B/3.0.0content.7z.sha11
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_3/B/3.0.0meta.7zbin0 -> 106 bytes
-rw-r--r--tests/auto/tools/repotest/test_package_versions/repository_3/Updates.xml28
-rw-r--r--tests/auto/tools/repotest/tst_repotest.cpp261
-rw-r--r--tools/devtool/binarydump.cpp6
-rw-r--r--tools/devtool/main.cpp26
-rw-r--r--tools/repocompare/repositorymanager.cpp1
-rw-r--r--tools/repogen/repogen.cpp92
124 files changed, 1367 insertions, 721 deletions
diff --git a/.qmake.conf b/.qmake.conf
index 0093cddd6..36f547a67 100644
--- a/.qmake.conf
+++ b/.qmake.conf
@@ -1,2 +1,2 @@
-VERSION=4.1.1
+VERSION=4.2.0
CONFIG=prepare_docs qt_docs_targets $$CONFIG
diff --git a/coin/instructions/make_instructions.yaml b/coin/instructions/make_instructions.yaml
index 2ebca0410..bcf3c55af 100644
--- a/coin/instructions/make_instructions.yaml
+++ b/coin/instructions/make_instructions.yaml
@@ -86,13 +86,13 @@ 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}}/IfwInstaller --target-name QtInstallerFramework-linux-x64-4.1.1.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.2.0.run"
maxTimeInSeconds: 36000
maxTimeBetweenOutput: 3600
userMessageOnFailure: "Failed to create ifw installer."
- type: Rename
- sourcePath: "{{.SourceDir}}/IfwInstaller/QtInstallerFramework-linux-x64-4.1.1.run"
- targetPath: "{{.InstallRoot}}/{{.AgentWorkingDir}}/QtInstallerFramework-linux-x64-4.1.1.run"
+ sourcePath: "{{.SourceDir}}/IfwInstaller/QtInstallerFramework-linux-x64-4.2.0.run"
+ targetPath: "{{.InstallRoot}}/{{.AgentWorkingDir}}/QtInstallerFramework-linux-x64-4.2.0.run"
userMessageOnFailure: "Failed to copy installer."
enable_if:
condition: and
@@ -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}}/IfwInstaller --target-name QtInstallerFramework-macOS-x86_64-4.1.1.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.2.0.app"
maxTimeInSeconds: 36000
maxTimeBetweenOutput: 3600
userMessageOnFailure: "Failed to create ifw installer."
@@ -114,18 +114,18 @@ instructions:
variableName: QT_CODESIGN_IDENTITY_KEY
variableValue: "A5GTH44LYL"
- type: ExecuteCommand
- command: "{{.AgentWorkingDir}}/qtsdk/qtsdk/packaging-tools/sign_installer.py mac --file={{.SourceDir}}/IfwInstaller/QtInstallerFramework-macOS-x86_64-4.1.1.app"
+ command: "{{.AgentWorkingDir}}/qtsdk/qtsdk/packaging-tools/sign_installer.py mac --file={{.SourceDir}}/IfwInstaller/QtInstallerFramework-macOS-x86_64-4.2.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}}/IfwInstaller/QtInstallerFramework-macOS-x86_64-4.1.1.dmg"
+ command: "{{.AgentWorkingDir}}/qtsdk/qtsdk/packaging-tools/notarize.py --dmg={{.SourceDir}}/IfwInstaller/QtInstallerFramework-macOS-x86_64-4.2.0.dmg"
maxTimeInSeconds: 36000
maxTimeBetweenOutput: 3600
userMessageOnFailure: "Failed to notarize the ifw installer"
- type: Rename
- sourcePath: "{{.SourceDir}}/IfwInstaller/QtInstallerFramework-macOS-x86_64-4.1.1.dmg"
- targetPath: "{{.InstallRoot}}/{{.AgentWorkingDir}}/QtInstallerFramework-macOS-x86_64-4.1.1.dmg"
+ sourcePath: "{{.SourceDir}}/IfwInstaller/QtInstallerFramework-macOS-x86_64-4.2.0.dmg"
+ targetPath: "{{.InstallRoot}}/{{.AgentWorkingDir}}/QtInstallerFramework-macOS-x86_64-4.2.0.dmg"
userMessageOnFailure: "Failed to copy installer."
enable_if:
condition: and
@@ -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}}\\IfwInstaller --target-name QtInstallerFramework-windows-x86-4.1.1"
+ 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.2.0"
maxTimeInSeconds: 1200
maxTimeBetweenOutput: 1200
userMessageOnFailure: "Failed to create ifw installer."
@@ -160,8 +160,8 @@ instructions:
equals_value: Windows
- type: Rename
- sourcePath: "{{.SourceDir}}/IfwInstaller/QtInstallerFramework-windows-x86-4.1.1.exe"
- targetPath: "{{.InstallRoot}}/{{.AgentWorkingDir}}/QtInstallerFramework-windows-x86-4.1.1.exe"
+ sourcePath: "{{.SourceDir}}/IfwInstaller/QtInstallerFramework-windows-x86-4.2.0.exe"
+ targetPath: "{{.InstallRoot}}/{{.AgentWorkingDir}}/QtInstallerFramework-windows-x86-4.2.0.exe"
userMessageOnFailure: "Failed to copy installer."
enable_if:
condition: property
diff --git a/dist/packages/org.qtproject.ifw.binaries/meta/package.xml b/dist/packages/org.qtproject.ifw.binaries/meta/package.xml
index c3a0a808d..4d9a3c7a7 100644
--- a/dist/packages/org.qtproject.ifw.binaries/meta/package.xml
+++ b/dist/packages/org.qtproject.ifw.binaries/meta/package.xml
@@ -2,7 +2,7 @@
<Package>
<DisplayName>Qt Installer Framework Binaries</DisplayName>
<Description>Installs the binaries, examples and help files.</Description>
- <Version>4.1.1</Version>
- <ReleaseDate>2020-12-09</ReleaseDate>
+ <Version>4.2.0</Version>
+ <ReleaseDate>2021-03-03</ReleaseDate>
<Default>True</Default>
</Package>
diff --git a/dist/packages/org.qtproject.ifw/meta/package.xml b/dist/packages/org.qtproject.ifw/meta/package.xml
index 2b32b5c74..5c56a177e 100644
--- a/dist/packages/org.qtproject.ifw/meta/package.xml
+++ b/dist/packages/org.qtproject.ifw/meta/package.xml
@@ -2,8 +2,8 @@
<Package>
<DisplayName>Qt Installer Framework</DisplayName>
<Description>Installs the Qt Installer Framework.</Description>
- <Version>4.1.1</Version>
- <ReleaseDate>2020-12-09</ReleaseDate>
+ <Version>4.2.0</Version>
+ <ReleaseDate>2021-03-03</ReleaseDate>
<Licenses>
<License name="The Qt Company GPL Exception 1.0" file="LICENSE.GPL3-EXCEPT" />
<License name="Third Party Code Licenses" file="3RDPARTY" />
diff --git a/doc/installerfw-using.qdoc b/doc/installerfw-using.qdoc
index f0205755f..5c5bbbbc4 100644
--- a/doc/installerfw-using.qdoc
+++ b/doc/installerfw-using.qdoc
@@ -448,10 +448,12 @@
The \c search command can be used to search components from available repositories, or
from integrated binary content in case of an offline installer. It can be used with
no arguments to list all available components or with a regular expression to get a list
- of only components matching the pattern:
+ of only components matching the pattern. The \c --filter-packages option can be
+ used to specify additional filters for the search operation. For a list of usable
+ information elements with the option, refer to \l{Summary of Package Information File Elements}.
\code
- installer.exe search "expression"
+ installer.exe --filter-packages "DisplayName=MyComponent, Version=1.0" search "expression"
\endcode
\section1 Performing Full Uninstallation
diff --git a/doc/installerfw.qdoc b/doc/installerfw.qdoc
index c76576f27..0d60a3fca 100644
--- a/doc/installerfw.qdoc
+++ b/doc/installerfw.qdoc
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2020 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -247,6 +247,11 @@
\li Create a local repository inside the installation directory. This option has no
effect on online installers.
\row
+ \li --fp, --filter-packages <element=regex,...>
+ \li [CLI] Comma separated list of additional key-value pair filters used to query packages with the
+ search command. The keys can be any of the possible package information elements, like
+ \c DisplayName and \c Description.
+ \row
\li --am, --accept-messages
\li [CLI] Accepts all message queries without user input.
\row
@@ -316,6 +321,9 @@
\row
\li se, search <regexp>
\li Search available packages. If no search pattern is given, show all available packages.
+
+ \note The \c --filter-packages option can be used to specify additional filters for
+ the search operation. See \l{Summary of Options}.
\row
\li co, create-offline <pkg ...>
\li Create offline installer from selected packages.
@@ -1235,6 +1243,11 @@
\row
\li -v or --verbose
\li Display debug output.
+ \row
+ \li -s or --sha-update p1,...,pn
+ \li Comma-separated list of packages to be updated based on the component sha
+ checksum instead of the version number. This parameter adds a new \c <ContentSha1>
+ node to the \c Updates.xml.
\endtable
\note We recommend that you use the \c {--update-new-packages} parameter
to update an existing repository, especially if you have a content delivery
diff --git a/doc/scripting-api/packagemanagercore.qdoc b/doc/scripting-api/packagemanagercore.qdoc
index 39387b3ae..918aed78d 100644
--- a/doc/scripting-api/packagemanagercore.qdoc
+++ b/doc/scripting-api/packagemanagercore.qdoc
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2020 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -862,6 +862,12 @@
*/
/*!
+ \qmlmethod boolean installer::isPackageViewer()
+
+ Returns \c true if the current installer is executed as package viewer.
+*/
+
+/*!
\qmlmethod boolean installer::isUserSetBinaryMarker()
Returns \c true if the magic binary marker has been set by user.
diff --git a/installerfw.pri b/installerfw.pri
index 0d15824e3..377d07d2c 100644
--- a/installerfw.pri
+++ b/installerfw.pri
@@ -3,9 +3,9 @@
}
IFW_PRI_INCLUDED = 1
-IFW_VERSION_STR = 4.1.1
-IFW_VERSION = 0x040101
-IFW_VERSION_WIN32 = 4,1,1,0
+IFW_VERSION_STR = 4.2.0
+IFW_VERSION = 0x040200
+IFW_VERSION_WIN32 = 4,2,0,0
IFW_VERSION_STR_WIN32 = $$IFW_VERSION_STR\0
diff --git a/src/libs/ifwtools/binarycreator.cpp b/src/libs/ifwtools/binarycreator.cpp
index deea01ed7..a813c7f50 100644
--- a/src/libs/ifwtools/binarycreator.cpp
+++ b/src/libs/ifwtools/binarycreator.cpp
@@ -410,9 +410,9 @@ static int assemble(Input input, const QInstaller::Settings &settings, const QSt
collection.setName(info.name.toUtf8());
qDebug() << "Creating resource archive for" << info.name;
- foreach (const QString &file, info.copiedFiles) {
- const QSharedPointer<Resource> resource(new Resource(file));
- qDebug().nospace() << "Appending " << file << " (" << humanReadableSize(resource->size()) << ")";
+ foreach (const QString &copiedFile, info.copiedFiles) {
+ const QSharedPointer<Resource> resource(new Resource(copiedFile));
+ qDebug().nospace() << "Appending " << copiedFile << " (" << humanReadableSize(resource->size()) << ")";
collection.appendResource(resource);
}
input.manager.insertCollection(collection);
@@ -610,8 +610,8 @@ void QInstallerTools::copyConfigData(const QString &configFile, const QString &t
if (tagName == QLatin1String("ProductImages")) {
const QDomNodeList childNodes = domElement.childNodes();
- for (int i = 0; i < childNodes.count(); ++i) {
- const QDomElement childElement = childNodes.at(i).toElement();
+ for (int index = 0; index < childNodes.count(); ++index) {
+ const QDomElement childElement = childNodes.at(index).toElement();
const QString childName = childElement.tagName();
if (childName != QLatin1String("Image"))
continue;
diff --git a/src/libs/ifwtools/rcc/rcc.cpp b/src/libs/ifwtools/rcc/rcc.cpp
index 10b7cbc4f..12f399937 100644
--- a/src/libs/ifwtools/rcc/rcc.cpp
+++ b/src/libs/ifwtools/rcc/rcc.cpp
@@ -120,18 +120,18 @@ public:
RCCFileInfo::RCCFileInfo(const QString &name, const QFileInfo &fileInfo,
QLocale::Language language, QLocale::Country country, uint flags,
int compressLevel, int compressThreshold)
+ : m_flags(flags)
+ , m_name(name)
+ , m_language(language)
+ , m_country(country)
+ , m_fileInfo(fileInfo)
+ , m_parent(nullptr)
+ , m_compressLevel(compressLevel)
+ , m_compressThreshold(compressThreshold)
+ , m_nameOffset(0)
+ , m_dataOffset(0)
+ , m_childOffset(0)
{
- m_name = name;
- m_fileInfo = fileInfo;
- m_language = language;
- m_country = country;
- m_flags = flags;
- m_parent = nullptr;
- m_nameOffset = 0;
- m_dataOffset = 0;
- m_childOffset = 0;
- m_compressLevel = compressLevel;
- m_compressThreshold = compressThreshold;
}
RCCFileInfo::~RCCFileInfo()
diff --git a/src/libs/ifwtools/repositorygen.cpp b/src/libs/ifwtools/repositorygen.cpp
index fbcf7b9f3..d8339b063 100644
--- a/src/libs/ifwtools/repositorygen.cpp
+++ b/src/libs/ifwtools/repositorygen.cpp
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** Copyright (C) 2020 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -52,6 +52,9 @@
#include <iostream>
+#define QUOTE_(x) #x
+#define QUOTE(x) QUOTE_(x)
+
using namespace QInstaller;
using namespace QInstallerTools;
@@ -69,6 +72,8 @@ void QInstallerTools::printRepositoryGenOptions()
std::cout << " --ignore-translations Do not use any translation" << std::endl;
std::cout << " --ignore-invalid-packages Ignore all invalid packages instead of aborting." << std::endl;
std::cout << " --ignore-invalid-repositories Ignore all invalid repositories instead of aborting." << std::endl;
+ std::cout << " -s|--sha-update p1,...,pn List of packages which are updated using" <<std::endl;
+ std::cout << " content sha1 instead of version number." << std::endl;
}
QString QInstallerTools::makePathAbsolute(const QString &path)
@@ -289,6 +294,11 @@ void QInstallerTools::copyMetaData(const QString &_targetDir, const QString &met
fileElement.setAttribute(QLatin1String("OS"), QLatin1String("Any"));
update.appendChild(fileElement);
+ if (info.createContentSha1Node) {
+ QDomNode contentSha1Element = update.appendChild(doc.createElement(QLatin1String("ContentSha1")));
+ contentSha1Element.appendChild(doc.createTextNode(info.contentSha1));
+ }
+
root.appendChild(update);
// copy script file
@@ -414,7 +424,7 @@ void QInstallerTools::copyMetaData(const QString &_targetDir, const QString &met
}
PackageInfoVector QInstallerTools::createListOfPackages(const QStringList &packagesDirectories,
- QStringList *packagesToFilter, FilterType filterType)
+ QStringList *packagesToFilter, FilterType filterType, QStringList packagesUpdatedWithSha)
{
qDebug() << "Collecting information about available packages...";
@@ -508,6 +518,13 @@ PackageInfoVector QInstallerTools::createListOfPackages(const QStringList &packa
info.dependencies = packageElement.firstChildElement(QLatin1String("Dependencies")).text()
.split(QInstaller::commaRegExp(), QString::SkipEmptyParts);
info.directory = it->filePath();
+ if (packagesUpdatedWithSha.contains(info.name)) {
+ info.createContentSha1Node = true;
+ packagesUpdatedWithSha.removeOne(info.name);
+ } else {
+ info.createContentSha1Node = false;
+ }
+
dict.push_back(info);
qDebug() << "- it provides the package" << info.name << " - " << info.version;
@@ -521,6 +538,11 @@ PackageInfoVector QInstallerTools::createListOfPackages(const QStringList &packa
if (dict.isEmpty())
qDebug() << "No available packages found at the specified location.";
+ if (!packagesUpdatedWithSha.isEmpty()) {
+ throw QInstaller::Error(QString::fromLatin1("The following packages could not be found in "
+ "package directory: %1").arg(packagesUpdatedWithSha.join(QLatin1String(", "))));
+ }
+
return dict;
}
@@ -650,8 +672,33 @@ PackageInfoVector QInstallerTools::createListOfRepositoryPackages(const QStringL
el.save(metaStream, 0);
}
info.metaNode = metaString;
- dict.push_back(info);
- qDebug() << "- it provides the package" << info.name << " - " << info.version;
+
+ bool pushToDict = true;
+ bool replacement = false;
+ // Check whether this package already exists in vector:
+ for (int i = 0; i < dict.size(); ++i) {
+ const QInstallerTools::PackageInfo oldInfo = dict.at(i);
+ if (oldInfo.name != info.name)
+ continue;
+
+ if (KDUpdater::compareVersion(info.version, oldInfo.version) > 0) {
+ // A package with newer version, it will replace the existing one.
+ dict.remove(i);
+ replacement = true;
+ } else {
+ // A package with older or same version, do not add it again.
+ pushToDict = false;
+ }
+ break;
+ }
+
+ if (pushToDict) {
+ replacement ? qDebug() << "- it provides a new version of the package" << info.name << " - " << info.version << "- replaced"
+ : qDebug() << "- it provides the package" << info.name << " - " << info.version;
+ dict.push_back(info);
+ } else {
+ qDebug() << "- it provides an old version of the package" << info.name << " - " << info.version << "- ignored";
+ }
}
}
}
@@ -755,14 +802,14 @@ QStringList QInstallerTools::unifyMetadata(const QString &repoDir, const QString
QFile archiveFile(existingRepoDir);
QInstaller::openForRead(&archiveFile);
Lib7z::extractArchive(&archiveFile, existingRepoTemp);
- QDir dir(existingRepoTemp);
- QStringList existingRepoEntries = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot);
+ QDir dir2(existingRepoTemp);
+ QStringList existingRepoEntries = dir2.entryList(QDir::Dirs | QDir::NoDotAndDotDot);
foreach (const QString existingRepoEntry, existingRepoEntries) {
if (entryList.contains(existingRepoEntry)) {
continue;
} else {
- dir.cd(existingRepoEntry);
- const QString absPath = dir.absolutePath();
+ dir2.cd(existingRepoEntry);
+ const QString absPath = dir2.absolutePath();
absPaths.append(absPath);
}
}
@@ -902,6 +949,8 @@ void QInstallerTools::copyComponentData(const QStringList &packageDirs, const QS
archiveHashFile.write(hashOfArchiveData);
qDebug() << "Generated sha1 hash:" << hashOfArchiveData;
(*infos)[i].copiedFiles.append(archiveHashFile.fileName());
+ if ((*infos)[i].createContentSha1Node)
+ (*infos)[i].contentSha1 = QLatin1String(hashOfArchiveData);
archiveHashFile.close();
} catch (const QInstaller::Error &/*e*/) {
archiveFile.close();
@@ -987,3 +1036,60 @@ QString QInstallerTools::existingUniteMeta7z(const QString &repositoryDir)
}
return uniteMeta7z;
}
+
+PackageInfoVector QInstallerTools::collectPackages(RepositoryInfo info, QStringList *filteredPackages, FilterType filterType, bool updateNewComponents, QStringList packagesUpdatedWithSha)
+{
+ PackageInfoVector packages;
+ PackageInfoVector precompressedPackages = QInstallerTools::createListOfRepositoryPackages(info.repositoryPackages,
+ filteredPackages, filterType);
+ packages.append(precompressedPackages);
+
+ PackageInfoVector preparedPackages = QInstallerTools::createListOfPackages(info.packages,
+ filteredPackages, filterType, packagesUpdatedWithSha);
+ packages.append(preparedPackages);
+ if (updateNewComponents) {
+ filterNewComponents(info.repositoryDir, packages);
+ }
+ foreach (const QInstallerTools::PackageInfo &package, packages) {
+ const QFileInfo fi(info.repositoryDir, package.name);
+ if (fi.exists())
+ removeDirectory(fi.absoluteFilePath());
+ }
+ return packages;
+}
+
+void QInstallerTools::createRepository(RepositoryInfo info, PackageInfoVector *packages,
+ const QString &tmpMetaDir, bool createComponentMetadata, bool createUnifiedMetadata)
+{
+ QHash<QString, QString> pathToVersionMapping = QInstallerTools::buildPathToVersionMapping(*packages);
+
+ QStringList directories;
+ directories.append(info.packages);
+ directories.append(info.repositoryPackages);
+ QStringList unite7zFiles;
+ foreach (const QString &repositoryDirectory, info.repositoryPackages) {
+ QDirIterator it(repositoryDirectory, QStringList(QLatin1String("*_meta.7z"))
+ , QDir::Files | QDir::CaseSensitive);
+ while (it.hasNext()) {
+ it.next();
+ unite7zFiles.append(it.fileInfo().absoluteFilePath());
+ }
+ }
+ QInstallerTools::copyComponentData(directories, info.repositoryDir, packages);
+ QInstallerTools::copyMetaData(tmpMetaDir, info.repositoryDir, *packages, QLatin1String("{AnyApplication}"),
+ QLatin1String(QUOTE(IFW_REPOSITORY_FORMAT_VERSION)), unite7zFiles);
+
+ QString existing7z = QInstallerTools::existingUniteMeta7z(info.repositoryDir);
+ if (!existing7z.isEmpty())
+ existing7z = info.repositoryDir + QDir::separator() + existing7z;
+ QInstallerTools::compressMetaDirectories(tmpMetaDir, existing7z, pathToVersionMapping,
+ createComponentMetadata, createUnifiedMetadata);
+
+ QDirIterator it(info.repositoryDir, QStringList(QLatin1String("Updates*.xml"))
+ << QLatin1String("*_meta.7z"), QDir::Files | QDir::CaseSensitive);
+ while (it.hasNext()) {
+ it.next();
+ QFile::remove(it.fileInfo().absoluteFilePath());
+ }
+ QInstaller::moveDirectoryContents(tmpMetaDir, info.repositoryDir);
+}
diff --git a/src/libs/ifwtools/repositorygen.h b/src/libs/ifwtools/repositorygen.h
index 49d0a51dd..0da81db67 100644
--- a/src/libs/ifwtools/repositorygen.h
+++ b/src/libs/ifwtools/repositorygen.h
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** Copyright (C) 2020 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -48,6 +48,8 @@ struct IFWTOOLS_EXPORT PackageInfo
QStringList copiedFiles;
QString metaFile;
QString metaNode;
+ QString contentSha1;
+ bool createContentSha1Node;
};
typedef QVector<PackageInfo> PackageInfoVector;
@@ -56,12 +58,19 @@ enum IFWTOOLS_EXPORT FilterType {
Exclude
};
+struct IFWTOOLS_EXPORT RepositoryInfo
+{
+ QStringList packages;
+ QStringList repositoryPackages;
+ QString repositoryDir;
+};
+
void IFWTOOLS_EXPORT printRepositoryGenOptions();
QString IFWTOOLS_EXPORT makePathAbsolute(const QString &path);
void IFWTOOLS_EXPORT copyWithException(const QString &source, const QString &target, const QString &kind = QString());
PackageInfoVector IFWTOOLS_EXPORT createListOfPackages(const QStringList &packagesDirectories, QStringList *packagesToFilter,
- FilterType ftype);
+ FilterType ftype, QStringList packagesUpdatedWithSha = QStringList());
PackageInfoVector IFWTOOLS_EXPORT createListOfRepositoryPackages(const QStringList &repositoryDirectories, QStringList *packagesToFilter,
FilterType filterType);
@@ -82,7 +91,8 @@ void IFWTOOLS_EXPORT copyComponentData(const QStringList &packageDir, const QStr
void IFWTOOLS_EXPORT filterNewComponents(const QString &repositoryDir, QInstallerTools::PackageInfoVector &packages);
QString IFWTOOLS_EXPORT existingUniteMeta7z(const QString &repositoryDir);
-
+PackageInfoVector IFWTOOLS_EXPORT collectPackages(RepositoryInfo info, QStringList *filteredPackages, FilterType filterType, bool updateNewComponents, QStringList packagesUpdatedWithSha);
+void IFWTOOLS_EXPORT createRepository(RepositoryInfo info, PackageInfoVector *packages, const QString &tmpMetaDir, bool createComponentMetadata, bool createUnifiedMetadata);
} // namespace QInstallerTools
#endif // REPOSITORYGEN_H
diff --git a/src/libs/installer/adminauthorization_x11.cpp b/src/libs/installer/adminauthorization_x11.cpp
index 14691c9de..f4951d523 100644
--- a/src/libs/installer/adminauthorization_x11.cpp
+++ b/src/libs/installer/adminauthorization_x11.cpp
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -28,41 +28,18 @@
#include "adminauthorization.h"
-#include <QtCore/QFile>
-#include <QtCore/QRegExp>
-#include <QDebug>
+#include "globals.h"
+#include <QDebug>
#include <QApplication>
-#include <QInputDialog>
#include <QMessageBox>
+#include <QProcess>
-#include <cstdlib>
-#include <sys/resource.h>
#include <unistd.h>
-#include <fcntl.h>
-
-#ifdef Q_OS_LINUX
-#include <linux/limits.h>
-#include <pty.h>
-#else
-#ifdef Q_OS_FREEBSD
-#include <libutil.h>
-#include <signal.h>
-#else
-#include <util.h>
-#endif
-#endif
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <errno.h>
#include <iostream>
-#include "globals.h"
-
-#define SU_COMMAND "/usr/bin/sudo"
-//#define SU_COMMAND "/bin/echo"
+#define PKEXEC_COMMAND "/usr/bin/pkexec"
namespace QInstaller {
@@ -72,24 +49,6 @@ namespace QInstaller {
\internal
*/
-static QString getPassword(QWidget *parent)
-{
- if (qobject_cast<QApplication*> (qApp) != 0) {
- bool ok = false;
- const QString result = QInputDialog::getText(parent, QObject::tr("Authorization required"),
- QObject::tr("Enter your password to authorize for sudo:"),
- QLineEdit::Password, QString(), &ok);
- return ok ? result : QString();
- } else {
- std::cout << QObject::tr("Authorization required").toStdString() << std::endl;
- std::cout << QObject::tr("Enter your password to authorize for sudo:").toStdString()
- << std::endl;
- std::string password;
- std::cin >> password;
- return QString::fromStdString(password);
- }
-}
-
static void printError(QWidget *parent, const QString &value)
{
if (qobject_cast<QApplication*> (qApp) != 0) {
@@ -105,184 +64,21 @@ bool AdminAuthorization::execute(QWidget *parent, const QString &program, const
const QString fallback = program + QLatin1String(" ") + arguments.join(QLatin1String(" "));
qCDebug(QInstaller::lcServer) << "Fallback:" << fallback;
- // as we cannot pipe the password to su in QProcess, we need to setup a pseudo-terminal for it
- int masterFD = -1;
- int slaveFD = -1;
- char ptsn[ PATH_MAX ];
+ QProcess process;
+ process.setProcessChannelMode(QProcess::MergedChannels);
+ process.start(QLatin1String(PKEXEC_COMMAND), QStringList() << program << arguments, QIODevice::ReadOnly);
- if (::openpty(&masterFD, &slaveFD, ptsn, 0, 0))
- return false;
-
- masterFD = ::posix_openpt(O_RDWR | O_NOCTTY);
- if (masterFD < 0)
- return false;
-
- const QByteArray ttyName = ::ptsname(masterFD);
-
- if (::grantpt(masterFD)) {
- ::close(masterFD);
- return false;
- }
-
- ::revoke(ttyName);
- ::unlockpt(masterFD);
-
- slaveFD = ::open(ttyName, O_RDWR | O_NOCTTY);
- if (slaveFD < 0) {
- ::close(masterFD);
+ if (!process.waitForStarted() || !process.waitForFinished(-1)) {
+ printError(parent, process.errorString());
+ if (process.state() > QProcess::NotRunning)
+ process.kill();
return false;
}
-
- ::fcntl(masterFD, F_SETFD, FD_CLOEXEC);
- ::fcntl(slaveFD, F_SETFD, FD_CLOEXEC);
- int pipedData[2];
- if (pipe(pipedData) != 0)
- return false;
-
- int flags = ::fcntl(pipedData[0], F_GETFL);
- if (flags != -1)
- ::fcntl(pipedData[0], F_SETFL, flags | O_NONBLOCK);
-
- flags = ::fcntl(masterFD, F_GETFL);
- if (flags != -1)
- ::fcntl(masterFD, F_SETFL, flags | O_NONBLOCK);
-
- pid_t child = fork();
-
- if (child < -1) {
- ::close(masterFD);
- ::close(slaveFD);
- ::close(pipedData[0]);
- ::close(pipedData[1]);
- return false;
- }
-
- // parent process
- else if (child > 0) {
- ::close(slaveFD);
- //close writing end of pipe
- ::close(pipedData[1]);
-
- QRegExp re(QLatin1String("[Pp]assword.*:"));
- QByteArray data;
- QByteArray errData;
- int bytes = 0;
- int errBytes = 0;
- char buf[1024];
- char errBuf[1024];
- int status;
- bool statusValid = false;
- while (bytes >= 0) {
- const pid_t waitResult = ::waitpid(child, &status, WNOHANG);
- if (waitResult == -1) {
- break;
- }
- if (waitResult == child) {
- statusValid = true;
- break;
- }
- bytes = ::read(masterFD, buf, 1023);
- if (bytes == -1 && errno == EAGAIN)
- bytes = 0;
- else if (bytes > 0)
- data.append(buf, bytes);
- errBytes = ::read(pipedData[0], errBuf, 1023);
- if (errBytes > 0)
- {
- errData.append(errBuf, errBytes);
- errBytes=0;
- }
- if (bytes > 0) {
- const QString line = QString::fromLatin1(data);
- if (re.indexIn(line) != -1) {
- const QString password = getPassword(parent);
- if (password.isEmpty()) {
- QByteArray pwd = password.toLatin1();
- for (int i = 0; i < 3; ++i) {
- ::write(masterFD, pwd.data(), pwd.length());
- ::write(masterFD, "\n", 1);
- }
- return false;
- }
- QByteArray pwd = password.toLatin1();
- ::write(masterFD, pwd.data(), pwd.length());
- ::write(masterFD, "\n", 1);
- ::read(masterFD, buf, pwd.length() + 1);
- }
- }
- if (bytes == 0)
- ::usleep(100000);
- }
-
- while (true) {
- errBytes = ::read(pipedData[0], errBuf, 1023);
- if (errBytes == -1 && errno == EAGAIN) {
- ::usleep(100000);
- continue;
- }
-
- if (errBytes <= 0)
- break;
-
- errData.append(errBuf, errBytes);
- }
-
- const bool success = statusValid && WIFEXITED(status) && WEXITSTATUS(status) == 0;
-
- if (!success && !errData.isEmpty()) {
- printError(parent, QString::fromLocal8Bit(errData.constData()));
- }
-
- ::close(pipedData[0]);
- return success;
- }
-
- // child process
- else {
- ::close(pipedData[0]);
- // Reset signal handlers
- for (int sig = 1; sig < NSIG; ++sig)
- signal(sig, SIG_DFL);
- signal(SIGHUP, SIG_IGN);
-
- ::setsid();
-
- ::ioctl(slaveFD, TIOCSCTTY, 1);
- int pgrp = ::getpid();
- ::tcsetpgrp(slaveFD, pgrp);
-
- ::dup2(slaveFD, 0);
- ::dup2(slaveFD, 1);
- ::dup2(pipedData[1], 2);
-
- // close all file descriptors
- struct rlimit rlp;
- getrlimit(RLIMIT_NOFILE, &rlp);
- for (int i = 3; i < static_cast<int>(rlp.rlim_cur); ++i)
- ::close(i);
-
- char **argp = (char **) ::malloc((arguments.count() + 4) * sizeof(char *));
- QList<QByteArray> args;
- args.push_back(SU_COMMAND);
- args.push_back("-b");
- args.push_back(program.toLocal8Bit());
- for (QStringList::const_iterator it = arguments.begin(); it != arguments.end(); ++it)
- args.push_back(it->toLocal8Bit());
-
- int i = 0;
- for (QList<QByteArray>::iterator it = args.begin(); it != args.end(); ++it, ++i)
- argp[i] = it->data();
- argp[i] = 0;
-
- ::unsetenv("LANG");
- ::unsetenv("LC_ALL");
-
- int exitStatus = 0;
- if (::execv(SU_COMMAND, argp) == -1)
- exitStatus = -errno;
- _exit(exitStatus);
+ if (process.exitCode() != EXIT_SUCCESS) {
+ printError(parent, QLatin1String(process.readAll()));
return false;
}
+ return true;
}
// has no guarantee to work
diff --git a/src/libs/installer/binarycontent.h b/src/libs/installer/binarycontent.h
index a21cd69e7..7d50c0e28 100644
--- a/src/libs/installer/binarycontent.h
+++ b/src/libs/installer/binarycontent.h
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -48,6 +48,13 @@ public:
static const qint64 MagicUpdaterMarker = 0x12023235UL;
static const qint64 MagicPackageManagerMarker = 0x12023236UL;
+ // additional distinguishers only used at runtime, not written to the binary itself
+ enum MagicMarkerSupplement {
+ Default = 0x0,
+ OfflineGenerator = 0x1,
+ PackageViewer = 0x2
+ };
+
// the cookie put at the end of the file
static const quint64 MagicCookie = 0xc2630a1c99d668f8LL; // binary
static const quint64 MagicCookieDat = 0xc2630a1c99d668f9LL; // data
diff --git a/src/libs/installer/commandlineparser.cpp b/src/libs/installer/commandlineparser.cpp
index 59d42eefc..4bfc4ad3a 100644
--- a/src/libs/installer/commandlineparser.cpp
+++ b/src/libs/installer/commandlineparser.cpp
@@ -59,6 +59,9 @@ CommandLineParser::CommandLineParser()
.arg(CommandLineOptions::scListShort, CommandLineOptions::scListLong)
+ indent + QString::fromLatin1("%1, %2 - search available packages - <regexp>\n")
.arg(CommandLineOptions::scSearchShort, CommandLineOptions::scSearchLong)
+ + indent + indent + QString::fromLatin1("Note: The --%1 option can be used to specify\n")
+ .arg(CommandLineOptions::scFilterPackagesLong)
+ + indent + indent + QLatin1String("additional filters for the search operation\n")
+ indent + QString::fromLatin1("%1, %2 - create offline installer from selected packages - <pkg ...>\n")
.arg(CommandLineOptions::scCreateOfflineShort, CommandLineOptions::scCreateOfflineLong)
+ indent + QString::fromLatin1("%1, %2 - uninstall all packages and remove entire program directory")
@@ -161,6 +164,12 @@ CommandLineParser::CommandLineParser()
<< CommandLineOptions::scCreateLocalRepositoryShort << CommandLineOptions::scCreateLocalRepositoryLong,
QLatin1String("Create a local repository inside the installation directory. This option "
"has no effect on online installers.")));
+ addOptionWithContext(QCommandLineOption(QStringList()
+ << CommandLineOptions::scFilterPackagesShort << CommandLineOptions::scFilterPackagesLong,
+ QLatin1String("[CLI] Comma separated list of additional key-value pair filters used to query packages with the "
+ "search command. The keys can be any of the possible package information elements, like "
+ "\"DisplayName\" and \"Description\"."),
+ QLatin1String("element=regex,...")), CommandLineOnly);
// Message query options
addOptionWithContext(QCommandLineOption(QStringList() << CommandLineOptions::scAcceptMessageQueryShort
diff --git a/src/libs/installer/component.cpp b/src/libs/installer/component.cpp
index cb9959ba3..b4b96eb08 100644
--- a/src/libs/installer/component.cpp
+++ b/src/libs/installer/component.cpp
@@ -300,11 +300,14 @@ void Component::loadDataFromPackage(const KDUpdater::LocalPackage &package)
setValue(scCurrentState, scInstalled);
setValue(scCheckable, package.checkable ? scTrue : scFalse);
setValue(scExpandedByDefault, package.expandedByDefault ? scTrue : scFalse);
+ setValue(scContentSha1, package.contentSha1);
}
/*!
Sets variables according to the values set in the package.xml file of \a package.
Also loads UI files, licenses and translations if they are referenced in the package.xml.
+ If the \c PackageManagerCore object of this component is run as package viewer, then
+ only sets the variables without loading referenced files.
*/
void Component::loadDataFromPackage(const Package &package)
{
@@ -341,6 +344,10 @@ void Component::loadDataFromPackage(const Package &package)
if (PackageManagerCore::noForceInstallation())
forced = scFalse;
setValue(scForcedInstallation, forced);
+ setValue(scContentSha1, package.data(scContentSha1).toString());
+
+ if (d->m_core->isPackageViewer())
+ return;
setLocalTempPath(QInstaller::pathFromUrl(package.packageSource().url));
const QStringList uis = package.data(QLatin1String("UserInterfaces")).toString()
diff --git a/src/libs/installer/component_p.cpp b/src/libs/installer/component_p.cpp
index 8533d8e4c..0f74e423c 100644
--- a/src/libs/installer/component_p.cpp
+++ b/src/libs/installer/component_p.cpp
@@ -54,6 +54,7 @@ ComponentPrivate::ComponentPrivate(PackageManagerCore *core, Component *qq)
, m_autoCreateOperations(true)
, m_operationsCreatedSuccessfully(true)
, m_updateIsAvailable(false)
+ , m_unstable(false)
{
}
diff --git a/src/libs/installer/componentmodel.cpp b/src/libs/installer/componentmodel.cpp
index aab487b45..642828ad7 100644
--- a/src/libs/installer/componentmodel.cpp
+++ b/src/libs/installer/componentmodel.cpp
@@ -260,9 +260,9 @@ bool ComponentModel::setData(const QModelIndex &index, const QVariant &value, in
newValue = (oldValue == Qt::Checked) ? Qt::Unchecked : Qt::Checked;
}
QSet<QModelIndex> changed = updateCheckedState(nodes << component, newValue);
- foreach (const QModelIndex &index, changed) {
- emit dataChanged(index, index);
- emit checkStateChanged(index);
+ foreach (const QModelIndex &changedIndex, changed) {
+ emit dataChanged(changedIndex, changedIndex);
+ emit checkStateChanged(changedIndex);
}
updateAndEmitModelState(); // update the internal state
} else {
diff --git a/src/libs/installer/componentselectionpage_p.cpp b/src/libs/installer/componentselectionpage_p.cpp
index a9f4ba134..974ae1502 100644
--- a/src/libs/installer/componentselectionpage_p.cpp
+++ b/src/libs/installer/componentselectionpage_p.cpp
@@ -49,6 +49,7 @@
#include <QFileDialog>
#include <QStackedLayout>
#include <QStackedWidget>
+#include <QToolBox>
namespace QInstaller {
@@ -66,19 +67,29 @@ ComponentSelectionPagePrivate::ComponentSelectionPagePrivate(ComponentSelectionP
, m_updaterModel(m_core->updaterComponentModel())
, m_currentModel(m_allModel)
, m_allowCompressedRepositoryInstall(false)
+ , m_toolBox(nullptr)
+ , m_descriptionBaseWidget(nullptr)
, m_categoryWidget(Q_NULLPTR)
+ , m_categoryLayoutVisible(false)
{
m_treeView->setObjectName(QLatin1String("ComponentsTreeView"));
- QVBoxLayout *descriptionVLayout = new QVBoxLayout;
+ m_descriptionBaseWidget = new QWidget(q);
+ m_descriptionBaseWidget->setObjectName(QLatin1String("DescriptionBaseWidget"));
+
+ QVBoxLayout *descriptionVLayout = new QVBoxLayout(m_descriptionBaseWidget);
descriptionVLayout->setObjectName(QLatin1String("DescriptionLayout"));
+ descriptionVLayout->setContentsMargins(0, 0, 0, 0);
+
+ m_toolBox = new QToolBox(q);
+ m_toolBox->setObjectName(QLatin1String("ToolBox"));
QScrollArea *descriptionScrollArea = new QScrollArea(q);
descriptionScrollArea->setWidgetResizable(true);
descriptionScrollArea->setFrameShape(QFrame::NoFrame);
descriptionScrollArea->setObjectName(QLatin1String("DescriptionScrollArea"));
- m_descriptionLabel = new QLabel(q);
+ m_descriptionLabel = new QLabel(m_descriptionBaseWidget);
m_descriptionLabel->setWordWrap(true);
m_descriptionLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
m_descriptionLabel->setOpenExternalLinks(true);
@@ -87,8 +98,7 @@ ComponentSelectionPagePrivate::ComponentSelectionPagePrivate(ComponentSelectionP
descriptionScrollArea->setWidget(m_descriptionLabel);
descriptionVLayout->addWidget(descriptionScrollArea);
- m_sizeLabel = new QLabel(q);
- m_sizeLabel->setMargin(5);
+ m_sizeLabel = new QLabel(m_descriptionBaseWidget);
m_sizeLabel->setWordWrap(true);
m_sizeLabel->setObjectName(QLatin1String("ComponentSizeLabel"));
descriptionVLayout->addWidget(m_sizeLabel);
@@ -151,11 +161,11 @@ ComponentSelectionPagePrivate::ComponentSelectionPagePrivate(ComponentSelectionP
QWidget *mainStackedWidget = new QWidget();
m_mainGLayout = new QGridLayout(mainStackedWidget);
- m_mainGLayout->addLayout(buttonHLayout, 0, 1);
- m_mainGLayout->addLayout(treeViewVLayout, 1, 1);
- m_mainGLayout->addLayout(descriptionVLayout, 1, 2);
- m_mainGLayout->setColumnStretch(1, 3);
- m_mainGLayout->setColumnStretch(2, 2);
+ m_mainGLayout->addLayout(buttonHLayout, 0, 0);
+ m_mainGLayout->addLayout(treeViewVLayout, 1, 0);
+ m_mainGLayout->addWidget(m_descriptionBaseWidget, 1, 1);
+ m_mainGLayout->setColumnStretch(0, 3);
+ m_mainGLayout->setColumnStretch(1, 2);
m_stackedLayout = new QStackedLayout(q);
m_stackedLayout->addWidget(mainStackedWidget);
@@ -227,11 +237,11 @@ void ComponentSelectionPagePrivate::setupCategoryLayout()
vLayout->setContentsMargins(0, 0, 0, 0);
m_categoryWidget->setLayout(vLayout);
m_categoryGroupBox = new QGroupBox(q);
- m_categoryGroupBox->setTitle(m_core->settings().repositoryCategoryDisplayName());
m_categoryGroupBox->setObjectName(QLatin1String("CategoryGroupBox"));
QVBoxLayout *categoryLayout = new QVBoxLayout(m_categoryGroupBox);
QPushButton *fetchCategoryButton = new QPushButton(tr("Filter"));
fetchCategoryButton->setObjectName(QLatin1String("FetchCategoryButton"));
+ fetchCategoryButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
fetchCategoryButton->setToolTip(
ComponentSelectionPage::tr("Filter the enabled repository categories to selection."));
connect(fetchCategoryButton, &QPushButton::clicked, this,
@@ -249,16 +259,29 @@ void ComponentSelectionPagePrivate::setupCategoryLayout()
vLayout->addWidget(m_categoryGroupBox);
vLayout->addStretch();
- m_mainGLayout->addWidget(m_categoryWidget, 1, 0);
+ m_toolBox->insertItem(1, m_categoryWidget, m_core->settings().repositoryCategoryDisplayName());
}
void ComponentSelectionPagePrivate::showCategoryLayout(bool show)
{
+ if (!show && !m_categoryWidget)
+ return;
+
+ if (show == m_categoryLayoutVisible)
+ return;
+
+ setupCategoryLayout();
if (show) {
- setupCategoryLayout();
+ m_mainGLayout->removeWidget(m_descriptionBaseWidget);
+ m_toolBox->insertItem(0, m_descriptionBaseWidget, tr("Component Information"));
+ m_mainGLayout->addWidget(m_toolBox, 1, 1);
+ } else {
+ m_toolBox->removeItem(0);
+ m_mainGLayout->removeWidget(m_toolBox);
+ m_mainGLayout->addWidget(m_descriptionBaseWidget, 1, 1);
}
- if (m_categoryWidget)
- m_categoryWidget->setVisible(show);
+ m_toolBox->setVisible(show);
+ m_categoryLayoutVisible = show;
}
void ComponentSelectionPagePrivate::updateTreeView()
@@ -399,10 +422,9 @@ void ComponentSelectionPagePrivate::fetchRepositoryCategories()
{
updateWidgetVisibility(true);
- QCheckBox *checkbox;
QList<QCheckBox*> checkboxes = m_categoryGroupBox->findChildren<QCheckBox *>();
for (int i = 0; i < checkboxes.count(); i++) {
- checkbox = checkboxes.at(i);
+ QCheckBox *checkbox = checkboxes.at(i);
enableRepositoryCategory(checkbox->objectName(), checkbox->isChecked());
}
diff --git a/src/libs/installer/componentselectionpage_p.h b/src/libs/installer/componentselectionpage_p.h
index 37f808286..d2d30e3f0 100644
--- a/src/libs/installer/componentselectionpage_p.h
+++ b/src/libs/installer/componentselectionpage_p.h
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** Copyright (C) 2018 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -46,6 +46,7 @@ class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QStackedLayout;
+class QToolBox;
namespace QInstaller {
@@ -88,6 +89,8 @@ private:
ComponentSelectionPage *q;
PackageManagerCore *m_core;
QTreeView *m_treeView;
+ QToolBox *m_toolBox;
+ QWidget *m_descriptionBaseWidget;
QLabel *m_sizeLabel;
QLabel *m_descriptionLabel;
QPushButton *m_checkAll;
@@ -99,6 +102,7 @@ private:
QProgressBar *m_progressBar;
QGridLayout *m_mainGLayout;
bool m_allowCompressedRepositoryInstall;
+ bool m_categoryLayoutVisible;
ComponentModel *m_allModel;
ComponentModel *m_updaterModel;
ComponentModel *m_currentModel;
diff --git a/src/libs/installer/constants.h b/src/libs/installer/constants.h
index 42b14ce63..0e16d4c4b 100644
--- a/src/libs/installer/constants.h
+++ b/src/libs/installer/constants.h
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** Copyright (C) 2020 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -67,6 +67,7 @@ static const QLatin1String scUncompressedSizeSum("UncompressedSizeSum");
static const QLatin1String scRequiresAdminRights("RequiresAdminRights");
static const QLatin1String scOfflineBinaryName("OfflineBinaryName");
static const QLatin1String scSHA1("SHA1");
+static const QLatin1String scContentSha1("ContentSha1");
// constants used throughout the components class
static const QLatin1String scVirtual("Virtual");
@@ -202,6 +203,8 @@ static const QLatin1String scCreateLocalRepositoryShort("cl");
static const QLatin1String scCreateLocalRepositoryLong("create-local-repository");
static const QLatin1String scNoDefaultInstallationShort("nd");
static const QLatin1String scNoDefaultInstallationLong("no-default-installations");
+static const QLatin1String scFilterPackagesShort("fp");
+static const QLatin1String scFilterPackagesLong("filter-packages");
// Developer options
static const QLatin1String scScriptShort("s");
diff --git a/src/libs/installer/installiconsoperation.cpp b/src/libs/installer/installiconsoperation.cpp
index 9443b7f71..de1ddcc4f 100644
--- a/src/libs/installer/installiconsoperation.cpp
+++ b/src/libs/installer/installiconsoperation.cpp
@@ -134,8 +134,8 @@ bool InstallIconsOperation::performOperation()
if (status == PackageManagerCore::Canceled || status == PackageManagerCore::Failure)
return true;
- const QString &source = it.next();
- QString target = targetDir.absoluteFilePath(sourceDir.relativeFilePath(source));
+ const QString &source2 = it.next();
+ QString target = targetDir.absoluteFilePath(sourceDir.relativeFilePath(source2));
emit outputTextChanged(target);
@@ -185,7 +185,7 @@ bool InstallIconsOperation::performOperation()
}
// copy the file to its new location
- QFile cf(source);
+ QFile cf(source2);
if (!cf.copy(target)) {
setError(UserDefinedError);
setErrorString(tr("Failed to copy file \"%1\": %2").arg(
@@ -193,8 +193,8 @@ bool InstallIconsOperation::performOperation()
undoOperation();
return false;
}
- deleteFileNowOrLater(source);
- files.push_back(source);
+ deleteFileNowOrLater(source2);
+ files.push_back(source2);
files.push_back(target);
setValue(QLatin1String("files"), files);
} else if (fi.isDir() && !QDir(target).exists()) {
diff --git a/src/libs/installer/keepaliveobject.cpp b/src/libs/installer/keepaliveobject.cpp
index 94e91efd8..18ec9743a 100644
--- a/src/libs/installer/keepaliveobject.cpp
+++ b/src/libs/installer/keepaliveobject.cpp
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -48,7 +48,12 @@ KeepAliveObject::KeepAliveObject()
void KeepAliveObject::start()
{
+ if (m_timer)
+ delete m_timer;
m_timer = new QTimer(this);
+
+ if (m_socket)
+ delete m_socket;
m_socket = new QLocalSocket(this);
connect(m_timer, &QTimer::timeout, [this]() {
diff --git a/src/libs/installer/loggingutils.cpp b/src/libs/installer/loggingutils.cpp
index 0ebba10db..45f7aab1b 100644
--- a/src/libs/installer/loggingutils.cpp
+++ b/src/libs/installer/loggingutils.cpp
@@ -259,7 +259,7 @@ void LoggingHandler::printComponentInfo(const QList<Component *> components) con
QDomElement root = doc.createElement(QLatin1String("updates"));
doc.appendChild(root);
- foreach (Component *component, components) {
+ foreach (const Component *component, components) {
QDomElement update = doc.createElement(QLatin1String("update"));
update.setAttribute(QLatin1String("name"), component->value(scDisplayName));
update.setAttribute(QLatin1String("version"), component->value(scVersion));
diff --git a/src/libs/installer/packagemanagercore.cpp b/src/libs/installer/packagemanagercore.cpp
index 145eb30d7..61b2273af 100644
--- a/src/libs/installer/packagemanagercore.cpp
+++ b/src/libs/installer/packagemanagercore.cpp
@@ -1556,9 +1556,8 @@ bool PackageManagerCore::fetchPackagesTree(const PackagesList &packages, const L
continue;
const LocalPackage localPackage = installedPackages.value(name);
- const QString updateVersion = update->data(scVersion).toString();
- if (KDUpdater::compareVersion(updateVersion, localPackage.version) <= 0)
- continue; // remote version equals or is less than the installed maintenance tool
+ if (!d->packageNeedsUpdate(localPackage, update))
+ continue;
const QDate updateDate = update->data(scReleaseDate).toDate();
if (localPackage.lastUpdateDate >= updateDate)
@@ -2192,26 +2191,50 @@ ComponentModel *PackageManagerCore::updaterComponentModel() const
/*!
Lists available packages filtered with \a regexp without GUI. Virtual
- components are not listed unless set visible.
+ components are not listed unless set visible. Optionally, a \a filters
+ hash containing package information elements and regular expressions
+ can be used to further filter listed packages.
\sa setVirtualComponentsVisible()
*/
-void PackageManagerCore::listAvailablePackages(const QString &regexp)
+void PackageManagerCore::listAvailablePackages(const QString &regexp, const QHash<QString, QString> &filters)
{
+ setPackageViewer();
qCDebug(QInstaller::lcInstallerInstallLog)
<< "Searching packages with regular expression:" << regexp;
+
+ ComponentModel *model = defaultComponentModel();
d->fetchMetaInformationFromRepositories(DownloadType::UpdatesXML);
d->addUpdateResourcesFromRepositories(true);
QRegularExpression re(regexp);
const PackagesList &packages = d->remotePackages();
+ if (!fetchAllPackages(packages, LocalPackagesHash())) {
+ qCWarning(QInstaller::lcInstallerInstallLog)
+ << "There was a problem with loading the package data.";
+ return;
+ }
PackagesList matchedPackages;
foreach (Package *package, packages) {
const QString name = package->data(scName).toString();
- if (re.match(name).hasMatch() &&
- (virtualComponentsVisible() ? true : !package->data(scVirtual, false).toBool())) {
- matchedPackages.append(package);
+ Component *component = componentByName(name);
+ if (!component)
+ continue;
+
+ const QModelIndex &idx = model->indexFromComponentName(component->treeName());
+ if (idx.isValid() && re.match(name).hasMatch()) {
+ bool ignoreComponent = false;
+ for (auto &key : filters.keys()) {
+ const QString elementValue = component->value(key);
+ QRegularExpression elementRegexp(filters.value(key));
+ if (elementValue.isEmpty() || !elementRegexp.match(elementValue).hasMatch()) {
+ ignoreComponent = true;
+ break;
+ }
+ }
+ if (!ignoreComponent)
+ matchedPackages.append(package);
}
}
if (matchedPackages.count() == 0)
@@ -2288,10 +2311,26 @@ bool PackageManagerCore::checkComponentsForInstallation(const QStringList &compo
model->setData(idx, Qt::Checked, Qt::CheckStateRole);
installComponentsFound = true;
}
- } else { // idx is invalid and component valid when we have invisible virtual component
- component->isVirtual()
- ? errorMessage.append(tr("Cannot install %1. Component is virtual.\n").arg(name))
- : errorMessage.append(tr("Cannot install %1. Component not found.\n").arg(name));
+ } else {
+ auto isDescendantOfVirtual = [&]() {
+ Component *trace = component;
+ forever {
+ trace = trace->parentComponent();
+ if (!trace) {
+ // We already checked the root component if there is no parent
+ return false;
+ } else if (trace->isVirtual()) {
+ errorMessage.append(tr("Cannot install %1. Component is descendant "
+ "of a virtual component %2.\n").arg(name, trace->name()));
+ return true;
+ }
+ }
+ };
+ // idx is invalid and component valid when we have invisible virtual component
+ if (component->isVirtual())
+ errorMessage.append(tr("Cannot install %1. Component is virtual.\n").arg(name));
+ else if (!isDescendantOfVirtual())
+ errorMessage.append(tr("Cannot install %1. Component not found.\n").arg(name));
}
}
if (!installComponentsFound)
@@ -2305,6 +2344,7 @@ bool PackageManagerCore::checkComponentsForInstallation(const QStringList &compo
*/
void PackageManagerCore::listInstalledPackages(const QString &regexp)
{
+ setPackageViewer();
LocalPackagesHash installedPackages = this->localInstalledPackages();
if (!regexp.isEmpty()) {
@@ -2342,6 +2382,7 @@ PackageManagerCore::Status PackageManagerCore::updateComponentsSilently(const QS
if (componentList.count() == 0) {
qCDebug(QInstaller::lcInstallerInstallLog) << "No updates available.";
+ setCanceled();
} else {
// Check if essential components are available (essential components are disabled).
// If essential components are found, update first essential updates,
@@ -3402,11 +3443,11 @@ bool PackageManagerCore::isPackageManager() const
}
/*!
- Sets current installer to be offline generator based on \a offlineGenerator.
+ Sets current installer to be offline generator.
*/
-void PackageManagerCore::setOfflineGenerator(bool offlineGenerator)
+void PackageManagerCore::setOfflineGenerator()
{
- d->m_offlineGenerator = offlineGenerator;
+ d->m_magicMarkerSupplement = BinaryContent::OfflineGenerator;
}
/*!
@@ -3420,6 +3461,24 @@ bool PackageManagerCore::isOfflineGenerator() const
}
/*!
+ Sets the current installer as the package viewer.
+*/
+void PackageManagerCore::setPackageViewer()
+{
+ d->m_magicMarkerSupplement = BinaryContent::PackageViewer;
+}
+
+/*!
+ Returns \c true if the current installer is executed as package viewer.
+
+ \sa {installer::isPackageViewer}{installer.isPackageViewer}
+*/
+bool PackageManagerCore::isPackageViewer() const
+{
+ return d->isPackageViewer();
+}
+
+/*!
Sets the installer magic binary marker based on \a magicMarker and
userSetBinaryMarker to \c true.
*/
@@ -3660,7 +3719,7 @@ void PackageManagerCore::storeReplacedComponents(QHash<QString, Component *> &co
qCWarning(QInstaller::lcDeveloperBuild) << componentName << "- Does not exist in the repositories anymore.";
continue;
}
- if (!componentToReplace && !d->componentsToReplace().contains(componentName)) {
+ if (!d->componentsToReplace().contains(componentName)) {
componentToReplace = new Component(this);
componentToReplace->setValue(scName, componentName);
} else {
@@ -3799,10 +3858,8 @@ bool PackageManagerCore::fetchUpdaterPackages(const PackagesList &remotes, const
continue; // Update for not installed package found, skip it.
const LocalPackage &localPackage = locals.value(name);
- const QString updateVersion = update->data(scVersion).toString();
- if (KDUpdater::compareVersion(updateVersion, localPackage.version) <= 0)
+ if (!d->packageNeedsUpdate(localPackage, update))
continue;
-
// It is quite possible that we may have already installed the update. Lets check the last
// update date of the package and the release date of the update. This way we can compare and
// figure out if the update has been installed or not.
diff --git a/src/libs/installer/packagemanagercore.h b/src/libs/installer/packagemanagercore.h
index d4833a979..b5ef6304e 100644
--- a/src/libs/installer/packagemanagercore.h
+++ b/src/libs/installer/packagemanagercore.h
@@ -33,6 +33,7 @@
#include "repository.h"
#include "qinstallerglobal.h"
#include "utils.h"
+#include "commandlineparser.h"
#include <QtCore/QHash>
#include <QtCore/QObject>
@@ -242,7 +243,8 @@ public:
ComponentModel *defaultComponentModel() const;
ComponentModel *updaterComponentModel() const;
void listInstalledPackages(const QString &regexp = QString());
- void listAvailablePackages(const QString &regexp);
+ void listAvailablePackages(const QString &regexp = QString(),
+ const QHash<QString, QString> &filters = QHash<QString, QString>());
PackageManagerCore::Status updateComponentsSilently(const QStringList &componentsToUpdate);
PackageManagerCore::Status installSelectedComponentsSilently(const QStringList& components);
PackageManagerCore::Status installDefaultComponentsSilently();
@@ -264,9 +266,12 @@ public:
Q_INVOKABLE void setPackageManager();
Q_INVOKABLE bool isPackageManager() const;
- void setOfflineGenerator(bool offlineGenerator = true);
+ void setOfflineGenerator();
Q_INVOKABLE bool isOfflineGenerator() const;
+ void setPackageViewer();
+ Q_INVOKABLE bool isPackageViewer() const;
+
void setUserSetBinaryMarker(qint64 magicMarker);
Q_INVOKABLE bool isUserSetBinaryMarker() const;
diff --git a/src/libs/installer/packagemanagercore_p.cpp b/src/libs/installer/packagemanagercore_p.cpp
index 24a67d095..0f1bb90be 100644
--- a/src/libs/installer/packagemanagercore_p.cpp
+++ b/src/libs/installer/packagemanagercore_p.cpp
@@ -225,6 +225,7 @@ PackageManagerCorePrivate::PackageManagerCorePrivate(PackageManagerCore *core)
, m_repoFetched(false)
, m_updateSourcesAdded(false)
, m_magicBinaryMarker(0) // initialize with pseudo marker
+ , m_magicMarkerSupplement(BinaryContent::Default)
, m_componentsToInstallCalculated(false)
, m_componentScriptEngine(nullptr)
, m_controlScriptEngine(nullptr)
@@ -243,7 +244,6 @@ PackageManagerCorePrivate::PackageManagerCorePrivate(PackageManagerCore *core)
, m_autoAcceptLicenses(false)
, m_disableWriteMaintenanceTool(false)
, m_autoConfirmCommand(false)
- , m_offlineGenerator(false)
{
}
@@ -264,6 +264,7 @@ PackageManagerCorePrivate::PackageManagerCorePrivate(PackageManagerCore *core, q
, m_repoFetched(false)
, m_updateSourcesAdded(false)
, m_magicBinaryMarker(magicInstallerMaker)
+ , m_magicMarkerSupplement(BinaryContent::Default)
, m_componentsToInstallCalculated(false)
, m_componentScriptEngine(nullptr)
, m_controlScriptEngine(nullptr)
@@ -282,7 +283,6 @@ PackageManagerCorePrivate::PackageManagerCorePrivate(PackageManagerCore *core, q
, m_autoAcceptLicenses(false)
, m_disableWriteMaintenanceTool(false)
, m_autoConfirmCommand(false)
- , m_offlineGenerator(false)
{
foreach (const OperationBlob &operation, performedOperations) {
QScopedPointer<QInstaller::Operation> op(KDUpdater::UpdateOperationFactory::instance()
@@ -717,7 +717,12 @@ bool PackageManagerCorePrivate::isPackageManager() const
bool PackageManagerCorePrivate::isOfflineGenerator() const
{
- return m_offlineGenerator;
+ return m_magicMarkerSupplement == BinaryContent::OfflineGenerator;
+}
+
+bool PackageManagerCorePrivate::isPackageViewer() const
+{
+ return m_magicMarkerSupplement == BinaryContent::PackageViewer;
}
bool PackageManagerCorePrivate::statusCanceledOrFailed() const
@@ -2246,7 +2251,8 @@ void PackageManagerCorePrivate::installComponent(Component *component, double pr
component->value(scUncompressedSize).toULongLong(),
component->value(scInheritVersion),
component->isCheckable(),
- component->isExpandedByDefault());
+ component->isExpandedByDefault(),
+ component->value(scContentSha1));
m_localPackageHub->writeToDisk();
component->setInstalled();
@@ -2908,4 +2914,19 @@ bool PackageManagerCorePrivate::askUserConfirmCommand() const
}
}
+bool PackageManagerCorePrivate::packageNeedsUpdate(const LocalPackage &localPackage, const Package *update) const
+{
+ bool updateNeeded = true;
+ const QString contentSha1 = update->data(scContentSha1).toString();
+ if (!contentSha1.isEmpty()) {
+ if (contentSha1 == localPackage.contentSha1)
+ updateNeeded = false;
+ } else {
+ const QString updateVersion = update->data(scVersion).toString();
+ if (KDUpdater::compareVersion(updateVersion, localPackage.version) <= 0)
+ updateNeeded = false;
+ }
+ return updateNeeded;
+}
+
} // namespace QInstaller
diff --git a/src/libs/installer/packagemanagercore_p.h b/src/libs/installer/packagemanagercore_p.h
index 858baf9eb..b29808228 100644
--- a/src/libs/installer/packagemanagercore_p.h
+++ b/src/libs/installer/packagemanagercore_p.h
@@ -132,6 +132,8 @@ public:
bool runOfflineGenerator();
bool isOfflineGenerator() const;
+ bool isPackageViewer() const;
+
QString replaceVariables(const QString &str) const;
QByteArray replaceVariables(const QByteArray &str) const;
@@ -254,6 +256,7 @@ private:
bool acceptLicenseAgreements() const;
bool askUserAcceptLicense(const QString &name, const QString &content) const;
bool askUserConfirmCommand() const;
+ bool packageNeedsUpdate(const LocalPackage &localPackage, const Package *update) const;
private:
PackageManagerCore *m_core;
@@ -264,9 +267,10 @@ private:
bool m_repoFetched;
bool m_updateSourcesAdded;
qint64 m_magicBinaryMarker;
+ int m_magicMarkerSupplement;
+
bool m_componentsToInstallCalculated;
- bool m_foundEssentialUpdate;
- bool m_offlineGenerator;
+ bool m_foundEssentialUpdate;;
mutable ScriptEngine *m_componentScriptEngine;
mutable ScriptEngine *m_controlScriptEngine;
diff --git a/src/libs/installer/packagemanagergui.cpp b/src/libs/installer/packagemanagergui.cpp
index 86c3a2d0c..d52034389 100644
--- a/src/libs/installer/packagemanagergui.cpp
+++ b/src/libs/installer/packagemanagergui.cpp
@@ -321,7 +321,7 @@ PackageManagerGui::PackageManagerGui(PackageManagerCore *core, QWidget *parent)
QFile sheet(styleSheetFile);
if (sheet.exists()) {
if (sheet.open(QIODevice::ReadOnly)) {
- setStyleSheet(QString::fromLatin1(sheet.readAll()));
+ qApp->setStyleSheet(QString::fromLatin1(sheet.readAll()));
} else {
qCWarning(QInstaller::lcDeveloperBuild) << "The specified style sheet file "
"can not be opened.";
diff --git a/src/libs/installer/performinstallationform.cpp b/src/libs/installer/performinstallationform.cpp
index 2fb6026cc..31b61ceeb 100644
--- a/src/libs/installer/performinstallationform.cpp
+++ b/src/libs/installer/performinstallationform.cpp
@@ -80,6 +80,7 @@ PerformInstallationForm::PerformInstallationForm(QObject *parent)
: QObject(parent)
, m_progressBar(nullptr)
, m_progressLabel(nullptr)
+ , m_downloadStatus(nullptr)
, m_productImagesScrollArea(nullptr)
, m_productImagesLabel(nullptr)
, m_detailsButton(nullptr)
diff --git a/src/libs/installer/qsettingswrapper.cpp b/src/libs/installer/qsettingswrapper.cpp
index 56db28d78..f57750bc1 100644
--- a/src/libs/installer/qsettingswrapper.cpp
+++ b/src/libs/installer/qsettingswrapper.cpp
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -74,9 +74,9 @@ public:
Private(const QString &fileName, QSettings::Format format)
: m_filename(fileName)
+ , m_format(format)
, settings(fileName, format)
{
- m_format = format;
m_scope = settings.scope();
m_application = settings.applicationName();
m_organization = settings.organizationName();
diff --git a/src/libs/installer/utils.cpp b/src/libs/installer/utils.cpp
index 59be2171b..7506a13fe 100644
--- a/src/libs/installer/utils.cpp
+++ b/src/libs/installer/utils.cpp
@@ -351,12 +351,12 @@ static QString qt_create_commandline(const QString &program, const QStringList &
// as escaping the quote -- rather put the \ behind the quote: e.g.
// rather use "foo"\ than "foo\"
QString endQuote(QLatin1Char('\"'));
- int i = tmp.length();
- while (i > 0 && tmp.at(i - 1) == QLatin1Char('\\')) {
- --i;
+ int j = tmp.length();
+ while (j > 0 && tmp.at(j - 1) == QLatin1Char('\\')) {
+ --j;
endQuote += QLatin1Char('\\');
}
- args += QLatin1String(" \"") + tmp.left(i) + endQuote;
+ args += QLatin1String(" \"") + tmp.left(j) + endQuote;
} else {
args += QLatin1Char(' ') + tmp;
}
diff --git a/src/libs/kdtools/filedownloader.cpp b/src/libs/kdtools/filedownloader.cpp
index 4cccfd9ca..a9f5040f0 100644
--- a/src/libs/kdtools/filedownloader.cpp
+++ b/src/libs/kdtools/filedownloader.cpp
@@ -192,6 +192,7 @@ struct KDUpdater::FileDownloader::Private
: m_hash(QCryptographicHash::Sha1)
, m_assumedSha1Sum("")
, autoRemove(true)
+ , followRedirect(false)
, m_speedTimerInterval(100)
, m_downloadDeadlineTimerInterval(30000)
, m_downloadPaused(false)
@@ -255,7 +256,6 @@ KDUpdater::FileDownloader::FileDownloader(const QString &scheme, QObject *parent
, d(new Private)
{
d->scheme = scheme;
- d->followRedirect = false;
}
/*!
diff --git a/src/libs/kdtools/localpackagehub.cpp b/src/libs/kdtools/localpackagehub.cpp
index 1a754d7d5..2ee880e04 100644
--- a/src/libs/kdtools/localpackagehub.cpp
+++ b/src/libs/kdtools/localpackagehub.cpp
@@ -327,7 +327,8 @@ void LocalPackageHub::addPackage(const QString &name,
quint64 uncompressedSize,
const QString &inheritVersionFrom,
bool checkable,
- bool expandedByDefault)
+ bool expandedByDefault,
+ const QString &contentSha1)
{
// TODO: This somewhat unexpected, remove?
if (d->m_packageInfoMap.contains(name)) {
@@ -350,6 +351,7 @@ void LocalPackageHub::addPackage(const QString &name,
info.uncompressedSize = uncompressedSize;
info.checkable = checkable;
info.expandedByDefault = expandedByDefault;
+ info.contentSha1 = contentSha1;
d->m_packageInfoMap.insert(name, info);
}
d->modified = true;
@@ -426,6 +428,8 @@ void LocalPackageHub::writeToDisk()
addTextChildHelper(&package, QLatin1String("Checkable"), QLatin1String("true"));
if (info.expandedByDefault)
addTextChildHelper(&package, QLatin1String("ExpandedByDefault"), QLatin1String("true"));
+ if (!info.contentSha1.isEmpty())
+ addTextChildHelper(&package, scContentSha1, info.contentSha1);
root.appendChild(package);
}
@@ -498,6 +502,8 @@ void LocalPackageHub::PackagesInfoData::addPackageFrom(const QDomElement &packag
info.checkable = childNodeE.text().toLower() == QLatin1String("true") ? true : false;
else if (childNodeE.tagName() == QLatin1String("ExpandedByDefault"))
info.expandedByDefault = childNodeE.text().toLower() == QLatin1String("true") ? true : false;
+ else if (childNodeE.tagName() == QLatin1String("ContentSha1"))
+ info.contentSha1 = childNodeE.text();
}
m_packageInfoMap.insert(info.name, info);
}
diff --git a/src/libs/kdtools/localpackagehub.h b/src/libs/kdtools/localpackagehub.h
index d43c4a6a5..648d6cf6e 100644
--- a/src/libs/kdtools/localpackagehub.h
+++ b/src/libs/kdtools/localpackagehub.h
@@ -55,6 +55,7 @@ struct KDTOOLS_EXPORT LocalPackage
quint64 uncompressedSize;
bool checkable;
bool expandedByDefault;
+ QString contentSha1;
};
class KDTOOLS_EXPORT LocalPackageHub
@@ -108,7 +109,8 @@ public:
quint64 uncompressedSize,
const QString &inheritVersionFrom,
bool checkable,
- bool expandedByDefault);
+ bool expandedByDefault,
+ const QString &contentSha1);
bool removePackage(const QString &pkgName);
void refresh();
diff --git a/src/libs/kdtools/selfrestarter.cpp b/src/libs/kdtools/selfrestarter.cpp
index e94d0fea7..7771fafac 100644
--- a/src/libs/kdtools/selfrestarter.cpp
+++ b/src/libs/kdtools/selfrestarter.cpp
@@ -36,19 +36,21 @@ class SelfRestarter::Private
{
public:
Private(int argc, char *argv[])
- : restartOnQuit(false)
+ : executable(QString::fromLocal8Bit(argv[0]))
+ , restartOnQuit(false)
+ , workingPath(QDir::currentPath())
{
- executable = QString::fromLocal8Bit(argv[0]);
- workingPath = QDir::currentPath();
+
for (int i = 1; i < argc; ++i)
args << QString::fromLocal8Bit(argv[i]);
}
Private()
+ : executable(qApp->applicationFilePath())
+ , args(qApp->arguments().mid(1))
+ , restartOnQuit(false)
+ , workingPath(QDir::currentPath())
{
- executable = qApp->applicationFilePath();
- workingPath = QDir::currentPath();
- args = qApp->arguments().mid(1);
}
~Private()
diff --git a/src/libs/kdtools/updatefinder.cpp b/src/libs/kdtools/updatefinder.cpp
index 535dfde3d..034e162d3 100644
--- a/src/libs/kdtools/updatefinder.cpp
+++ b/src/libs/kdtools/updatefinder.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
-** Copyright (C) 2019 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -79,8 +79,9 @@ public:
RemoveExisting
};
- Private(UpdateFinder *qq)
+ explicit Private(UpdateFinder *qq)
: q(qq)
+ , cancel(false)
, downloadCompleteCount(0)
, m_downloadsToComplete(0)
{}
@@ -93,7 +94,7 @@ public:
struct Data {
Data()
: downloader(0) {}
- Data(const PackageSource &i, FileDownloader *d = 0)
+ explicit Data(const PackageSource &i, FileDownloader *d = 0)
: info(i), downloader(d) {}
PackageSource info;
diff --git a/src/libs/kdtools/updateoperation.cpp b/src/libs/kdtools/updateoperation.cpp
index 00b059af1..897fecf1b 100644
--- a/src/libs/kdtools/updateoperation.cpp
+++ b/src/libs/kdtools/updateoperation.cpp
@@ -283,7 +283,7 @@ void UpdateOperation::setRequiresUnreplacedVariables(bool isRequired)
struct StartsWith
{
- StartsWith(const QString &searchTerm)
+ explicit StartsWith(const QString &searchTerm)
: m_searchTerm(searchTerm) {}
bool operator()(const QString &searchString)
diff --git a/src/libs/kdtools/updatesinfo.cpp b/src/libs/kdtools/updatesinfo.cpp
index 3119b6240..eaa9b039e 100644
--- a/src/libs/kdtools/updatesinfo.cpp
+++ b/src/libs/kdtools/updatesinfo.cpp
@@ -125,8 +125,8 @@ bool UpdatesInfoData::parsePackageUpdateElement(const QDomElement &updateE)
} else if (childE.tagName() == QLatin1String("Licenses")) {
QHash<QString, QVariant> licenseHash;
const QDomNodeList licenseNodes = childE.childNodes();
- for (int i = 0; i < licenseNodes.count(); ++i) {
- const QDomNode licenseNode = licenseNodes.at(i);
+ for (int index = 0; index < licenseNodes.count(); ++index) {
+ const QDomNode licenseNode = licenseNodes.at(index);
if (licenseNode.nodeName() == QLatin1String("License")) {
QDomElement element = licenseNode.toElement();
QVariantMap attributes;
@@ -210,8 +210,8 @@ QVariant UpdatesInfoData::parseOperations(const QDomNodeList &operationNodes)
if (operationNode.nodeName() == QLatin1String("Operation")) {
const QDomNodeList argumentNodes = operationNode.childNodes();
QStringList attributes;
- for (int i = 0; i < argumentNodes.count(); ++i) {
- const QDomNode argumentNode = argumentNodes.at(i);
+ for (int index = 0; index < argumentNodes.count(); ++index) {
+ const QDomNode argumentNode = argumentNodes.at(index);
if (argumentNode.nodeName() == QLatin1String("Argument")) {
QDomElement argumentElement = argumentNode.toElement();
attributes.append(argumentElement.text());
diff --git a/src/sdk/commandlineinterface.cpp b/src/sdk/commandlineinterface.cpp
index 69aa36c43..a6cd22151 100644
--- a/src/sdk/commandlineinterface.cpp
+++ b/src/sdk/commandlineinterface.cpp
@@ -132,7 +132,7 @@ int CommandLineInterface::searchAvailablePackages()
QString regexp;
if (!m_positionalArguments.isEmpty())
regexp = m_positionalArguments.first();
- m_core->listAvailablePackages(regexp);
+ m_core->listAvailablePackages(regexp, parsePackageFilters());
return EXIT_SUCCESS;
}
@@ -271,3 +271,27 @@ bool CommandLineInterface::setTargetDir()
}
return false;
}
+
+QHash<QString, QString> CommandLineInterface::parsePackageFilters()
+{
+ QHash<QString, QString> filterHash;
+ if (m_parser.isSet(CommandLineOptions::scFilterPackagesLong)) {
+ const QStringList filterList = m_parser.value(CommandLineOptions::scFilterPackagesLong)
+ .split(QLatin1Char(','));
+
+ for (auto &filter : filterList) {
+ const int i = filter.indexOf(QLatin1Char('='));
+ const QString element = filter.left(i).trimmed();
+ const QString value = filter.mid(i + 1).trimmed();
+
+ if ((i == -1) || (filter.count(QLatin1Char('=') > 1))
+ || element.isEmpty() || value.isEmpty()) {
+ qCWarning(QInstaller::lcInstallerInstallLog).nospace() << "Ignoring unknown entry "
+ << filter << "in package filter arguments. Please use syntax \"element=regex,...\".";
+ continue;
+ }
+ filterHash.insert(element, value);
+ }
+ }
+ return filterHash;
+}
diff --git a/src/sdk/commandlineinterface.h b/src/sdk/commandlineinterface.h
index 2627bc6f8..29bae74a4 100644
--- a/src/sdk/commandlineinterface.h
+++ b/src/sdk/commandlineinterface.h
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** Copyright (C) 2020 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -54,6 +54,7 @@ private:
bool initialize();
bool checkLicense();
bool setTargetDir();
+ QHash<QString, QString> parsePackageFilters();
QStringList m_positionalArguments;
};
diff --git a/src/sdk/tabcontroller.cpp b/src/sdk/tabcontroller.cpp
index 5e2f1ed13..3bcb3f11a 100644
--- a/src/sdk/tabcontroller.cpp
+++ b/src/sdk/tabcontroller.cpp
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -166,23 +166,6 @@ void TabController::restartWizard()
void TabController::onSettingsButtonClicked()
{
SettingsDialog dialog(d->m_core);
- // set custom stylesheet
- const QString styleSheetFile = d->m_core->settings().styleSheet();
- if (!styleSheetFile.isEmpty()) {
- QFile sheet(styleSheetFile);
- if (sheet.exists()) {
- if (sheet.open(QIODevice::ReadOnly)) {
- dialog.setStyleSheet(QString::fromLatin1(sheet.readAll()));
- } else {
- qCWarning(QInstaller::lcDeveloperBuild) << "The specified style sheet file "
- "can not be opened.";
- }
- } else {
- qCWarning(QInstaller::lcDeveloperBuild) << "A style sheet file is specified, "
- "but it does not exist.";
- }
- }
-
connect(&dialog, &SettingsDialog::networkSettingsChanged,
this, &TabController::onNetworkSettingsChanged);
dialog.exec();
diff --git a/src/sdk/translations/ifw_ar.ts b/src/sdk/translations/ifw_ar.ts
index df8b6ffc2..f86ea6cc7 100644
--- a/src/sdk/translations/ifw_ar.ts
+++ b/src/sdk/translations/ifw_ar.ts
@@ -216,14 +216,6 @@
<context>
<name>QObject</name>
<message>
- <source>Authorization required</source>
- <translation>المصادقة مطلوبة</translation>
- </message>
- <message>
- <source>Enter your password to authorize for sudo:</source>
- <translation>أدخل كلمة مرورك لمصادقة sudo:</translation>
- </message>
- <message>
<source>Error acquiring admin rights</source>
<translation>فشل الحصول على صلاحيات المدير</translation>
</message>
@@ -638,6 +630,10 @@
<source>Error</source>
<translation>خطأ</translation>
</message>
+ <message>
+ <source>Component Information</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>QInstaller::ConsumeOutputOperation</name>
@@ -1578,6 +1574,11 @@ Do you want to continue?</source>
<source>invalid</source>
<translation>غير صالح</translation>
</message>
+ <message>
+ <source>Cannot install %1. Component is descendant of a virtual component %2.
+</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>QInstaller::PackageManagerCorePrivate</name>
@@ -1606,11 +1607,6 @@ Do you want to continue?</source>
<translation>أوقف العمليات</translation>
</message>
<message>
- <source>These processes should be stopped to continue:
-%1</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
<source>Installation canceled by user</source>
<translation>ألغى المستخدم التثبيت</translation>
</message>
@@ -1823,6 +1819,12 @@ Installing component %1</source>
<source>Dependency cycle between components &quot;%1&quot; and &quot;%2&quot; detected.</source>
<translation>اكتُشفت دورة اعتماديات بين المكونان &quot;%1&quot; و&quot;%2&quot;.</translation>
</message>
+ <message>
+ <source>These processes should be stopped to continue:
+
+%1</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>QInstaller::PackageManagerGui</name>
@@ -2133,6 +2135,7 @@ Please copy the installer to a local drive</source>
</message>
<message>
<source>Cannot get authorization that is needed for continuing the installation.
+
Please start the setup program as a user with the appropriate rights.
Or accept the elevation of access rights if being asked.</source>
<translation type="unfinished"></translation>
@@ -2140,7 +2143,9 @@ Or accept the elevation of access rights if being asked.</source>
<message>
<source>Cannot get authorization that is needed for continuing the installation.
Either abort the installation or use the fallback solution by running
+
%1
+
as a user with the appropriate rights and then clicking OK.</source>
<translation type="unfinished"></translation>
</message>
@@ -2737,4 +2742,4 @@ as a user with the appropriate rights and then clicking OK.</source>
<translation type="unfinished"></translation>
</message>
</context>
-</TS> \ No newline at end of file
+</TS>
diff --git a/src/sdk/translations/ifw_ca.ts b/src/sdk/translations/ifw_ca.ts
index 5d9043b18..0ab602213 100644
--- a/src/sdk/translations/ifw_ca.ts
+++ b/src/sdk/translations/ifw_ca.ts
@@ -940,6 +940,10 @@
<source>Error</source>
<translation>Error</translation>
</message>
+ <message>
+ <source>Component Information</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>QInstaller::ConsumeOutputOperation</name>
@@ -1746,6 +1750,19 @@ Voleu continuar?</translation>
<source>invalid</source>
<translation>no vàlid</translation>
</message>
+ <message>
+ <source>User input is required but the output device is not associated with a terminal.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot register component! Component with identifier %1 already exists.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot install %1. Component is descendant of a virtual component %2.
+</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>QInstaller::PackageManagerCorePrivate</name>
@@ -2396,14 +2413,6 @@ Copieu l&apos;instal·lador en una unitat local</translation>
<context>
<name>QObject</name>
<message>
- <source>Authorization required</source>
- <translation>Es requereix autorització</translation>
- </message>
- <message>
- <source>Enter your password to authorize for sudo:</source>
- <translation>Introduïu la contrasenya per autoritzar el «sudo»:</translation>
- </message>
- <message>
<source>Error acquiring admin rights</source>
<translation>Error en adquirir els drets d&apos;administrador</translation>
</message>
@@ -2694,4 +2703,11 @@ amb un usuari amb els permisos apropiats i després feu clic a D&apos;acord.
<translation>Ha fallat en canviar el nom del fitxer «%1» a «%2»: %3</translation>
</message>
</context>
+<context>
+ <name>QInstaller::QFileDialogProxy</name>
+ <message>
+ <source>User input is required but the output device is not associated with a terminal.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
</TS>
diff --git a/src/sdk/translations/ifw_da.ts b/src/sdk/translations/ifw_da.ts
index 32b84d047..8e51b0f54 100644
--- a/src/sdk/translations/ifw_da.ts
+++ b/src/sdk/translations/ifw_da.ts
@@ -1728,6 +1728,19 @@ Vil du fortsætte?</translation>
<source>invalid</source>
<translation>ugyldig</translation>
</message>
+ <message>
+ <source>User input is required but the output device is not associated with a terminal.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot register component! Component with identifier %1 already exists.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot install %1. Component is descendant of a virtual component %2.
+</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>QInstaller::PackageManagerCorePrivate</name>
@@ -2378,14 +2391,6 @@ Kopiér venligst installeren til et lokalt drev</translation>
<context>
<name>QObject</name>
<message>
- <source>Authorization required</source>
- <translation>Godkendelse kræves</translation>
- </message>
- <message>
- <source>Enter your password to authorize for sudo:</source>
- <translation>Indtast din adgangskode til godkendelse for sudo:</translation>
- </message>
- <message>
<source>Error acquiring admin rights</source>
<translation>Fejl ved anskaffelse af administrator rettigheder</translation>
</message>
@@ -2685,6 +2690,10 @@ som en bruger med de fornødne rettigheder og klik så på OK.</translation>
<source>Error</source>
<translation>Fejl</translation>
</message>
+ <message>
+ <source>Component Information</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>QInstaller::ExtractArchiveOperation</name>
@@ -2693,4 +2702,11 @@ som en bruger med de fornødne rettigheder og klik så på OK.</translation>
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>QInstaller::QFileDialogProxy</name>
+ <message>
+ <source>User input is required but the output device is not associated with a terminal.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
</TS>
diff --git a/src/sdk/translations/ifw_de.ts b/src/sdk/translations/ifw_de.ts
index 39b541c8d..937856898 100644
--- a/src/sdk/translations/ifw_de.ts
+++ b/src/sdk/translations/ifw_de.ts
@@ -940,6 +940,10 @@
<source>Error</source>
<translation>Fehler</translation>
</message>
+ <message>
+ <source>Component Information</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>QInstaller::ConsumeOutputOperation</name>
@@ -1755,6 +1759,11 @@ Möchten Sie trotzdem fortsetzen?</translation>
<source>invalid</source>
<translation>ungültig</translation>
</message>
+ <message>
+ <source>Cannot install %1. Component is descendant of a virtual component %2.
+</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>QInstaller::PackageManagerCorePrivate</name>
@@ -2413,14 +2422,6 @@ Bitte kopieren Sie den Installer auf ein lokales Laufwerk</translation>
<context>
<name>QObject</name>
<message>
- <source>Authorization required</source>
- <translation>Autorisierung benötigt.</translation>
- </message>
- <message>
- <source>Enter your password to authorize for sudo:</source>
- <translation>Geben Sie Ihr Passwort ein, um sich für sudo zu authentifizieren:</translation>
- </message>
- <message>
<source>Error acquiring admin rights</source>
<translation>Fehler beim Erlangen von Administratorrechten.</translation>
</message>
diff --git a/src/sdk/translations/ifw_es.ts b/src/sdk/translations/ifw_es.ts
index d9759b539..cb78dbcae 100644
--- a/src/sdk/translations/ifw_es.ts
+++ b/src/sdk/translations/ifw_es.ts
@@ -235,24 +235,28 @@
<source>%n day(s), </source>
<translation>
<numerusform>%n día(s), </numerusform>
+ <numerusform></numerusform>
</translation>
</message>
<message numerus="yes">
<source>%n hour(s), </source>
<translation>
<numerusform>%n hora(s), </numerusform>
+ <numerusform></numerusform>
</translation>
</message>
<message numerus="yes">
<source>%n minute(s)</source>
<translation>
<numerusform>%n minuto(s)</numerusform>
+ <numerusform></numerusform>
</translation>
</message>
<message numerus="yes">
<source>%n second(s)</source>
<translation>
<numerusform>%n segundo(s)</numerusform>
+ <numerusform></numerusform>
</translation>
</message>
<message>
@@ -450,6 +454,7 @@
<source>%n update(s) found.</source>
<translation>
<numerusform>%n actualizaciones encontradas.</numerusform>
+ <numerusform></numerusform>
</translation>
</message>
<message>
@@ -1262,24 +1267,28 @@ Error al descargar %2</translation>
<source>%n day(s), </source>
<translation>
<numerusform>%n día(s), </numerusform>
+ <numerusform></numerusform>
</translation>
</message>
<message numerus="yes">
<source>%n hour(s), </source>
<translation>
<numerusform>%n hora(s), </numerusform>
+ <numerusform></numerusform>
</translation>
</message>
<message numerus="yes">
<source>%n minute(s)</source>
<translation>
<numerusform>%n minuto(s)</numerusform>
+ <numerusform></numerusform>
</translation>
</message>
<message numerus="yes">
<source>%n second(s)</source>
<translation>
<numerusform>%n segundo(s)</numerusform>
+ <numerusform></numerusform>
</translation>
</message>
<message>
@@ -1719,6 +1728,19 @@ No es recomendable instalar en este directorio, ya que la instalación podría g
<source>invalid</source>
<translation>no válido</translation>
</message>
+ <message>
+ <source>User input is required but the output device is not associated with a terminal.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot register component! Component with identifier %1 already exists.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot install %1. Component is descendant of a virtual component %2.
+</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>QInstaller::PackageManagerCorePrivate</name>
@@ -2369,14 +2391,6 @@ Copie el instalador en una unidad local.</translation>
<context>
<name>QObject</name>
<message>
- <source>Authorization required</source>
- <translation>Se necesita autorización</translation>
- </message>
- <message>
- <source>Enter your password to authorize for sudo:</source>
- <translation>Introduzca su contraseña para autorizar para sudo:</translation>
- </message>
- <message>
<source>Error acquiring admin rights</source>
<translation>Error al adquirir derechos de administrador</translation>
</message>
@@ -2651,12 +2665,14 @@ como usuario con los derechos adecuados y, luego, haga clic en Aceptar.</transla
<source>Invalid arguments in %1: %n arguments given, %2 arguments expected.</source>
<translation>
<numerusform>Argumentos no válidos en %1: se han proporcionado %n argumentos, se esperaban %2.</numerusform>
+ <numerusform></numerusform>
</translation>
</message>
<message numerus="yes">
<source>Invalid arguments in %1: %n arguments given, %2 arguments expected in the form: %3.</source>
<translation>
<numerusform>Argumentos no válidos en %1: se han proporcionado %n argumentos, se esperaban %2 con la forma: %3.</numerusform>
+ <numerusform></numerusform>
</translation>
</message>
<message>
@@ -2674,6 +2690,10 @@ como usuario con los derechos adecuados y, luego, haga clic en Aceptar.</transla
<source>Error</source>
<translation>Error</translation>
</message>
+ <message>
+ <source>Component Information</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>QInstaller::ExtractArchiveOperation</name>
@@ -2682,4 +2702,11 @@ como usuario con los derechos adecuados y, luego, haga clic en Aceptar.</transla
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>QInstaller::QFileDialogProxy</name>
+ <message>
+ <source>User input is required but the output device is not associated with a terminal.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
</TS>
diff --git a/src/sdk/translations/ifw_fr.ts b/src/sdk/translations/ifw_fr.ts
index d44c86896..0362dac0e 100644
--- a/src/sdk/translations/ifw_fr.ts
+++ b/src/sdk/translations/ifw_fr.ts
@@ -1728,6 +1728,19 @@ Souhaitez-vous continuer ?</translation>
<source>invalid</source>
<translation>non valide</translation>
</message>
+ <message>
+ <source>User input is required but the output device is not associated with a terminal.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot register component! Component with identifier %1 already exists.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot install %1. Component is descendant of a virtual component %2.
+</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>QInstaller::PackageManagerCorePrivate</name>
@@ -2378,14 +2391,6 @@ Copiez le programme d’installation sur un disque local</translation>
<context>
<name>QObject</name>
<message>
- <source>Authorization required</source>
- <translation>Autorisation requise</translation>
- </message>
- <message>
- <source>Enter your password to authorize for sudo:</source>
- <translation>Saisissez votre mot de passe pour autoriser sudo :</translation>
- </message>
- <message>
<source>Error acquiring admin rights</source>
<translation>Erreur d’acquisition des droits d’administrateur</translation>
</message>
@@ -2685,6 +2690,10 @@ en tant qu’utilisateur doté des droits appropriés, puis cliquez sur OK.</tra
<source>Error</source>
<translation>Erreur</translation>
</message>
+ <message>
+ <source>Component Information</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>QInstaller::ExtractArchiveOperation</name>
@@ -2693,4 +2702,11 @@ en tant qu’utilisateur doté des droits appropriés, puis cliquez sur OK.</tra
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>QInstaller::QFileDialogProxy</name>
+ <message>
+ <source>User input is required but the output device is not associated with a terminal.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
</TS>
diff --git a/src/sdk/translations/ifw_hr.ts b/src/sdk/translations/ifw_hr.ts
index 69c54d679..13a0f5d7d 100644
--- a/src/sdk/translations/ifw_hr.ts
+++ b/src/sdk/translations/ifw_hr.ts
@@ -216,14 +216,6 @@
<context>
<name>QObject</name>
<message>
- <source>Authorization required</source>
- <translation>Potrebna je autorizacija</translation>
- </message>
- <message>
- <source>Enter your password to authorize for sudo:</source>
- <translation>Dodaj tvoju lozinku za autorizaciju korištenja sudo naredba:</translation>
- </message>
- <message>
<source>Error acquiring admin rights</source>
<translation>Greška prilikom preuzimanja administratorskih prava</translation>
</message>
@@ -1442,6 +1434,19 @@ Ne preporučujemo instalirati u ovu mapu, jer instaliranje možda neće uspjeti.
<source>invalid</source>
<translation>nevaljano</translation>
</message>
+ <message>
+ <source>User input is required but the output device is not associated with a terminal.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot register component! Component with identifier %1 already exists.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot install %1. Component is descendant of a virtual component %2.
+</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>QInstaller::PackageManagerCorePrivate</name>
@@ -2703,5 +2708,16 @@ u modusu korisnika s odgovarajućim pravima. Zatim klikni &quot;U redu&quot;.</t
<source>Error</source>
<translation>Greška</translation>
</message>
+ <message>
+ <source>Component Information</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>QInstaller::QFileDialogProxy</name>
+ <message>
+ <source>User input is required but the output device is not associated with a terminal.</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
</TS>
diff --git a/src/sdk/translations/ifw_it.ts b/src/sdk/translations/ifw_it.ts
index 43a488930..2558f96c5 100644
--- a/src/sdk/translations/ifw_it.ts
+++ b/src/sdk/translations/ifw_it.ts
@@ -1728,6 +1728,19 @@ Continuare?</translation>
<source>invalid</source>
<translation>non valido</translation>
</message>
+ <message>
+ <source>User input is required but the output device is not associated with a terminal.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot register component! Component with identifier %1 already exists.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot install %1. Component is descendant of a virtual component %2.
+</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>QInstaller::PackageManagerCorePrivate</name>
@@ -2378,14 +2391,6 @@ Copiare il programma di installazione in un&apos;unità locale</translation>
<context>
<name>QObject</name>
<message>
- <source>Authorization required</source>
- <translation>Necessaria autorizzazione</translation>
- </message>
- <message>
- <source>Enter your password to authorize for sudo:</source>
- <translation>Immettere la password per autorizzare sudo:</translation>
- </message>
- <message>
<source>Error acquiring admin rights</source>
<translation>Errore durante l&apos;acquisizione di diritti di amministrazione</translation>
</message>
@@ -2685,6 +2690,10 @@ come utente con i diritti appropriati, quindi fare clic su OK.</translation>
<source>Error</source>
<translation>Errore</translation>
</message>
+ <message>
+ <source>Component Information</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>QInstaller::ExtractArchiveOperation</name>
@@ -2693,4 +2702,11 @@ come utente con i diritti appropriati, quindi fare clic su OK.</translation>
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>QInstaller::QFileDialogProxy</name>
+ <message>
+ <source>User input is required but the output device is not associated with a terminal.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
</TS>
diff --git a/src/sdk/translations/ifw_ja.ts b/src/sdk/translations/ifw_ja.ts
index b7b360d5d..2b40563f1 100644
--- a/src/sdk/translations/ifw_ja.ts
+++ b/src/sdk/translations/ifw_ja.ts
@@ -1719,6 +1719,19 @@ Do you want to continue?</source>
<source>invalid</source>
<translation>無効</translation>
</message>
+ <message>
+ <source>User input is required but the output device is not associated with a terminal.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot register component! Component with identifier %1 already exists.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot install %1. Component is descendant of a virtual component %2.
+</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>QInstaller::PackageManagerCorePrivate</name>
@@ -2369,14 +2382,6 @@ Please copy the installer to a local drive</source>
<context>
<name>QObject</name>
<message>
- <source>Authorization required</source>
- <translation>認証が必要です</translation>
- </message>
- <message>
- <source>Enter your password to authorize for sudo:</source>
- <translation>sudo の認証を行うパスワードを入力します:</translation>
- </message>
- <message>
<source>Error acquiring admin rights</source>
<translation>管理者権限の取得中にエラーが発生しました</translation>
</message>
@@ -2674,6 +2679,10 @@ as a user with the appropriate rights and then clicking OK.</source>
<source>Error</source>
<translation>エラー</translation>
</message>
+ <message>
+ <source>Component Information</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>QInstaller::ExtractArchiveOperation</name>
@@ -2682,4 +2691,11 @@ as a user with the appropriate rights and then clicking OK.</source>
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>QInstaller::QFileDialogProxy</name>
+ <message>
+ <source>User input is required but the output device is not associated with a terminal.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
</TS>
diff --git a/src/sdk/translations/ifw_pl.ts b/src/sdk/translations/ifw_pl.ts
index 83df66385..21607a847 100644
--- a/src/sdk/translations/ifw_pl.ts
+++ b/src/sdk/translations/ifw_pl.ts
@@ -1737,6 +1737,19 @@ Czy chcesz kontynuować?</translation>
<source>invalid</source>
<translation>nieprawidłowe</translation>
</message>
+ <message>
+ <source>User input is required but the output device is not associated with a terminal.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot register component! Component with identifier %1 already exists.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot install %1. Component is descendant of a virtual component %2.
+</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>QInstaller::PackageManagerCorePrivate</name>
@@ -2387,14 +2400,6 @@ Please copy the installer to a local drive</source>
<context>
<name>QObject</name>
<message>
- <source>Authorization required</source>
- <translation>Wymagana autoryzacja</translation>
- </message>
- <message>
- <source>Enter your password to authorize for sudo:</source>
- <translation>Wprowadź swoje hasło, aby zezwolić na sudo:</translation>
- </message>
- <message>
<source>Error acquiring admin rights</source>
<translation>Błąd w trakcie nabywania praw administratora</translation>
</message>
@@ -2696,6 +2701,10 @@ jako użytkownik z odpowiednimi prawami, a następnie kliknij przycisk OK.</tran
<source>Error</source>
<translation>Błąd</translation>
</message>
+ <message>
+ <source>Component Information</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>QInstaller::ExtractArchiveOperation</name>
@@ -2704,4 +2713,11 @@ jako użytkownik z odpowiednimi prawami, a następnie kliknij przycisk OK.</tran
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>QInstaller::QFileDialogProxy</name>
+ <message>
+ <source>User input is required but the output device is not associated with a terminal.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
</TS>
diff --git a/src/sdk/translations/ifw_pt_BR.ts b/src/sdk/translations/ifw_pt_BR.ts
index 9b8e56030..82a59e979 100644
--- a/src/sdk/translations/ifw_pt_BR.ts
+++ b/src/sdk/translations/ifw_pt_BR.ts
@@ -216,14 +216,6 @@
<context>
<name>QObject</name>
<message>
- <source>Authorization required</source>
- <translation>Autorização necessária</translation>
- </message>
- <message>
- <source>Enter your password to authorize for sudo:</source>
- <translation>Digite sua senha para autorizar para o sudo:</translation>
- </message>
- <message>
<source>Error acquiring admin rights</source>
<translation>Erro ao adquirir privilégios de administrador</translation>
</message>
@@ -1429,6 +1421,19 @@ Você quer continuar?</translation>
<source>invalid</source>
<translation>inválido</translation>
</message>
+ <message>
+ <source>User input is required but the output device is not associated with a terminal.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot register component! Component with identifier %1 already exists.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot install %1. Component is descendant of a virtual component %2.
+</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>QInstaller::PackageManagerCorePrivate</name>
@@ -2685,6 +2690,10 @@ como um usuário com os privilégios apropriados e, em seguida, clicando em OK.<
<source>Error</source>
<translation>Erro</translation>
</message>
+ <message>
+ <source>Component Information</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>QInstaller::ExtractArchiveOperation</name>
@@ -2693,4 +2702,11 @@ como um usuário com os privilégios apropriados e, em seguida, clicando em OK.<
<translation>Extraindo &quot;%1&quot;</translation>
</message>
</context>
+<context>
+ <name>QInstaller::QFileDialogProxy</name>
+ <message>
+ <source>User input is required but the output device is not associated with a terminal.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
</TS>
diff --git a/src/sdk/translations/ifw_ru.ts b/src/sdk/translations/ifw_ru.ts
index e6ce746df..f9e928721 100644
--- a/src/sdk/translations/ifw_ru.ts
+++ b/src/sdk/translations/ifw_ru.ts
@@ -949,6 +949,10 @@
<source>Error</source>
<translation>Ошибка</translation>
</message>
+ <message>
+ <source>Component Information</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>QInstaller::ConsumeOutputOperation</name>
@@ -1759,6 +1763,19 @@ Do you want to continue?</source>
<source>Components about to be removed.</source>
<translation>Удаляемые компоненты.</translation>
</message>
+ <message>
+ <source>User input is required but the output device is not associated with a terminal.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot register component! Component with identifier %1 already exists.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot install %1. Component is descendant of a virtual component %2.
+</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>QInstaller::PackageManagerCorePrivate</name>
@@ -2409,14 +2426,6 @@ Please copy the installer to a local drive</source>
<context>
<name>QObject</name>
<message>
- <source>Authorization required</source>
- <translation>Требуется аутентификация</translation>
- </message>
- <message>
- <source>Enter your password to authorize for sudo:</source>
- <translation>Введите пароль для доступа к &quot;sudo&quot;:</translation>
- </message>
- <message>
<source>Error acquiring admin rights</source>
<translation>Ошибка при попытке получения прав администратора</translation>
</message>
@@ -2708,4 +2717,11 @@ as a user with the appropriate rights and then clicking OK.</source>
<translation>Не удалось переименовать «%1» в «%2»: %3</translation>
</message>
</context>
+<context>
+ <name>QInstaller::QFileDialogProxy</name>
+ <message>
+ <source>User input is required but the output device is not associated with a terminal.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
</TS>
diff --git a/src/sdk/translations/ifw_zh_CN.ts b/src/sdk/translations/ifw_zh_CN.ts
index 5e345d3cf..62041e88d 100644
--- a/src/sdk/translations/ifw_zh_CN.ts
+++ b/src/sdk/translations/ifw_zh_CN.ts
@@ -1719,6 +1719,19 @@ Do you want to continue?</source>
<source>invalid</source>
<translation>无效</translation>
</message>
+ <message>
+ <source>User input is required but the output device is not associated with a terminal.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot register component! Component with identifier %1 already exists.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cannot install %1. Component is descendant of a virtual component %2.
+</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>QInstaller::PackageManagerCorePrivate</name>
@@ -2369,14 +2382,6 @@ Please copy the installer to a local drive</source>
<context>
<name>QObject</name>
<message>
- <source>Authorization required</source>
- <translation>需要授权</translation>
- </message>
- <message>
- <source>Enter your password to authorize for sudo:</source>
- <translation>输入您的密码为 sudo 授权:</translation>
- </message>
- <message>
<source>Error acquiring admin rights</source>
<translation>获取管理员权限时出错</translation>
</message>
@@ -2674,6 +2679,10 @@ as a user with the appropriate rights and then clicking OK.</source>
<source>Error</source>
<translation>错误</translation>
</message>
+ <message>
+ <source>Component Information</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>QInstaller::ExtractArchiveOperation</name>
@@ -2682,4 +2691,11 @@ as a user with the appropriate rights and then clicking OK.</source>
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>QInstaller::QFileDialogProxy</name>
+ <message>
+ <source>User input is required but the output device is not associated with a terminal.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
</TS>
diff --git a/tests/auto/installer/binaryformat/tst_binaryformat.cpp b/tests/auto/installer/binaryformat/tst_binaryformat.cpp
index c9cd2b00f..7e0f5ed24 100644
--- a/tests/auto/installer/binaryformat/tst_binaryformat.cpp
+++ b/tests/auto/installer/binaryformat/tst_binaryformat.cpp
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -51,7 +51,7 @@ struct Layout : public QInstaller::BinaryLayout
class TestOperation : public KDUpdater::UpdateOperation
{
public:
- TestOperation(const QString &name)
+ explicit TestOperation(const QString &name)
: KDUpdater::UpdateOperation(nullptr)
{ setName(name); }
diff --git a/tests/auto/installer/clientserver/tst_clientserver.cpp b/tests/auto/installer/clientserver/tst_clientserver.cpp
index 23442d5fa..29d4283b9 100644
--- a/tests/auto/installer/clientserver/tst_clientserver.cpp
+++ b/tests/auto/installer/clientserver/tst_clientserver.cpp
@@ -501,7 +501,7 @@ private slots:
QFile file;
file.setFileName(filename);
file.open(QIODevice::ReadWrite);
- const QByteArray ba = file.readLine();
+ file.readLine();
file.seek(0);
QCOMPARE(file.atEnd(), false);
diff --git a/tests/auto/installer/cliinterface/data/repository/A/1.0.2-1content.7z b/tests/auto/installer/cliinterface/data/repository/A/1.0.2-1content.7z
deleted file mode 100644
index 5a9383e7e..000000000
--- a/tests/auto/installer/cliinterface/data/repository/A/1.0.2-1content.7z
+++ /dev/null
Binary files differ
diff --git a/tests/auto/installer/cliinterface/data/repository/A/1.0.2-1content.7z.sha1 b/tests/auto/installer/cliinterface/data/repository/A/1.0.2-1content.7z.sha1
deleted file mode 100644
index fd0bc548c..000000000
--- a/tests/auto/installer/cliinterface/data/repository/A/1.0.2-1content.7z.sha1
+++ /dev/null
@@ -1 +0,0 @@
-643cb71b2337d5a49d57a5bc3c636ee9b84c0802 \ No newline at end of file
diff --git a/tests/auto/installer/cliinterface/data/repository/A/1.0.2-1meta.7z b/tests/auto/installer/cliinterface/data/repository/A/1.0.2-1meta.7z
deleted file mode 100644
index 6ef0b7959..000000000
--- a/tests/auto/installer/cliinterface/data/repository/A/1.0.2-1meta.7z
+++ /dev/null
Binary files differ
diff --git a/tests/auto/installer/cliinterface/data/repository/AB/1.0.2-1meta.7z b/tests/auto/installer/cliinterface/data/repository/AB/1.0.2-1meta.7z
deleted file mode 100644
index 6b5e5ac91..000000000
--- a/tests/auto/installer/cliinterface/data/repository/AB/1.0.2-1meta.7z
+++ /dev/null
Binary files differ
diff --git a/tests/auto/installer/cliinterface/data/repository/B/1.0.0-1content.7z b/tests/auto/installer/cliinterface/data/repository/B/1.0.0-1content.7z
deleted file mode 100644
index dfe41ad15..000000000
--- a/tests/auto/installer/cliinterface/data/repository/B/1.0.0-1content.7z
+++ /dev/null
Binary files differ
diff --git a/tests/auto/installer/cliinterface/data/repository/B/1.0.0-1content.7z.sha1 b/tests/auto/installer/cliinterface/data/repository/B/1.0.0-1content.7z.sha1
deleted file mode 100644
index 50a632b49..000000000
--- a/tests/auto/installer/cliinterface/data/repository/B/1.0.0-1content.7z.sha1
+++ /dev/null
@@ -1 +0,0 @@
-c7b9ab370efe036171dda7b71cd95021747cb101 \ No newline at end of file
diff --git a/tests/auto/installer/cliinterface/data/repository/B/1.0.0-1meta.7z b/tests/auto/installer/cliinterface/data/repository/B/1.0.0-1meta.7z
deleted file mode 100644
index 12d54f94c..000000000
--- a/tests/auto/installer/cliinterface/data/repository/B/1.0.0-1meta.7z
+++ /dev/null
Binary files differ
diff --git a/tests/auto/installer/cliinterface/data/repository/C/1.0.0-1content.7z b/tests/auto/installer/cliinterface/data/repository/C/1.0.0-1content.7z
deleted file mode 100644
index 7d03dca9c..000000000
--- a/tests/auto/installer/cliinterface/data/repository/C/1.0.0-1content.7z
+++ /dev/null
Binary files differ
diff --git a/tests/auto/installer/cliinterface/data/repository/C/1.0.0-1content.7z.sha1 b/tests/auto/installer/cliinterface/data/repository/C/1.0.0-1content.7z.sha1
deleted file mode 100644
index 91ead97f0..000000000
--- a/tests/auto/installer/cliinterface/data/repository/C/1.0.0-1content.7z.sha1
+++ /dev/null
@@ -1 +0,0 @@
-c8b7076fabaaf6b9d27f27350c577118c24f426b \ No newline at end of file
diff --git a/tests/auto/installer/cliinterface/data/repository/C/1.0.0-1meta.7z b/tests/auto/installer/cliinterface/data/repository/C/1.0.0-1meta.7z
deleted file mode 100644
index 46bae0179..000000000
--- a/tests/auto/installer/cliinterface/data/repository/C/1.0.0-1meta.7z
+++ /dev/null
Binary files differ
diff --git a/tests/auto/installer/cliinterface/data/repository/Updates.xml b/tests/auto/installer/cliinterface/data/repository/Updates.xml
index c7b11dc03..52707d09d 100644
--- a/tests/auto/installer/cliinterface/data/repository/Updates.xml
+++ b/tests/auto/installer/cliinterface/data/repository/Updates.xml
@@ -19,7 +19,7 @@
<Description>Example component B</Description>
<Version>1.0.0-1</Version>
<ReleaseDate>2015-01-01</ReleaseDate>
- <Default>true</Default>
+ <Default>false</Default>
<UpdateFile CompressedSize="222" OS="Any" UncompressedSize="72"/>
<DownloadableArchives>content.7z</DownloadableArchives>
<SHA1>9170d55a6af81c1a6a63d708a4ab6ed359775cd9</SHA1>
@@ -35,6 +35,27 @@
<DownloadableArchives>content.7z</DownloadableArchives>
<SHA1>5b3939da1af492382c68388fc796837e4c36b876</SHA1>
</PackageUpdate>
+ <PackageUpdate>
+ <Name>C.virt</Name>
+ <DisplayName>Virtual subcomponent of C</DisplayName>
+ <Description>Example virtual component</Description>
+ <Version>1.0.0-1</Version>
+ <ReleaseDate>2015-01-01</ReleaseDate>
+ <Virtual>true</Virtual>
+ <UpdateFile CompressedSize="222" OS="Any" UncompressedSize="72"/>
+ <DownloadableArchives>content.7z</DownloadableArchives>
+ <SHA1>5b3939da1af492382c68388fc796837e4c36b876</SHA1>
+ </PackageUpdate>
+ <PackageUpdate>
+ <Name>C.virt.subcomponent</Name>
+ <DisplayName>Subcomponent of virtual component</DisplayName>
+ <Description>Example subcomponent of virtual component</Description>
+ <Version>1.0.0-1</Version>
+ <ReleaseDate>2015-01-01</ReleaseDate>
+ <UpdateFile CompressedSize="222" OS="Any" UncompressedSize="72"/>
+ <DownloadableArchives>content.7z</DownloadableArchives>
+ <SHA1>5b3939da1af492382c68388fc796837e4c36b876</SHA1>
+ </PackageUpdate>
<PackageUpdate>
<Name>AB</Name>
<DisplayName>AB</DisplayName>
diff --git a/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/A/2.0.0content.7z b/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/A/2.0.0content.7z
deleted file mode 100644
index d7fbf4d8e..000000000
--- a/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/A/2.0.0content.7z
+++ /dev/null
Binary files differ
diff --git a/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/A/2.0.0content.7z.sha1 b/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/A/2.0.0content.7z.sha1
deleted file mode 100644
index c5825de47..000000000
--- a/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/A/2.0.0content.7z.sha1
+++ /dev/null
@@ -1 +0,0 @@
-f33d2028e1c61061f7f29e5189f7d66800361dc2 \ No newline at end of file
diff --git a/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/A/2.0.0meta.7z b/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/A/2.0.0meta.7z
deleted file mode 100644
index d783c7c1c..000000000
--- a/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/A/2.0.0meta.7z
+++ /dev/null
Binary files differ
diff --git a/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/AB/1.0.2-1meta.7z b/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/AB/1.0.2-1meta.7z
deleted file mode 100644
index 20f2aca2d..000000000
--- a/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/AB/1.0.2-1meta.7z
+++ /dev/null
Binary files differ
diff --git a/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/B/2.0.0content.7z b/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/B/2.0.0content.7z
deleted file mode 100644
index bd0bc9352..000000000
--- a/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/B/2.0.0content.7z
+++ /dev/null
Binary files differ
diff --git a/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/B/2.0.0content.7z.sha1 b/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/B/2.0.0content.7z.sha1
deleted file mode 100644
index e66535388..000000000
--- a/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/B/2.0.0content.7z.sha1
+++ /dev/null
@@ -1 +0,0 @@
-bb256f1eda0f452c7ab33d1f364a4fad062f0a73 \ No newline at end of file
diff --git a/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/B/2.0.0meta.7z b/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/B/2.0.0meta.7z
deleted file mode 100644
index f92853734..000000000
--- a/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/B/2.0.0meta.7z
+++ /dev/null
Binary files differ
diff --git a/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/Updates.xml b/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/Updates.xml
index e0aedffdd..f0c724db8 100644
--- a/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/Updates.xml
+++ b/tests/auto/installer/cliinterface/data/uninstallableComponentsRepository/Updates.xml
@@ -37,4 +37,14 @@
<SHA1>cfa136fa1d7a4196896c90af72d510727ba799ae</SHA1>
<Virtual>true</Virtual>
</PackageUpdate>
+ <PackageUpdate>
+ <Name>B.subcomponent</Name>
+ <DisplayName>Subcomponent of B</DisplayName>
+ <Description>Example non-virtual subcomponent of B</Description>
+ <Version>2.0.0</Version>
+ <ReleaseDate>2015-01-01</ReleaseDate>
+ <UpdateFile CompressedSize="224" OS="Any" UncompressedSize="74"/>
+ <DownloadableArchives>content.7z</DownloadableArchives>
+ <SHA1>cfa136fa1d7a4196896c90af72d510727ba799ae</SHA1>
+ </PackageUpdate>
</Updates>
diff --git a/tests/auto/installer/cliinterface/tst_cliinterface.cpp b/tests/auto/installer/cliinterface/tst_cliinterface.cpp
index 550f45da2..d9497d53f 100644
--- a/tests/auto/installer/cliinterface/tst_cliinterface.cpp
+++ b/tests/auto/installer/cliinterface/tst_cliinterface.cpp
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** Copyright (C) 2020 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -89,6 +89,33 @@ private slots:
" <package name=\"C\" displayname=\"C\" version=\"1.0.0-1\"/>\n"
"</availablepackages>\n");
core->listAvailablePackages(QLatin1String("^C"));
+
+ // Test with filters
+ QTest::ignoreMessage(QtDebugMsg, "<availablepackages>\n"
+ " <package name=\"AB\" displayname=\"AB\" version=\"1.0.2-1\"/>\n"
+ " <package name=\"A\" displayname=\"A\" version=\"1.0.2-1\"/>\n"
+ "</availablepackages>\n");
+ QHash<QString, QString> searchHash {
+ { "Version", "1.0.2" },
+ { "DisplayName", "A" }
+ };
+ core->listAvailablePackages(QString(), searchHash);
+
+ QTest::ignoreMessage(QtDebugMsg, "<availablepackages>\n"
+ " <package name=\"B\" displayname=\"B\" version=\"1.0.0-1\"/>\n"
+ "</availablepackages>\n");
+ searchHash.clear();
+ searchHash.insert("Default", "false");
+ core->listAvailablePackages(QString(), searchHash);
+
+ // Need to change rules here to catch messages
+ QLoggingCategory::setFilterRules("ifw.* = true\n");
+
+ QTest::ignoreMessage(QtDebugMsg, "No matching packages found.");
+ core->listAvailablePackages(QLatin1String("C.virt"));
+
+ QTest::ignoreMessage(QtDebugMsg, "No matching packages found.");
+ core->listAvailablePackages(QLatin1String("C.virt.subcomponent"));
}
void testInstallPackageFails()
@@ -117,6 +144,11 @@ private slots:
<< QLatin1String("B")));
QTest::ignoreMessage(QtDebugMsg, "Preparing meta information download...");
+ QTest::ignoreMessage(QtDebugMsg, "Cannot install B.subcomponent. Component is descendant of a virtual component B.\n");
+ QCOMPARE(PackageManagerCore::Canceled, core->installSelectedComponentsSilently(QStringList()
+ << QLatin1String("B.subcomponent")));
+
+ QTest::ignoreMessage(QtDebugMsg, "Preparing meta information download...");
QTest::ignoreMessage(QtDebugMsg, "Cannot install MissingComponent. Component not found.\n");
QCOMPARE(PackageManagerCore::Canceled, core->installSelectedComponentsSilently(QStringList()
<< QLatin1String("MissingComponent")));
diff --git a/tests/auto/installer/contentshaupdate/contentshaupdate.pro b/tests/auto/installer/contentshaupdate/contentshaupdate.pro
new file mode 100644
index 000000000..84402794f
--- /dev/null
+++ b/tests/auto/installer/contentshaupdate/contentshaupdate.pro
@@ -0,0 +1,9 @@
+include(../../qttest.pri)
+
+QT += qml
+
+SOURCES += tst_contentshaupdate.cpp
+
+RESOURCES += \
+ settings.qrc \
+ ..\shared\config.qrc
diff --git a/tests/auto/installer/contentshaupdate/data/repository/Updates.xml b/tests/auto/installer/contentshaupdate/data/repository/Updates.xml
new file mode 100644
index 000000000..a83d41384
--- /dev/null
+++ b/tests/auto/installer/contentshaupdate/data/repository/Updates.xml
@@ -0,0 +1,48 @@
+<Updates>
+ <ApplicationName>{AnyApplication}</ApplicationName>
+ <ApplicationVersion>1.0.0</ApplicationVersion>
+ <Checksum>false</Checksum>
+ <PackageUpdate>
+ <Name>componentA</Name>
+ <DisplayName>Component A</DisplayName>
+ <Description>This component does not depend on any other component.</Description>
+ <Version>1.0.0</Version>
+ <ReleaseDate>2014-08-25</ReleaseDate>
+ <SortingPriority>100</SortingPriority>
+ <UpdateFile OS="Any" CompressedSize="283" UncompressedSize="101"/>
+ <DownloadableArchives>content.7z</DownloadableArchives>
+ <ContentSha1>10</ContentSha1>
+ </PackageUpdate>
+ <PackageUpdate>
+ <Name>componentB</Name>
+ <DisplayName>Component B</DisplayName>
+ <Description>This component does not depend on any other component.</Description>
+ <Version>1.0.0</Version>
+ <ReleaseDate>2014-08-25</ReleaseDate>
+ <SortingPriority>90</SortingPriority>
+ <UpdateFile OS="Any" CompressedSize="283" UncompressedSize="101"/>
+ <DownloadableArchives>content.7z</DownloadableArchives>
+ </PackageUpdate>
+ <PackageUpdate>
+ <Name>componentC</Name>
+ <DisplayName>Component C</DisplayName>
+ <Description>Component C</Description>
+ <Version>1.0.0</Version>
+ <ReleaseDate>2014-08-25</ReleaseDate>
+ <SortingPriority>80</SortingPriority>
+ <UpdateFile OS="Any" CompressedSize="283" UncompressedSize="101"/>
+ <DownloadableArchives>content.7z</DownloadableArchives>
+ <ContentSha1>10</ContentSha1>
+ </PackageUpdate>
+ <PackageUpdate>
+ <Name>componentD</Name>
+ <DisplayName>Component D</DisplayName>
+ <Description>Component D</Description>
+ <Version>1.0.0</Version>
+ <ReleaseDate>2014-08-25</ReleaseDate>
+ <SortingPriority>80</SortingPriority>
+ <UpdateFile CompressedSize="283" UncompressedSize="101" OS="Any"/>
+ <DownloadableArchives>content.7z</DownloadableArchives>
+ <ContentSha1>10</ContentSha1>
+ </PackageUpdate>
+</Updates>
diff --git a/tests/auto/installer/contentshaupdate/data/repository/componentA/1.0.0content.7z b/tests/auto/installer/contentshaupdate/data/repository/componentA/1.0.0content.7z
new file mode 100644
index 000000000..46a9f1d1e
--- /dev/null
+++ b/tests/auto/installer/contentshaupdate/data/repository/componentA/1.0.0content.7z
Binary files differ
diff --git a/tests/auto/installer/contentshaupdate/data/repository/componentB/1.0.0content.7z b/tests/auto/installer/contentshaupdate/data/repository/componentB/1.0.0content.7z
new file mode 100644
index 000000000..5f1fb2e1b
--- /dev/null
+++ b/tests/auto/installer/contentshaupdate/data/repository/componentB/1.0.0content.7z
Binary files differ
diff --git a/tests/auto/installer/contentshaupdate/data/repository/componentC/1.0.0content.7z b/tests/auto/installer/contentshaupdate/data/repository/componentC/1.0.0content.7z
new file mode 100644
index 000000000..83e82b5a3
--- /dev/null
+++ b/tests/auto/installer/contentshaupdate/data/repository/componentC/1.0.0content.7z
Binary files differ
diff --git a/tests/auto/installer/contentshaupdate/data/repository/componentD/1.0.0content.7z b/tests/auto/installer/contentshaupdate/data/repository/componentD/1.0.0content.7z
new file mode 100644
index 000000000..da50742a4
--- /dev/null
+++ b/tests/auto/installer/contentshaupdate/data/repository/componentD/1.0.0content.7z
Binary files differ
diff --git a/tests/auto/installer/contentshaupdate/data/repositoryUpdate/Updates.xml b/tests/auto/installer/contentshaupdate/data/repositoryUpdate/Updates.xml
new file mode 100644
index 000000000..87017cf91
--- /dev/null
+++ b/tests/auto/installer/contentshaupdate/data/repositoryUpdate/Updates.xml
@@ -0,0 +1,48 @@
+<Updates>
+ <ApplicationName>{AnyApplication}</ApplicationName>
+ <ApplicationVersion>1.0.0</ApplicationVersion>
+ <Checksum>false</Checksum>
+ <PackageUpdate>
+ <Name>componentA</Name>
+ <DisplayName>Component A</DisplayName>
+ <Description>Component A.</Description>
+ <Version>0.1.0</Version>
+ <ReleaseDate>2014-08-25</ReleaseDate>
+ <SortingPriority>100</SortingPriority>
+ <UpdateFile CompressedSize="283" UncompressedSize="101" OS="Any"/>
+ <DownloadableArchives>content.7z</DownloadableArchives>
+ <ContentSha1>5</ContentSha1>
+ </PackageUpdate>
+ <PackageUpdate>
+ <Name>componentB</Name>
+ <DisplayName>Component B</DisplayName>
+ <Description>Component B.</Description>
+ <Version>0.1.0</Version>
+ <ReleaseDate>2014-08-25</ReleaseDate>
+ <SortingPriority>90</SortingPriority>
+ <UpdateFile CompressedSize="283" UncompressedSize="101" OS="Any"/>
+ <DownloadableArchives>content.7z</DownloadableArchives>
+ <ContentSha1>10</ContentSha1>
+ </PackageUpdate>
+ <PackageUpdate>
+ <Name>componentC</Name>
+ <DisplayName>Component C</DisplayName>
+ <Description>Component C</Description>
+ <Version>2.0.0</Version>
+ <ReleaseDate>2014-08-25</ReleaseDate>
+ <SortingPriority>80</SortingPriority>
+ <UpdateFile CompressedSize="283" UncompressedSize="101" OS="Any"/>
+ <DownloadableArchives>content.7z</DownloadableArchives>
+ <ContentSha1>10</ContentSha1>
+ </PackageUpdate>
+ <PackageUpdate>
+ <Name>componentD</Name>
+ <DisplayName>Component D</DisplayName>
+ <Description>Component D</Description>
+ <Version>2.0.0</Version>
+ <ReleaseDate>2014-08-25</ReleaseDate>
+ <SortingPriority>80</SortingPriority>
+ <UpdateFile UncompressedSize="101" CompressedSize="283" OS="Any"/>
+ <DownloadableArchives>content.7z</DownloadableArchives>
+ </PackageUpdate>
+</Updates>
diff --git a/tests/auto/installer/contentshaupdate/data/repositoryUpdate/componentA/0.1.0content.7z b/tests/auto/installer/contentshaupdate/data/repositoryUpdate/componentA/0.1.0content.7z
new file mode 100644
index 000000000..bdbabc7fd
--- /dev/null
+++ b/tests/auto/installer/contentshaupdate/data/repositoryUpdate/componentA/0.1.0content.7z
Binary files differ
diff --git a/tests/auto/installer/contentshaupdate/data/repositoryUpdate/componentB/0.1.0content.7z b/tests/auto/installer/contentshaupdate/data/repositoryUpdate/componentB/0.1.0content.7z
new file mode 100644
index 000000000..1c1129b9f
--- /dev/null
+++ b/tests/auto/installer/contentshaupdate/data/repositoryUpdate/componentB/0.1.0content.7z
Binary files differ
diff --git a/tests/auto/installer/contentshaupdate/data/repositoryUpdate/componentC/2.0.0content.7z b/tests/auto/installer/contentshaupdate/data/repositoryUpdate/componentC/2.0.0content.7z
new file mode 100644
index 000000000..7f75bf503
--- /dev/null
+++ b/tests/auto/installer/contentshaupdate/data/repositoryUpdate/componentC/2.0.0content.7z
Binary files differ
diff --git a/tests/auto/installer/contentshaupdate/data/repositoryUpdate/componentD/2.0.0content.7z b/tests/auto/installer/contentshaupdate/data/repositoryUpdate/componentD/2.0.0content.7z
new file mode 100644
index 000000000..4207dfbf2
--- /dev/null
+++ b/tests/auto/installer/contentshaupdate/data/repositoryUpdate/componentD/2.0.0content.7z
Binary files differ
diff --git a/tests/auto/installer/contentshaupdate/settings.qrc b/tests/auto/installer/contentshaupdate/settings.qrc
new file mode 100644
index 000000000..a5d045f46
--- /dev/null
+++ b/tests/auto/installer/contentshaupdate/settings.qrc
@@ -0,0 +1,14 @@
+<RCC>
+ <qresource prefix="/">
+ <file>data/repository/Updates.xml</file>
+ <file>data/repository/componentA/1.0.0content.7z</file>
+ <file>data/repository/componentB/1.0.0content.7z</file>
+ <file>data/repository/componentC/1.0.0content.7z</file>
+ <file>data/repository/componentD/1.0.0content.7z</file>
+ <file>data/repositoryUpdate/Updates.xml</file>
+ <file>data/repositoryUpdate/componentA/0.1.0content.7z</file>
+ <file>data/repositoryUpdate/componentB/0.1.0content.7z</file>
+ <file>data/repositoryUpdate/componentC/2.0.0content.7z</file>
+ <file>data/repositoryUpdate/componentD/2.0.0content.7z</file>
+ </qresource>
+</RCC>
diff --git a/tests/auto/installer/contentshaupdate/tst_contentshaupdate.cpp b/tests/auto/installer/contentshaupdate/tst_contentshaupdate.cpp
new file mode 100644
index 000000000..d8d2f5377
--- /dev/null
+++ b/tests/auto/installer/contentshaupdate/tst_contentshaupdate.cpp
@@ -0,0 +1,108 @@
+/**************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the Qt Installer Framework.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+**************************************************************************/
+
+#include "../shared/packagemanager.h"
+#include "../shared/verifyinstaller.h"
+
+#include <QTest>
+
+using namespace QInstaller;
+
+class tst_ContentSha1Update : public QObject
+{
+ Q_OBJECT
+
+private:
+ void setRepository(const QString &repository)
+ {
+ core->reset();
+ core->cancelMetaInfoJob(); //Call cancel to reset metadata so that update repositories are fetched
+
+ QSet<Repository> repoList;
+ Repository repo = Repository::fromUserInput(repository);
+ repoList.insert(repo);
+ core->settings().setDefaultRepositories(repoList);
+ }
+
+private slots:
+ void initTestCase()
+ {
+ m_installDir = QInstaller::generateTemporaryFileName();
+ core = PackageManager::getPackageManagerWithInit(m_installDir);
+ }
+
+ void updateWithContentSha1_data()
+ {
+ QTest::addColumn<QString>("component");
+ QTest::addColumn<QString>("content");
+ QTest::addColumn<QString>("updatedContent");
+ QTest::addColumn<PackageManagerCore::Status>("expectedStatusAfterInstall");
+ QTest::addColumn<PackageManagerCore::Status>("expectedStatusAfterUpdate");
+
+ QTest::newRow("ContentSha1Change") << "componentA" << "1.0.0content.txt" << "0.1.0content.txt" << PackageManagerCore::Success << PackageManagerCore::Success;
+ QTest::newRow("NewContentSha1") << "componentB" << "1.0.0content.txt" << "0.1.0content.txt" << PackageManagerCore::Success << PackageManagerCore::Success;
+ QTest::newRow("SameContentSha1") << "componentC" << "1.0.0content.txt" << "1.0.0content.txt" << PackageManagerCore::Success << PackageManagerCore::Canceled;
+ QTest::newRow("Sha1RemovedFromRepo") << "componentD" << "1.0.0content.txt" << "2.0.0content.txt" << PackageManagerCore::Success << PackageManagerCore::Success;
+ }
+
+ void updateWithContentSha1()
+ {
+ QFETCH(QString, component);
+ QFETCH(QString, content);
+ QFETCH(QString, updatedContent);
+ QFETCH(PackageManagerCore::Status, expectedStatusAfterInstall);
+ QFETCH(PackageManagerCore::Status, expectedStatusAfterUpdate);
+
+ setRepository(":///data/repository");
+ QCOMPARE(expectedStatusAfterInstall, core->installSelectedComponentsSilently(QStringList() << component));
+ QCOMPARE(expectedStatusAfterInstall, core->status());
+ VerifyInstaller::verifyInstallerResources(m_installDir, component, content);
+
+ core->commitSessionOperations();
+ core->setPackageManager();
+ setRepository(":///data/repositoryUpdate");
+ QCOMPARE(expectedStatusAfterUpdate, core->updateComponentsSilently(QStringList()));
+ VerifyInstaller::verifyInstallerResources(m_installDir, component, updatedContent);
+ }
+
+ void cleanupTestCase()
+ {
+ QDir dir(m_installDir);
+ QVERIFY(dir.removeRecursively());
+ delete core;
+ }
+
+private:
+ QString m_installDir;
+ PackageManagerCore *core;
+};
+
+
+QTEST_MAIN(tst_ContentSha1Update)
+
+#include "tst_contentshaupdate.moc"
diff --git a/tests/auto/installer/factory/tst_factory.cpp b/tests/auto/installer/factory/tst_factory.cpp
index f44a6febe..eb7e2c36c 100644
--- a/tests/auto/installer/factory/tst_factory.cpp
+++ b/tests/auto/installer/factory/tst_factory.cpp
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** Copyright (C) 2020 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -82,7 +82,7 @@ public:
: Food(amount)
, m_expireDate(expireDate)
{ qDebug().nospace().noquote() << "Constructor."; }
- QDate expireDate() const {
+ QDate expireDate() const Q_DECL_OVERRIDE {
return m_expireDate;
}
private:
@@ -92,7 +92,7 @@ private:
class Butter : public Food
{
public:
- QDate expireDate() const {
+ QDate expireDate() const Q_DECL_OVERRIDE {
return m_expireDate;
}
static Food *create(int amount, const QDate expireDate) {
@@ -117,7 +117,7 @@ public:
: Food(amount)
, m_expireDate(expireDate)
{ qDebug().nospace().noquote() << "Constructor."; }
- QDate expireDate() const {
+ QDate expireDate() const Q_DECL_OVERRIDE {
return m_expireDate;
}
diff --git a/tests/auto/installer/installer.pro b/tests/auto/installer/installer.pro
index 114c43d7a..cb0438ab3 100644
--- a/tests/auto/installer/installer.pro
+++ b/tests/auto/installer/installer.pro
@@ -39,7 +39,8 @@ SUBDIRS += \
globalsettingsoperation \
elevatedexecuteoperation \
treename \
- createoffline
+ createoffline \
+ contentshaupdate
win32 {
SUBDIRS += registerfiletypeoperation \
diff --git a/tests/auto/installer/metadatajob/data/config.xml b/tests/auto/installer/metadatajob/data/config.xml
deleted file mode 100644
index 041ce5062..000000000
--- a/tests/auto/installer/metadatajob/data/config.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Installer>
- <Name>Your application</Name>
- <Version>1.2.3</Version>
- <MaintenanceToolName></MaintenanceToolName>
- <MaintenanceToolIniFile></MaintenanceToolIniFile>
- <TargetConfigurationFile></TargetConfigurationFile>
-</Installer>
diff --git a/tests/auto/installer/metadatajob/settings.qrc b/tests/auto/installer/metadatajob/settings.qrc
index c881f294b..6e56a7854 100644
--- a/tests/auto/installer/metadatajob/settings.qrc
+++ b/tests/auto/installer/metadatajob/settings.qrc
@@ -1,6 +1,5 @@
<RCC>
<qresource prefix="/">
- <file>data/config.xml</file>
<file>data/repository/Updates.xml</file>
<file>data/repositoryActionAdd/Updates.xml</file>
<file>data/repositoryActionRemove/Updates.xml</file>
diff --git a/tests/auto/installer/metadatajob/tst_metadatajob.cpp b/tests/auto/installer/metadatajob/tst_metadatajob.cpp
index ef7b42940..54609ab95 100644
--- a/tests/auto/installer/metadatajob/tst_metadatajob.cpp
+++ b/tests/auto/installer/metadatajob/tst_metadatajob.cpp
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** Copyright (C) 2020 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -47,7 +47,6 @@ class tst_MetaDataJob : public QObject
private slots:
void testRepository()
{
- Settings settings = Settings::fromFileAndPrefix(":///data/config.xml", ":///data");
PackageManagerCore core;
core.setInstaller();
QSet<Repository> repoList;
@@ -63,7 +62,6 @@ private slots:
void testRepositoryUpdateActionAdd()
{
- Settings settings = Settings::fromFileAndPrefix(":///data/config.xml", ":///data");
PackageManagerCore core;
core.setInstaller();
QSet<Repository> repoList;
@@ -82,7 +80,6 @@ private slots:
void testRepositoryUpdateActionRemove()
{
- Settings settings = Settings::fromFileAndPrefix(":///data/config.xml", ":///data");
PackageManagerCore core;
core.setInstaller();
QSet<Repository> repoList;
diff --git a/tests/auto/installer/packagemanagercore/tst_packagemanagercore.cpp b/tests/auto/installer/packagemanagercore/tst_packagemanagercore.cpp
index ae2c3b211..a3e86c2f8 100644
--- a/tests/auto/installer/packagemanagercore/tst_packagemanagercore.cpp
+++ b/tests/auto/installer/packagemanagercore/tst_packagemanagercore.cpp
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -46,7 +46,7 @@ using namespace QInstaller;
class DummyComponent : public Component
{
public:
- DummyComponent(PackageManagerCore *core)
+ explicit DummyComponent(PackageManagerCore *core)
: Component(core)
{
setCheckState(Qt::Checked);
@@ -306,7 +306,7 @@ private slots:
QTest::ignoreMessage(QtWarningMsg, re);
QTest::ignoreMessage(QtDebugMsg, "No updates available.");
- QCOMPARE(PackageManagerCore::Failure, core.updateComponentsSilently(QStringList()));
+ QCOMPARE(PackageManagerCore::Canceled, core.updateComponentsSilently(QStringList()));
QVERIFY(QDir().rmdir(testDirectory));
}
diff --git a/tests/auto/installer/registerfiletypeoperation/tst_registerfiletypeoperation.cpp b/tests/auto/installer/registerfiletypeoperation/tst_registerfiletypeoperation.cpp
index 5a4377d7b..3e3005621 100644
--- a/tests/auto/installer/registerfiletypeoperation/tst_registerfiletypeoperation.cpp
+++ b/tests/auto/installer/registerfiletypeoperation/tst_registerfiletypeoperation.cpp
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** Copyright (C) 2020 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -80,7 +80,6 @@ private slots:
QInstaller::init();
QString randomString = "";
const QString possible = "abcdefghijklmnopqrstuvwxyz0123456789";
- qsrand(QTime::currentTime().msec());
for (int i = 0; i < 5; i++) {
int index = QRandomGenerator::global()->generate() % possible.length();
QChar nextChar = possible.at(index);
diff --git a/tests/auto/tools/repotest/settings.qrc b/tests/auto/tools/repotest/settings.qrc
index e731af222..a0b5743fe 100644
--- a/tests/auto/tools/repotest/settings.qrc
+++ b/tests/auto/tools/repotest/settings.qrc
@@ -31,5 +31,29 @@
<file>repository_unite/C/1.0.0content.7z.sha1</file>
<file>repository_unite/2020-11-10-0931_meta.7z</file>
<file>repository_unite/Updates.xml</file>
+
+ <file>test_package_versions/repository_1/A/2.0.0content.7z</file>
+ <file>test_package_versions/repository_1/A/2.0.0content.7z.sha1</file>
+ <file>test_package_versions/repository_1/A/2.0.0meta.7z</file>
+ <file>test_package_versions/repository_1/B/1.0.0content.7z</file>
+ <file>test_package_versions/repository_1/B/1.0.0content.7z.sha1</file>
+ <file>test_package_versions/repository_1/B/1.0.0meta.7z</file>
+ <file>test_package_versions/repository_1/Updates.xml</file>
+
+ <file>test_package_versions/repository_2/A/1.0.0content.7z</file>
+ <file>test_package_versions/repository_2/A/1.0.0content.7z.sha1</file>
+ <file>test_package_versions/repository_2/A/1.0.0meta.7z</file>
+ <file>test_package_versions/repository_2/B/1.0.0content.7z</file>
+ <file>test_package_versions/repository_2/B/1.0.0content.7z.sha1</file>
+ <file>test_package_versions/repository_2/B/1.0.0meta.7z</file>
+ <file>test_package_versions/repository_2/Updates.xml</file>
+
+ <file>test_package_versions/repository_3/A/1.0.0content.7z</file>
+ <file>test_package_versions/repository_3/A/1.0.0content.7z.sha1</file>
+ <file>test_package_versions/repository_3/A/1.0.0meta.7z</file>
+ <file>test_package_versions/repository_3/B/3.0.0content.7z</file>
+ <file>test_package_versions/repository_3/B/3.0.0content.7z.sha1</file>
+ <file>test_package_versions/repository_3/B/3.0.0meta.7z</file>
+ <file>test_package_versions/repository_3/Updates.xml</file>
</qresource>
</RCC>
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_1/A/2.0.0content.7z b/tests/auto/tools/repotest/test_package_versions/repository_1/A/2.0.0content.7z
new file mode 100644
index 000000000..46e2c9124
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_1/A/2.0.0content.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_1/A/2.0.0content.7z.sha1 b/tests/auto/tools/repotest/test_package_versions/repository_1/A/2.0.0content.7z.sha1
new file mode 100644
index 000000000..53010cea2
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_1/A/2.0.0content.7z.sha1
@@ -0,0 +1 @@
+059e5ed8cd3a1fbca08cccfa4075265192603e3f \ No newline at end of file
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_1/A/2.0.0meta.7z b/tests/auto/tools/repotest/test_package_versions/repository_1/A/2.0.0meta.7z
new file mode 100644
index 000000000..af0863696
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_1/A/2.0.0meta.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_1/B/1.0.0content.7z b/tests/auto/tools/repotest/test_package_versions/repository_1/B/1.0.0content.7z
new file mode 100644
index 000000000..46e2c9124
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_1/B/1.0.0content.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_1/B/1.0.0content.7z.sha1 b/tests/auto/tools/repotest/test_package_versions/repository_1/B/1.0.0content.7z.sha1
new file mode 100644
index 000000000..53010cea2
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_1/B/1.0.0content.7z.sha1
@@ -0,0 +1 @@
+059e5ed8cd3a1fbca08cccfa4075265192603e3f \ No newline at end of file
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_1/B/1.0.0meta.7z b/tests/auto/tools/repotest/test_package_versions/repository_1/B/1.0.0meta.7z
new file mode 100644
index 000000000..e5be1148e
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_1/B/1.0.0meta.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_1/Updates.xml b/tests/auto/tools/repotest/test_package_versions/repository_1/Updates.xml
new file mode 100644
index 000000000..dfae8c8bd
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_1/Updates.xml
@@ -0,0 +1,28 @@
+<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>2.0.0</Version>
+ <ReleaseDate>2020-01-01</ReleaseDate>
+ <Default>true</Default>
+ <Script>script2.0.0.qs</Script>
+ <UpdateFile UncompressedSize="40" CompressedSize="72" OS="Any"/>
+ <DownloadableArchives>content.7z</DownloadableArchives>
+ <SHA1>da6dae55a8cc3fb9f012e33fa7b9c187a823aa9a</SHA1>
+ </PackageUpdate>
+ <PackageUpdate>
+ <Name>B</Name>
+ <DisplayName>B</DisplayName>
+ <Description>Example component B</Description>
+ <Version>1.0.0</Version>
+ <ReleaseDate>2020-01-01</ReleaseDate>
+ <Default>true</Default>
+ <UpdateFile UncompressedSize="40" CompressedSize="72" OS="Any"/>
+ <DownloadableArchives>content.7z</DownloadableArchives>
+ <SHA1>d88b373458b4bbec38132692061bf1e7aa68e7f7</SHA1>
+ </PackageUpdate>
+</Updates>
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_2/A/1.0.0content.7z b/tests/auto/tools/repotest/test_package_versions/repository_2/A/1.0.0content.7z
new file mode 100644
index 000000000..46e2c9124
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_2/A/1.0.0content.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_2/A/1.0.0content.7z.sha1 b/tests/auto/tools/repotest/test_package_versions/repository_2/A/1.0.0content.7z.sha1
new file mode 100644
index 000000000..53010cea2
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_2/A/1.0.0content.7z.sha1
@@ -0,0 +1 @@
+059e5ed8cd3a1fbca08cccfa4075265192603e3f \ No newline at end of file
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_2/A/1.0.0meta.7z b/tests/auto/tools/repotest/test_package_versions/repository_2/A/1.0.0meta.7z
new file mode 100644
index 000000000..c4da482bf
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_2/A/1.0.0meta.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_2/B/1.0.0content.7z b/tests/auto/tools/repotest/test_package_versions/repository_2/B/1.0.0content.7z
new file mode 100644
index 000000000..46e2c9124
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_2/B/1.0.0content.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_2/B/1.0.0content.7z.sha1 b/tests/auto/tools/repotest/test_package_versions/repository_2/B/1.0.0content.7z.sha1
new file mode 100644
index 000000000..53010cea2
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_2/B/1.0.0content.7z.sha1
@@ -0,0 +1 @@
+059e5ed8cd3a1fbca08cccfa4075265192603e3f \ No newline at end of file
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_2/B/1.0.0meta.7z b/tests/auto/tools/repotest/test_package_versions/repository_2/B/1.0.0meta.7z
new file mode 100644
index 000000000..e5be1148e
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_2/B/1.0.0meta.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_2/Updates.xml b/tests/auto/tools/repotest/test_package_versions/repository_2/Updates.xml
new file mode 100644
index 000000000..ac12fba4b
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_2/Updates.xml
@@ -0,0 +1,28 @@
+<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.0</Version>
+ <ReleaseDate>2020-01-01</ReleaseDate>
+ <Default>true</Default>
+ <Script>script1.0.0.qs</Script>
+ <UpdateFile UncompressedSize="40" CompressedSize="72" OS="Any"/>
+ <DownloadableArchives>content.7z</DownloadableArchives>
+ <SHA1>da6dae55a8cc3fb9f012e33fa7b9c187a823aa9a</SHA1>
+ </PackageUpdate>
+ <PackageUpdate>
+ <Name>B</Name>
+ <DisplayName>B</DisplayName>
+ <Description>Example component B</Description>
+ <Version>1.0.0</Version>
+ <ReleaseDate>2020-01-01</ReleaseDate>
+ <Default>true</Default>
+ <UpdateFile UncompressedSize="40" CompressedSize="72" OS="Any"/>
+ <DownloadableArchives>content.7z</DownloadableArchives>
+ <SHA1>d88b373458b4bbec38132692061bf1e7aa68e7f7</SHA1>
+ </PackageUpdate>
+</Updates>
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_3/A/1.0.0content.7z b/tests/auto/tools/repotest/test_package_versions/repository_3/A/1.0.0content.7z
new file mode 100644
index 000000000..46e2c9124
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_3/A/1.0.0content.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_3/A/1.0.0content.7z.sha1 b/tests/auto/tools/repotest/test_package_versions/repository_3/A/1.0.0content.7z.sha1
new file mode 100644
index 000000000..53010cea2
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_3/A/1.0.0content.7z.sha1
@@ -0,0 +1 @@
+059e5ed8cd3a1fbca08cccfa4075265192603e3f \ No newline at end of file
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_3/A/1.0.0meta.7z b/tests/auto/tools/repotest/test_package_versions/repository_3/A/1.0.0meta.7z
new file mode 100644
index 000000000..3706e8dd8
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_3/A/1.0.0meta.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_3/B/3.0.0content.7z b/tests/auto/tools/repotest/test_package_versions/repository_3/B/3.0.0content.7z
new file mode 100644
index 000000000..46e2c9124
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_3/B/3.0.0content.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_3/B/3.0.0content.7z.sha1 b/tests/auto/tools/repotest/test_package_versions/repository_3/B/3.0.0content.7z.sha1
new file mode 100644
index 000000000..53010cea2
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_3/B/3.0.0content.7z.sha1
@@ -0,0 +1 @@
+059e5ed8cd3a1fbca08cccfa4075265192603e3f \ No newline at end of file
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_3/B/3.0.0meta.7z b/tests/auto/tools/repotest/test_package_versions/repository_3/B/3.0.0meta.7z
new file mode 100644
index 000000000..e5be1148e
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_3/B/3.0.0meta.7z
Binary files differ
diff --git a/tests/auto/tools/repotest/test_package_versions/repository_3/Updates.xml b/tests/auto/tools/repotest/test_package_versions/repository_3/Updates.xml
new file mode 100644
index 000000000..40d86538c
--- /dev/null
+++ b/tests/auto/tools/repotest/test_package_versions/repository_3/Updates.xml
@@ -0,0 +1,28 @@
+<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.0</Version>
+ <ReleaseDate>2020-01-01</ReleaseDate>
+ <Default>true</Default>
+ <Script>script1.0.0.qs</Script>
+ <UpdateFile UncompressedSize="40" CompressedSize="72" OS="Any"/>
+ <DownloadableArchives>content.7z</DownloadableArchives>
+ <SHA1>da6dae55a8cc3fb9f012e33fa7b9c187a823aa9a</SHA1>
+ </PackageUpdate>
+ <PackageUpdate>
+ <Name>B</Name>
+ <DisplayName>B</DisplayName>
+ <Description>Example component B</Description>
+ <Version>3.0.0</Version>
+ <ReleaseDate>2020-01-01</ReleaseDate>
+ <Default>true</Default>
+ <UpdateFile UncompressedSize="40" CompressedSize="72" OS="Any"/>
+ <DownloadableArchives>content.7z</DownloadableArchives>
+ <SHA1>d88b373458b4bbec38132692061bf1e7aa68e7f7</SHA1>
+ </PackageUpdate>
+</Updates>
diff --git a/tests/auto/tools/repotest/tst_repotest.cpp b/tests/auto/tools/repotest/tst_repotest.cpp
index 5aa614454..02594f400 100644
--- a/tests/auto/tools/repotest/tst_repotest.cpp
+++ b/tests/auto/tools/repotest/tst_repotest.cpp
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** Copyright (C) 2020 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -39,114 +39,63 @@ class tst_repotest : public QObject
{
Q_OBJECT
private:
- // TODO generateRepo() is almost direct copy from repogen.cpp.
- // Move the needed parts of repogen.cpp to a usable function for easier maintenance.
- void generateRepo(bool createSplitMetadata, bool createUnifiedMetadata, bool updateNewComponents)
+ void generateRepo(bool createSplitMetadata, bool createUnifiedMetadata, bool updateNewComponents,
+ QStringList packagesUpdatedWithSha = QStringList())
{
QStringList filteredPackages;
- QInstallerTools::FilterType filterType = QInstallerTools::Exclude;
- QInstallerTools::PackageInfoVector precompressedPackages = QInstallerTools::createListOfRepositoryPackages
- (m_repositoryDirectories, &filteredPackages, filterType);
- m_packages.append(precompressedPackages);
-
- QInstallerTools::PackageInfoVector preparedPackages = QInstallerTools::createListOfPackages(m_packagesDirectories,
- &filteredPackages, filterType);
- m_packages.append(preparedPackages);
-
- if (updateNewComponents)
- QInstallerTools::filterNewComponents(m_repositoryDir, m_packages);
- QHash<QString, QString> pathToVersionMapping = QInstallerTools::buildPathToVersionMapping(m_packages);
-
- foreach (const QInstallerTools::PackageInfo &package, m_packages) {
- const QFileInfo fi(m_repositoryDir, package.name);
- if (fi.exists())
- removeDirectory(fi.absoluteFilePath());
- }
+ m_packages = QInstallerTools::collectPackages(m_repoInfo,
+ &filteredPackages, QInstallerTools::Exclude, updateNewComponents, packagesUpdatedWithSha);
if (updateNewComponents) { //Verify that component B exists as that is not updated
if (createSplitMetadata) {
- VerifyInstaller::verifyFileExistence(m_repositoryDir + "/B", QStringList() << "1.0.0content.7z"
+ VerifyInstaller::verifyFileExistence(m_repoInfo.repositoryDir + "/B", QStringList() << "1.0.0content.7z"
<< "1.0.0content.7z.sha1" << "1.0.0meta.7z");
} else {
- VerifyInstaller::verifyFileExistence(m_repositoryDir + "/B", QStringList() << "1.0.0content.7z"
+ VerifyInstaller::verifyFileExistence(m_repoInfo.repositoryDir + "/B", QStringList() << "1.0.0content.7z"
<< "1.0.0content.7z.sha1");
}
} else {
- QDir dir(m_repositoryDir + "/B");
+ QDir dir(m_repoInfo.repositoryDir + "/B");
QVERIFY(!dir.exists());
}
- QStringList directories;
- directories.append(m_packagesDirectories);
- directories.append(m_repositoryDirectories);
-
- QStringList unite7zFiles;
- foreach (const QString &repositoryDirectory, m_repositoryDirectories) {
- QDirIterator it(repositoryDirectory, QStringList(QLatin1String("*_meta.7z"))
- , QDir::Files | QDir::CaseSensitive);
- while (it.hasNext()) {
- it.next();
- unite7zFiles.append(it.fileInfo().absoluteFilePath());
- }
- }
-
- QInstallerTools::copyComponentData(directories, m_repositoryDir, &m_packages);
- QInstallerTools::copyMetaData(m_tmpMetaDir, m_repositoryDir, m_packages, QLatin1String("{AnyApplication}"),
- QLatin1String("1.0.0"), unite7zFiles);
- QString existing7z = QInstallerTools::existingUniteMeta7z(m_repositoryDir);
- if (!existing7z.isEmpty())
- existing7z = m_repositoryDir + QDir::separator() + existing7z;
- QInstallerTools::compressMetaDirectories(m_tmpMetaDir, existing7z, pathToVersionMapping,
- createSplitMetadata, createUnifiedMetadata);
- QDirIterator it(m_repositoryDir, QStringList(QLatin1String("Updates*.xml"))
- << QLatin1String("*_meta.7z"), QDir::Files | QDir::CaseSensitive);
- while (it.hasNext()) {
- it.next();
- QFile::remove(it.fileInfo().absoluteFilePath());
- }
- QInstaller::moveDirectoryContents(m_tmpMetaDir, m_repositoryDir);
- }
-
- void generateTempMetaDir()
- {
- if (!m_tmpMetaDir.isEmpty())
- m_tempDirDeleter.releaseAndDelete(m_tmpMetaDir);
QTemporaryDir tmp;
tmp.setAutoRemove(false);
- m_tmpMetaDir = tmp.path();
- m_tempDirDeleter.add(m_tmpMetaDir);
+ const QString tmpMetaDir = tmp.path();
+ QInstallerTools::createRepository(m_repoInfo, &m_packages, tmpMetaDir, createSplitMetadata,
+ createUnifiedMetadata);
+ QInstaller::removeDirectory(tmpMetaDir, true);
}
void clearData()
{
- generateTempMetaDir();
- m_packagesDirectories.clear();
- m_repositoryDirectories.clear();
+ m_repoInfo.packages.clear();
+ m_repoInfo.repositoryPackages.clear();
m_packages.clear();
}
void initRepoUpdate()
{
clearData();
- m_packagesDirectories << ":///packages_update";
+ m_repoInfo.packages << ":///packages_update";
}
- void initRepoUpdateFromRepository(const QString &repository)
+ void initRepoUpdateFromRepositories(const QStringList &repositories)
{
clearData();
- m_repositoryDirectories << repository;
+ m_repoInfo.repositoryPackages << repositories;
}
void verifyUniteMetadata(const QString &scriptVersion)
{
- QString fileContent = VerifyInstaller::fileContent(m_repositoryDir + QDir::separator()
+ QString fileContent = VerifyInstaller::fileContent(m_repoInfo.repositoryDir + QDir::separator()
+ "Updates.xml");
QRegularExpression re("<MetadataName>(.*)<.MetadataName>");
QStringList matches = re.match(fileContent).capturedTexts();
- QString existingUniteMeta7z = QInstallerTools::existingUniteMeta7z(m_repositoryDir);
+ QString existingUniteMeta7z = QInstallerTools::existingUniteMeta7z(m_repoInfo.repositoryDir);
QCOMPARE(2, matches.count());
QCOMPARE(existingUniteMeta7z, matches.at(1));
- QFile file(m_repositoryDir + QDir::separator() + matches.at(1));
+ QFile file(m_repoInfo.repositoryDir + QDir::separator() + matches.at(1));
QVERIFY(file.open(QIODevice::ReadOnly));
//We have script<version>.qs for package A in the unite metadata
@@ -159,35 +108,35 @@ private:
QCOMPARE(qPrintable(fileName.arg(scriptVersion)), fileIt->path);
}
- VerifyInstaller::verifyFileExistence(m_repositoryDir, QStringList() << "Updates.xml"
+ VerifyInstaller::verifyFileExistence(m_repoInfo.repositoryDir, QStringList() << "Updates.xml"
<< matches.at(1));
- VerifyInstaller::verifyFileContent(m_repositoryDir + QDir::separator() + "Updates.xml",
+ VerifyInstaller::verifyFileContent(m_repoInfo.repositoryDir + QDir::separator() + "Updates.xml",
"SHA1");
- VerifyInstaller::verifyFileContent(m_repositoryDir + QDir::separator() + "Updates.xml",
+ VerifyInstaller::verifyFileContent(m_repoInfo.repositoryDir + QDir::separator() + "Updates.xml",
"MetadataName");
}
- void verifyComponentRepository(const QString &componentAVersion, bool hasComponentMeta)
+ void verifyComponentRepository(const QString &componentAVersion, const QString &componentBVersion, bool hasComponentMeta)
{
const QString content = "%1content.7z";
- const QString contentSha = "%1content.7z.sha1";
+ const QString contentSha1 = "%1content.7z.sha1";
const QString meta = "%1meta.7z";
QStringList componentA;
QStringList componentB;
- componentA << qPrintable(content.arg(componentAVersion)) << qPrintable(contentSha.arg(componentAVersion));
- componentB << "1.0.0content.7z" << "1.0.0content.7z.sha1";
+ componentA << qPrintable(content.arg(componentAVersion)) << qPrintable(contentSha1.arg(componentAVersion));
+ componentB << qPrintable(content.arg(componentBVersion)) << qPrintable(contentSha1.arg(componentBVersion));
if (hasComponentMeta) {
componentA << qPrintable(meta.arg(componentAVersion));
- componentB << "1.0.0meta.7z";
+ componentB << qPrintable(meta.arg(componentBVersion));
}
- VerifyInstaller::verifyFileExistence(m_repositoryDir + "/A", componentA);
- VerifyInstaller::verifyFileExistence(m_repositoryDir + "/B", componentB);
+ VerifyInstaller::verifyFileExistence(m_repoInfo.repositoryDir + "/A", componentA);
+ VerifyInstaller::verifyFileExistence(m_repoInfo.repositoryDir + "/B", componentB);
}
void verifyComponentMetaUpdatesXml()
{
- VerifyInstaller::verifyFileExistence(m_repositoryDir, QStringList() << "Updates.xml");
- VerifyInstaller::verifyFileHasNoContent(m_repositoryDir + QDir::separator() + "Updates.xml",
+ VerifyInstaller::verifyFileExistence(m_repoInfo.repositoryDir, QStringList() << "Updates.xml");
+ VerifyInstaller::verifyFileHasNoContent(m_repoInfo.repositoryDir + QDir::separator() + "Updates.xml",
"MetadataName");
}
@@ -216,18 +165,18 @@ private:
foreach (const QString &fileName, contentFiles) {
message = "Copying file from \":///%5/%1/%2%4\" to \"%3/%1/%2%4\"";
QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(component).arg(version)
- .arg(m_repositoryDir).arg(fileName).arg(repository)));
+ .arg(m_repoInfo.repositoryDir).arg(fileName).arg(repository)));
}
}
- void ignoreMessageForCollectingRepository(const QString &repository)
+ void ignoreMessageForCollectingRepository(const QStringList &repositories)
{
const QString message = "Process repository \"%2\"";
QTest::ignoreMessage(QtDebugMsg, "Collecting information about available repository packages...");
- QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(repository)));
+ for (auto &repo : repositories)
+ QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(repo)));
QTest::ignoreMessage(QtDebugMsg, "Collecting information about available packages...");
QTest::ignoreMessage(QtDebugMsg, "No available packages found at the specified location.");
- QTest::ignoreMessage(QtDebugMsg, "- it provides the package \"A\" - \"2.0.0\"");
}
void ignoreMessagesForCopyMetadata(const QString &component, bool hasMeta, bool update)
@@ -303,9 +252,23 @@ private:
void ignoreMessageForUpdateComponent()
{
QString message = "Update component \"A\" in \"%1\" .";
- QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(m_repositoryDir)));
+ QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(m_repoInfo.repositoryDir)));
message = "Update component \"C\" in \"%1\" .";
- QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(m_repositoryDir)));
+ QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(m_repoInfo.repositoryDir)));
+ }
+
+ void verifyComponentShaUpdate(int shaUpdateComponents)
+ {
+ QString updatesXmlFile(m_repoInfo.repositoryDir + QDir::separator() + "Updates.xml");
+ QFile file(updatesXmlFile);
+ QDomDocument dom;
+
+ QVERIFY(file.open(QIODevice::ReadOnly));
+ QVERIFY(dom.setContent(&file));
+ file.close();
+ QCOMPARE(dom.elementsByTagName("ContentSha1").count(), shaUpdateComponents);
+ VerifyInstaller::verifyFileContent(updatesXmlFile,
+ "<ContentSha1>059e5ed8cd3a1fbca08cccfa4075265192603e3f</ContentSha1>");
}
private slots:
@@ -313,11 +276,10 @@ private slots:
{
ignoreMessageForCollectingPackages("1.0.0", "1.0.0");
- m_repositoryDir = QInstallerTools::makePathAbsolute(QInstaller::generateTemporaryFileName());
- m_tempDirDeleter.add(m_repositoryDir);
- generateTempMetaDir();
+ m_repoInfo.repositoryDir = QInstallerTools::makePathAbsolute(QInstaller::generateTemporaryFileName());
+ m_tempDirDeleter.add(m_repoInfo.repositoryDir);
- m_packagesDirectories << ":///packages";
+ m_repoInfo.packages << ":///packages";
ignoreMessagesForComponentHash(QStringList() << "A" << "B", false);
ignoreMessagesForCopyMetadata("A", true, false); //Only A has metadata
@@ -334,7 +296,7 @@ private slots:
ignoreMessagesForComponentSha(QStringList () << "A" << "B", false);
generateRepo(true, false, false);
- verifyComponentRepository("1.0.0", true);
+ verifyComponentRepository("1.0.0", "1.0.0", true);
verifyComponentMetaUpdatesXml();
}
@@ -344,7 +306,7 @@ private slots:
ignoreMessagesForUniteMeta(false);
generateRepo(true, true, false);
- verifyComponentRepository("1.0.0", true);
+ verifyComponentRepository("1.0.0", "1.0.0", true);
verifyUniteMetadata("1.0.0");
}
@@ -353,16 +315,36 @@ private slots:
ignoreMessagesForUniteMeta(false);
generateRepo(false, true, false);
- verifyComponentRepository("1.0.0", false);
+ verifyComponentRepository("1.0.0", "1.0.0", false);
verifyUniteMetadata("1.0.0");
}
+ void testWithComponentShaUpdate()
+ {
+ ignoreMessagesForComponentSha(QStringList () << "A" << "B", false);
+ generateRepo(true, false, false, QStringList () << "A");
+
+ verifyComponentRepository("1.0.0", "1.0.0", true);
+ verifyComponentMetaUpdatesXml();
+ verifyComponentShaUpdate(1);
+ }
+
+ void testWithTwoComponentsShaUpdate()
+ {
+ ignoreMessagesForComponentSha(QStringList () << "A" << "B", false);
+ generateRepo(true, false, false, QStringList () << "A" << "B");
+
+ verifyComponentRepository("1.0.0", "1.0.0", true);
+ verifyComponentMetaUpdatesXml();
+ verifyComponentShaUpdate(2);
+ }
+
void testUpdateNewComponents()
{
// Create 'base' repository which will be updated
ignoreMessagesForComponentSha(QStringList() << "A" << "B", false);
generateRepo(true, false, false);
- verifyComponentRepository("1.0.0", true);
+ verifyComponentRepository("1.0.0", "1.0.0", true);
// Update the 'base' repository
initRepoUpdate();
@@ -371,9 +353,9 @@ private slots:
ignoreMessagesForComponentHash(QStringList() << "A", true);
ignoreMessagesForCopyMetadata("A", true, true);
const QString &message = "Update component \"A\" in \"%1\" .";
- QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(m_repositoryDir)));
+ QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(m_repoInfo.repositoryDir)));
generateRepo(true, false, true);
- verifyComponentRepository("2.0.0", true);
+ verifyComponentRepository("2.0.0", "1.0.0", true);
verifyComponentMetaUpdatesXml();
}
@@ -381,12 +363,12 @@ private slots:
{
ignoreMessagesForComponentSha(QStringList() << "A" << "B", false);
generateRepo(true, false, false);
- verifyComponentRepository("1.0.0",true);
+ verifyComponentRepository("1.0.0", "1.0.0", true);
initRepoUpdate();
ignoreMessagesForUpdateComponents();
generateRepo(true, false, false);
- verifyComponentRepository("2.0.0", true);
+ verifyComponentRepository("2.0.0", "1.0.0", true);
verifyComponentMetaUpdatesXml();
}
@@ -395,13 +377,13 @@ private slots:
ignoreMessagesForComponentSha(QStringList() << "A" << "B", false);
ignoreMessagesForUniteMeta(false);
generateRepo(true, true, false);
- verifyComponentRepository("1.0.0", true);
+ verifyComponentRepository("1.0.0", "1.0.0", true);
initRepoUpdate();
ignoreMessagesForUpdateComponents();
ignoreMessagesForUniteMeta(true);
generateRepo(true, true, false);
- verifyComponentRepository("2.0.0", true);
+ verifyComponentRepository("2.0.0", "1.0.0", true);
verifyUniteMetadata("2.0.0");
}
@@ -409,7 +391,7 @@ private slots:
{
ignoreMessagesForUniteMeta(false);
generateRepo(false, true, false);
- verifyComponentRepository("1.0.0", false);
+ verifyComponentRepository("1.0.0", "1.0.0", false);
initRepoUpdate();
ignoreMessageForCollectingPackages("2.0.0", "1.0.0");
@@ -418,7 +400,7 @@ private slots:
ignoreMessagesForCopyMetadata("B", false, true);
ignoreMessagesForUniteMeta(true);
generateRepo(false, true, false);
- verifyComponentRepository("2.0.0", false);
+ verifyComponentRepository("2.0.0", "1.0.0", false);
verifyUniteMetadata("2.0.0");
}
@@ -426,17 +408,47 @@ private slots:
{
ignoreMessagesForComponentSha(QStringList() << "A" << "B", false);
generateRepo(true, false, false);
- verifyComponentRepository("1.0.0", true);
+ verifyComponentRepository("1.0.0", "1.0.0", true);
- initRepoUpdateFromRepository(":///repository_component");
- ignoreMessageForCollectingRepository("repository_component");
+ initRepoUpdateFromRepositories(QStringList() << ":///repository_component");
+ ignoreMessageForCollectingRepository(QStringList() << "repository_component");
+ QTest::ignoreMessage(QtDebugMsg, "- it provides the package \"A\" - \"2.0.0\"");
QTest::ignoreMessage(QtDebugMsg, "- it provides the package \"B\" - \"1.0.0\"");
ignoreMessagesForCopyRepository("B", "1.0.0", "repository_component");
ignoreMessagesForCopyRepository("A", "2.0.0", "repository_component");
ignoreMessagesForComponentSha(QStringList() << "A" << "B", true);
generateRepo(true, false, false);
- verifyComponentRepository("2.0.0", true);
+ verifyComponentRepository("2.0.0", "1.0.0", true);
+ verifyComponentMetaUpdatesXml();
+ }
+
+ void testUpdateComponentsFromMultipleRepositories()
+ {
+ ignoreMessagesForComponentSha(QStringList() << "A" << "B", false);
+ generateRepo(true, false, false);
+ verifyComponentRepository("1.0.0", "1.0.0", true);
+
+ initRepoUpdateFromRepositories(QStringList() << ":///test_package_versions/repository_1"
+ << ":///test_package_versions/repository_2" << ":///test_package_versions/repository_3");
+
+ ignoreMessageForCollectingRepository(QStringList()
+ << "repository_1" << "repository_2" << "repository_3");
+
+ QTest::ignoreMessage(QtDebugMsg, "- it provides the package \"A\" - \"2.0.0\"");
+ QTest::ignoreMessage(QtDebugMsg, "- it provides the package \"B\" - \"1.0.0\"");
+
+ QTest::ignoreMessage(QtDebugMsg, "- it provides an old version of the package \"A\" - \"1.0.0\" - ignored");
+ QTest::ignoreMessage(QtDebugMsg, "- it provides an old version of the package \"B\" - \"1.0.0\" - ignored");
+
+ QTest::ignoreMessage(QtDebugMsg, "- it provides an old version of the package \"A\" - \"1.0.0\" - ignored");
+ QTest::ignoreMessage(QtDebugMsg, "- it provides a new version of the package \"B\" - \"3.0.0\" - replaced");
+
+ ignoreMessagesForCopyRepository("B", "3.0.0", "test_package_versions/repository_3");
+ ignoreMessagesForCopyRepository("A", "2.0.0", "test_package_versions/repository_1");
+ ignoreMessagesForComponentSha(QStringList() << "A" << "B", true);
+ generateRepo(true, false, false);
+ verifyComponentRepository("2.0.0", "3.0.0", true);
verifyComponentMetaUpdatesXml();
}
@@ -445,10 +457,11 @@ private slots:
ignoreMessagesForComponentSha(QStringList() << "A" << "B", false);
ignoreMessagesForUniteMeta(false);
generateRepo(true, true, false);
- verifyComponentRepository("1.0.0", true);
+ verifyComponentRepository("1.0.0", "1.0.0", true);
- initRepoUpdateFromRepository(":///repository_componentAndUnite");
- ignoreMessageForCollectingRepository("repository_componentAndUnite");
+ initRepoUpdateFromRepositories(QStringList() << ":///repository_componentAndUnite");
+ ignoreMessageForCollectingRepository(QStringList() << "repository_componentAndUnite");
+ QTest::ignoreMessage(QtDebugMsg, "- it provides the package \"A\" - \"2.0.0\"");
QTest::ignoreMessage(QtDebugMsg, "- it provides the package \"C\" - \"1.0.0\"");
ignoreMessageForUpdateComponent();
ignoreMessagesForCopyRepository("A", "2.0.0", "repository_componentAndUnite");
@@ -457,8 +470,8 @@ private slots:
ignoreMessagesForComponentSha(QStringList() << "A" << "C", true);
generateRepo(true, true, true);
- verifyComponentRepository("2.0.0", true);
- VerifyInstaller::verifyFileExistence(m_repositoryDir + "/C", QStringList() << "1.0.0content.7z" << "1.0.0content.7z.sha1" << "1.0.0meta.7z");
+ verifyComponentRepository("2.0.0", "1.0.0", true);
+ VerifyInstaller::verifyFileExistence(m_repoInfo.repositoryDir + "/C", QStringList() << "1.0.0content.7z" << "1.0.0content.7z.sha1" << "1.0.0meta.7z");
verifyUniteMetadata("2.0.0");
}
@@ -466,10 +479,11 @@ private slots:
{
ignoreMessagesForUniteMeta(false);
generateRepo(false, true, false);
- verifyComponentRepository("1.0.0", false);
+ verifyComponentRepository("1.0.0", "1.0.0", false);
- initRepoUpdateFromRepository(":///repository_unite");
- ignoreMessageForCollectingRepository("repository_unite");
+ initRepoUpdateFromRepositories(QStringList() << ":///repository_unite");
+ ignoreMessageForCollectingRepository(QStringList() << "repository_unite");
+ QTest::ignoreMessage(QtDebugMsg, "- it provides the package \"A\" - \"2.0.0\"");
QTest::ignoreMessage(QtDebugMsg, "- it provides the package \"C\" - \"1.0.0\"");
ignoreMessageForUpdateComponent();
ignoreMessagesForCopyRepository("A", "2.0.0", "repository_unite");
@@ -477,24 +491,21 @@ private slots:
ignoreMessagesForUniteMeta(true);
generateRepo(false, true, true);
- verifyComponentRepository("2.0.0", false);
- VerifyInstaller::verifyFileExistence(m_repositoryDir + "/C", QStringList() << "1.0.0content.7z" << "1.0.0content.7z.sha1");
+ verifyComponentRepository("2.0.0", "1.0.0", false);
+ VerifyInstaller::verifyFileExistence(m_repoInfo.repositoryDir + "/C", QStringList() << "1.0.0content.7z" << "1.0.0content.7z.sha1");
verifyUniteMetadata("2.0.0");
}
void cleanup()
{
m_tempDirDeleter.releaseAndDeleteAll();
- m_packagesDirectories.clear();
+ m_repoInfo.packages.clear();
m_packages.clear();
- m_repositoryDirectories.clear();
+ m_repoInfo.repositoryPackages.clear();
}
private:
- QString m_tmpMetaDir;
- QString m_repositoryDir;
- QStringList m_packagesDirectories;
- QStringList m_repositoryDirectories;
+ QInstallerTools::RepositoryInfo m_repoInfo;
QInstallerTools::PackageInfoVector m_packages;
TempDirDeleter m_tempDirDeleter;
};
diff --git a/tools/devtool/binarydump.cpp b/tools/devtool/binarydump.cpp
index bd8e9053c..bb0700149 100644
--- a/tools/devtool/binarydump.cpp
+++ b/tools/devtool/binarydump.cpp
@@ -117,10 +117,10 @@ int BinaryDump::dump(const QInstaller::ResourceCollectionManager &manager, const
if ((!isOpen) && (!resource->open()))
continue; // TODO: should we throw here?
- QFile target(targetDir.filePath(name) + QDir::separator()
+ QFile targetFile(targetDir.filePath(name) + QDir::separator()
+ QString::fromUtf8(resource->name()));
- QInstaller::openForWrite(&target);
- resource->copyData(&target); // copy the 7z files into the target directory
+ QInstaller::openForWrite(&targetFile);
+ resource->copyData(&targetFile); // copy the 7z files into the target directory
if (!isOpen) // If we reach that point, either the resource was opened already...
resource->close(); // or we did open it and have to close it again.
diff --git a/tools/devtool/main.cpp b/tools/devtool/main.cpp
index 52db7d8b3..8da6dfb75 100644
--- a/tools/devtool/main.cpp
+++ b/tools/devtool/main.cpp
@@ -182,31 +182,31 @@ int main(int argc, char *argv[])
quint64 cookie = QInstaller::BinaryContent::MagicCookie;
try {
{
- QFile tmp(path);
- QInstaller::openForRead(&tmp);
+ QFile tmpFile(path);
+ QInstaller::openForRead(&tmpFile);
- if (!tmp.seek(QInstaller::BinaryContent::findMagicCookie(&tmp, cookie) - sizeof(qint64)))
+ if (!tmpFile.seek(QInstaller::BinaryContent::findMagicCookie(&tmpFile, cookie) - sizeof(qint64)))
throw QInstaller::Error(QLatin1String("Cannot seek to read magic marker."));
QInstaller::BinaryLayout layout;
- layout.magicMarker = QInstaller::retrieveInt64(&tmp);
+ layout.magicMarker = QInstaller::retrieveInt64(&tmpFile);
if (layout.magicMarker == QInstaller::BinaryContent::MagicUninstallerMarker) {
- QFileInfo fi(path);
+ QFileInfo fileInfo(path);
- QInstaller::isInBundle(fi.absoluteFilePath(), &bundlePath);
- fi.setFile(bundlePath);
+ QInstaller::isInBundle(fileInfo.absoluteFilePath(), &bundlePath);
+ fileInfo.setFile(bundlePath);
- path = fi.absolutePath() + QLatin1Char('/') + fi.baseName() + QLatin1String(".dat");
+ path = fileInfo.absolutePath() + QLatin1Char('/') + fileInfo.baseName() + QLatin1String(".dat");
- tmp.close();
- tmp.setFileName(path);
- QInstaller::openForRead(&tmp);
+ tmpFile.close();
+ tmpFile.setFileName(path);
+ QInstaller::openForRead(&tmpFile);
cookie = QInstaller::BinaryContent::MagicCookieDat;
}
- layout = QInstaller::BinaryContent::binaryLayout(&tmp, cookie);
- tmp.close();
+ layout = QInstaller::BinaryContent::binaryLayout(&tmpFile, cookie);
+ tmpFile.close();
if (command == QLatin1String("update")) {
BinaryReplace br(layout); // To update the binary we do not need any mapping.
diff --git a/tools/repocompare/repositorymanager.cpp b/tools/repocompare/repositorymanager.cpp
index 3fb863eaf..e4405d103 100644
--- a/tools/repocompare/repositorymanager.cpp
+++ b/tools/repocompare/repositorymanager.cpp
@@ -120,6 +120,7 @@ void RepositoryManager::createRepositoryMap(const QByteArray &data, QMap<QString
currentDescription.updateText.clear();
currentDescription.version.clear();
currentDescription.checksum.clear();
+ currentDescription.update = false;
}
if (reader.name() == QLatin1String("SHA1"))
currentDescription.checksum = reader.readElementText();
diff --git a/tools/repogen/repogen.cpp b/tools/repogen/repogen.cpp
index a88867e92..b630f8cd3 100644
--- a/tools/repogen/repogen.cpp
+++ b/tools/repogen/repogen.cpp
@@ -44,8 +44,6 @@
#include <iostream>
-#define QUOTE_(x) #x
-#define QUOTE(x) QUOTE_(x)
using namespace QInstaller;
@@ -100,8 +98,8 @@ int main(int argc, char** argv)
QStringList filteredPackages;
bool updateExistingRepository = false;
- QStringList packagesDirectories;
- QStringList repositoryDirectories;
+ QInstallerTools::RepositoryInfo repoInfo;
+ QStringList packagesUpdatedWithSha;
QInstallerTools::FilterType filterType = QInstallerTools::Exclude;
bool remove = false;
bool updateExistingRepositoryWithNewComponents = false;
@@ -168,7 +166,7 @@ int main(int argc, char** argv)
"Error: Package directory is empty"));
}
- packagesDirectories.append(args.first());
+ repoInfo.packages.append(args.first());
args.removeFirst();
} else if (args.first() == QLatin1String("--repository")) {
args.removeFirst();
@@ -181,7 +179,7 @@ int main(int argc, char** argv)
return printErrorAndUsageAndExit(QCoreApplication::translate("QInstaller",
"Error: Only local filesystem repositories now supported"));
}
- repositoryDirectories.append(args.first());
+ repoInfo.repositoryPackages.append(args.first());
args.removeFirst();
} else if (args.first() == QLatin1String("--ignore-translations")
|| args.first() == QLatin1String("--ignore-invalid-packages")) {
@@ -195,14 +193,17 @@ int main(int argc, char** argv)
} else if (args.first() == QLatin1String("--component-metadata")) {
createUnifiedMetadata = false;
args.removeFirst();
- }
- else {
+ } else if (args.first() == QLatin1String("--sha-update") || args.first() == QLatin1String("-s")) {
+ args.removeFirst();
+ packagesUpdatedWithSha = args.first().split(QLatin1Char(','));
+ args.removeFirst();
+ } else {
printUsage();
return 1;
}
}
- if ((packagesDirectories.isEmpty() && repositoryDirectories.isEmpty()) || (args.count() != 1)) {
+ if ((repoInfo.packages.isEmpty() && repoInfo.repositoryPackages.isEmpty()) || (args.count() != 1)) {
printUsage();
return 1;
}
@@ -213,12 +214,12 @@ int main(int argc, char** argv)
"Argument -r|--remove and --update|--update-new-components are mutually exclusive!"));
}
- const QString repositoryDir = QInstallerTools::makePathAbsolute(args.first());
+ repoInfo.repositoryDir = QInstallerTools::makePathAbsolute(args.first());
if (remove)
- QInstaller::removeDirectory(repositoryDir);
+ QInstaller::removeDirectory(repoInfo.repositoryDir);
if (updateExistingRepositoryWithNewComponents) {
- QStringList meta7z = QDir(repositoryDir).entryList(QStringList()
+ QStringList meta7z = QDir(repoInfo.repositoryDir).entryList(QStringList()
<< QLatin1String("*_meta.7z"), QDir::Files);
if (!meta7z.isEmpty()) {
throw QInstaller::Error(QCoreApplication::translate("QInstaller",
@@ -228,72 +229,27 @@ int main(int argc, char** argv)
}
}
- if (!update && QFile::exists(repositoryDir) && !QDir(repositoryDir).entryList(
+ if (!update && QFile::exists(repoInfo.repositoryDir) && !QDir(repoInfo.repositoryDir).entryList(
QDir::AllEntries | QDir::NoDotAndDotDot).isEmpty()) {
throw QInstaller::Error(QCoreApplication::translate("QInstaller",
- "Repository target directory \"%1\" already exists.").arg(QDir::toNativeSeparators(repositoryDir)));
- }
-
- QInstallerTools::PackageInfoVector packages;
-
- QInstallerTools::PackageInfoVector precompressedPackages = QInstallerTools::createListOfRepositoryPackages(repositoryDirectories,
- &filteredPackages, filterType);
- packages.append(precompressedPackages);
-
- QInstallerTools::PackageInfoVector preparedPackages = QInstallerTools::createListOfPackages(packagesDirectories,
- &filteredPackages, filterType);
- packages.append(preparedPackages);
-
- if (updateExistingRepositoryWithNewComponents) {
- QInstallerTools::filterNewComponents(repositoryDir, packages);
- if (packages.isEmpty()) {
- std::cout << QString::fromLatin1("Cannot find new components to update \"%1\".")
- .arg(repositoryDir) << std::endl;
- return EXIT_SUCCESS;
- }
+ "Repository target directory \"%1\" already exists.").arg(QDir::toNativeSeparators(repoInfo.repositoryDir)));
}
- QHash<QString, QString> pathToVersionMapping = QInstallerTools::buildPathToVersionMapping(packages);
-
- foreach (const QInstallerTools::PackageInfo &package, packages) {
- const QFileInfo fi(repositoryDir, package.name);
- if (fi.exists())
- removeDirectory(fi.absoluteFilePath());
+ QInstallerTools::PackageInfoVector packages = QInstallerTools::collectPackages(repoInfo,
+ &filteredPackages, filterType, updateExistingRepositoryWithNewComponents, packagesUpdatedWithSha);
+ if (packages.isEmpty()) {
+ std::cout << QString::fromLatin1("Cannot find components to update \"%1\".")
+ .arg(repoInfo.repositoryDir) << std::endl;
+ return EXIT_SUCCESS;
}
QTemporaryDir tmp;
tmp.setAutoRemove(false);
tmpMetaDir = tmp.path();
- QStringList directories;
- directories.append(packagesDirectories);
- directories.append(repositoryDirectories);
- QStringList unite7zFiles;
- foreach (const QString &repositoryDirectory, repositoryDirectories) {
- QDirIterator it(repositoryDirectory, QStringList(QLatin1String("*_meta.7z"))
- , QDir::Files | QDir::CaseSensitive);
- while (it.hasNext()) {
- it.next();
- unite7zFiles.append(it.fileInfo().absoluteFilePath());
- }
- }
- QInstallerTools::copyComponentData(directories, repositoryDir, &packages);
- QInstallerTools::copyMetaData(tmpMetaDir, repositoryDir, packages, QLatin1String("{AnyApplication}"),
- QLatin1String(QUOTE(IFW_REPOSITORY_FORMAT_VERSION)), unite7zFiles);
-
- QString existing7z = QInstallerTools::existingUniteMeta7z(repositoryDir);
- if (!existing7z.isEmpty())
- existing7z = repositoryDir + QDir::separator() + existing7z;
- QInstallerTools::compressMetaDirectories(tmpMetaDir, existing7z, pathToVersionMapping,
- createComponentMetadata, createUnifiedMetadata);
-
- QDirIterator it(repositoryDir, QStringList(QLatin1String("Updates*.xml"))
- << QLatin1String("*_meta.7z"), QDir::Files | QDir::CaseSensitive);
- while (it.hasNext()) {
- it.next();
- QFile::remove(it.fileInfo().absoluteFilePath());
- }
- QInstaller::moveDirectoryContents(tmpMetaDir, repositoryDir);
+ QInstallerTools::createRepository(repoInfo, &packages, tmpMetaDir,
+ createComponentMetadata, createUnifiedMetadata);
+
exitCode = EXIT_SUCCESS;
} catch (const Lib7z::SevenZipException &e) {
std::cerr << "Caught 7zip exception: " << e.message() << std::endl;