summaryrefslogtreecommitdiffstats
path: root/src/libs/ifwtools/repositorygen.cpp
diff options
context:
space:
mode:
authorArttu Tarkiainen <arttu.tarkiainen@qt.io>2020-12-01 13:00:15 +0200
committerArttu Tarkiainen <arttu.tarkiainen@qt.io>2021-01-15 09:27:07 +0200
commit20f354b38b83e4aab107b388fe3c5e2ccd878946 (patch)
tree9da138aca91abdd931eb9fb4c74ffb35dddc7377 /src/libs/ifwtools/repositorygen.cpp
parentf61c19eb81dc692b9c5215f5bf94f3426b0f4f86 (diff)
Add support for generating offline installer from online
Task-number: QTIFW-1945 Change-Id: Ic8a076a28385e99ad09cfbccd07c7012d6570639 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'src/libs/ifwtools/repositorygen.cpp')
-rw-r--r--src/libs/ifwtools/repositorygen.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/libs/ifwtools/repositorygen.cpp b/src/libs/ifwtools/repositorygen.cpp
index e30234f52..fbcf7b9f3 100644
--- a/src/libs/ifwtools/repositorygen.cpp
+++ b/src/libs/ifwtools/repositorygen.cpp
@@ -609,12 +609,19 @@ PackageInfoVector QInstallerTools::createListOfRepositoryPackages(const QStringL
if (!hasUnifiedMetaFile) {
const QDomElement sha1 = el.firstChildElement(QInstaller::scSHA1);
if (!sha1.isNull()) {
+ // 1. First, try with normal repository structure
QString metaFile = QString::fromLatin1("%1/%3%2").arg(info.directory,
QString::fromLatin1("meta.7z"), info.version);
if (!QFileInfo(metaFile).exists()) {
- throw QInstaller::Error(QString::fromLatin1("Could not find meta archive for component "
- "%1 %2 in repository %3.").arg(info.name, info.version, it->filePath()));
+ // 2. If that does not work, check for fetched temporary repository structure
+ metaFile = QString::fromLatin1("%1/%2-%3-%4").arg(it->filePath(),
+ info.name, info.version, QString::fromLatin1("meta.7z"));
+
+ if (!QFileInfo(metaFile).exists()) {
+ throw QInstaller::Error(QString::fromLatin1("Could not find meta archive for component "
+ "%1 %2 in repository %3.").arg(info.name, info.version, it->filePath()));
+ }
}
info.metaFile = metaFile;
}