summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKatja Marttila <katja.marttila@qt.io>2017-06-14 11:51:49 +0300
committerKatja Marttila <katja.marttila@qt.io>2017-06-20 04:32:15 +0000
commita9544c7b6e7d5ff376d973c685f6da7eec9e0411 (patch)
tree4501dfc42c4ea863b92d4d9f1144a74c74b25eb9
parent13dced124a3df277a297c1b3fccf0b11f3a98eba (diff)
Fix install fail if there are missing repositories
If any of the repositories was not found or had unparsable Updates.xml, install failed although there was other valid repositories. Fixed so that warning is printed when such repositories found but continue install if there are other valid repositories. Change-Id: I04fe8d91382a3ea97ce22cd64159a6a7d825128d Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
-rw-r--r--src/libs/installer/metadatajob.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libs/installer/metadatajob.cpp b/src/libs/installer/metadatajob.cpp
index ac69bff9b..0c674e313 100644
--- a/src/libs/installer/metadatajob.cpp
+++ b/src/libs/installer/metadatajob.cpp
@@ -457,10 +457,11 @@ MetadataJob::Status MetadataJob::parseUpdatesXml(const QList<FileTaskResult> &re
if (error() != Job::NoError)
return XmlDownloadFailure;
- //If repository is not found, target is empty. Do not continue using the repository
- //and do not prevent further repositories usage.
- if (result.target().isEmpty())
+ //If repository is not found, target might be empty. Do not continue parsing the
+ //repository and do not prevent further repositories usage.
+ if (result.target().isEmpty()) {
continue;
+ }
Metadata metadata;
QTemporaryDir tmp(QDir::tempPath() + QLatin1String("/remoterepo-XXXXXX"));
if (!tmp.isValid()) {
@@ -488,7 +489,8 @@ MetadataJob::Status MetadataJob::parseUpdatesXml(const QList<FileTaskResult> &re
if (!doc.setContent(&file, &error)) {
qDebug().nospace() << "Cannot fetch a valid version of Updates.xml from repository "
<< metadata.repository.displayname() << ": " << error;
- return XmlDownloadFailure;
+ //If there are other repositories, try to use those
+ continue;
}
file.close();