summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArttu Tarkiainen <arttu.tarkiainen@qt.io>2022-03-25 14:45:30 +0200
committerArttu Tarkiainen <arttu.tarkiainen@qt.io>2022-03-31 13:52:00 +0200
commitdcc773f8603d65cddd36ae725022326a1065ac9a (patch)
treefa979f2c94d9c0cba6e68232d33f7c3c85b9be21
parentaeea613f41f3e7dd64335e734e921f4992067dd6 (diff)
Repogen: allow usage of --update-new-components with unified metadata
I couldn't find a reason why this combination wouldn't work. If there are no known issues the option should be allowed. Task-number: QTIFW-2558 Change-Id: I9bceddc70e3ea4edeb1af2fe873f96bf815900d3 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
-rw-r--r--tests/auto/tools/repotest/tst_repotest.cpp40
-rw-r--r--tools/repogen/repogen.cpp14
2 files changed, 40 insertions, 14 deletions
diff --git a/tests/auto/tools/repotest/tst_repotest.cpp b/tests/auto/tools/repotest/tst_repotest.cpp
index 0fb6f9cd3..f27acfe89 100644
--- a/tests/auto/tools/repotest/tst_repotest.cpp
+++ b/tests/auto/tools/repotest/tst_repotest.cpp
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** Copyright (C) 2021 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -359,6 +359,44 @@ private slots:
verifyComponentMetaUpdatesXml();
}
+ void testUpdateNewComponentsWithUniteMetadata()
+ {
+ ignoreMessagesForComponentSha(QStringList() << "A" << "B", false);
+ ignoreMessagesForUniteMeta(false);
+ generateRepo(true, true, false);
+ verifyComponentRepository("1.0.0", "1.0.0", true);
+
+ initRepoUpdate();
+ ignoreMessageForCollectingPackages("2.0.0", "1.0.0");
+ ignoreMessagesForComponentSha(QStringList() << "A", false); //Only A has update
+ ignoreMessagesForComponentHash(QStringList() << "A");
+ ignoreMessagesForCopyMetadata("A", true, true);
+ ignoreMessagesForUniteMeta(true);
+ const QString &message = "Update component \"A\" in \"%1\" .";
+ QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(m_repoInfo.repositoryDir)));
+ generateRepo(true, true, true);
+ verifyComponentRepository("2.0.0", "1.0.0", true);
+ verifyUniteMetadata("2.0.0");
+ }
+
+ void testUpdateNewComponentsWithOnlyUniteMetadata()
+ {
+ ignoreMessagesForUniteMeta(false);
+ generateRepo(false, true, false);
+ verifyComponentRepository("1.0.0", "1.0.0", false);
+
+ initRepoUpdate();
+ ignoreMessageForCollectingPackages("2.0.0", "1.0.0");
+ ignoreMessagesForComponentHash(QStringList() << "A");
+ ignoreMessagesForCopyMetadata("A", true, true);
+ ignoreMessagesForUniteMeta(true);
+ const QString &message = "Update component \"A\" in \"%1\" .";
+ QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(m_repoInfo.repositoryDir)));
+ generateRepo(false, true, true);
+ verifyComponentRepository("2.0.0", "1.0.0", false);
+ verifyUniteMetadata("2.0.0");
+ }
+
void testUpdateComponents()
{
ignoreMessagesForComponentSha(QStringList() << "A" << "B", false);
diff --git a/tools/repogen/repogen.cpp b/tools/repogen/repogen.cpp
index 13c763866..a8720a0de 100644
--- a/tools/repogen/repogen.cpp
+++ b/tools/repogen/repogen.cpp
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** Copyright (C) 2021 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -160,7 +160,6 @@ int main(int argc, char** argv)
} else if (args.first() == QLatin1String("--update-new-components")) {
args.removeFirst();
updateExistingRepositoryWithNewComponents = true;
- createUnifiedMetadata = false;
} else if (args.first() == QLatin1String("-p") || args.first() == QLatin1String("--packages")) {
args.removeFirst();
if (args.isEmpty()) {
@@ -253,17 +252,6 @@ int main(int argc, char** argv)
if (remove)
QInstaller::removeDirectory(repoInfo.repositoryDir);
- if (updateExistingRepositoryWithNewComponents) {
- QStringList meta7z = QDir(repoInfo.repositoryDir).entryList(QStringList()
- << QLatin1String("*_meta.7z"), QDir::Files);
- if (!meta7z.isEmpty()) {
- throw QInstaller::Error(QCoreApplication::translate("QInstaller",
- "Cannot update \"%1\" with --update-new-components. Use --update instead. "
- "Currently it is not possible to update partial components inside one 7z.")
- .arg(meta7z.join(QLatin1Char(','))));
- }
- }
-
if (!update && QFile::exists(repoInfo.repositoryDir) && !QDir(repoInfo.repositoryDir).entryList(
QDir::AllEntries | QDir::NoDotAndDotDot).isEmpty()) {