summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKatja Marttila <katja.marttila@qt.io>2017-02-20 14:09:10 +0200
committerKatja Marttila <katja.marttila@qt.io>2017-02-21 09:46:28 +0000
commit9735faf767f805560855e3ea3a9908f901e63891 (patch)
tree4f853ae99687bfff0e1a5d1841e5a72ffc5c3698
parentc9d11cc9915dea32d1aff9d63427bca1c3399400 (diff)
Do not fail to install or update if repository is missing2.0.5
If repository address becomes invalid or is deleted from the server, update or install fails if installer points to a removed repository. However, Updates.xml might have RepositoryUpdate with action 'remove'. If we prevent updating when one of the repositories is not found we never get to perform the 'remove' action to repository which makes the whole 'remove' action unusable. This commit changes the behavior so that warning is printed when repository is not found but it does not prevent the install or update if there are other valid repositories. Change-Id: Ic75b2e09542e304e09af87c7039798120f58d844 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
-rw-r--r--Changelog1
-rw-r--r--src/libs/installer/downloadfiletask.cpp14
2 files changed, 12 insertions, 3 deletions
diff --git a/Changelog b/Changelog
index fd4ad6aa1..526533c98 100644
--- a/Changelog
+++ b/Changelog
@@ -2,6 +2,7 @@
- Fix hang in Windows when admin rights needed. (QTIFW-902)
- Use deterministic sorting order for components. (QTIFW-833)
- Resolve relative URLs from Updates.xml.
+- Do not fail to install or update if repository is missing
2.0.4
- Set also display name for Repository action "remove"
diff --git a/src/libs/installer/downloadfiletask.cpp b/src/libs/installer/downloadfiletask.cpp
index 22212c617..9a065853f 100644
--- a/src/libs/installer/downloadfiletask.cpp
+++ b/src/libs/installer/downloadfiletask.cpp
@@ -248,10 +248,18 @@ void Downloader::onError(QNetworkReply::NetworkError error)
if (reply) {
const Data &data = *m_downloads[reply];
+ //Do not throw error if Updates.xml not found. The repository might be removed
+ //with RepositoryUpdate in Updates.xml later.
+ if (data.taskItem.source().contains(QLatin1String("Updates.xml"), Qt::CaseInsensitive)) {
+ qDebug() << QString::fromLatin1("Network error while downloading '%1': %2.").arg(
+ data.taskItem.source(), reply->errorString());
+ } else {
+ m_futureInterface->reportException(
+ TaskException(tr("Network error while downloading '%1': %2.").arg(
+ data.taskItem.source(), reply->errorString())));
+ }
//: %2 is a sentence describing the error
- m_futureInterface->reportException(
- TaskException(tr("Network error while downloading '%1': %2.").arg(
- data.taskItem.source(), reply->errorString())));
+
} else {
//: %1 is a sentence describing the error
m_futureInterface->reportException(