Fix issues with the updater

* Bad URLs used for downloading update files
* MD5ETagDownload resetting the expected ETag after failure to the failed file MD5 checksum
* Delete MD5ETagDownload downloaded files if the download fails.
This commit is contained in:
Petr Mrázek
2013-12-21 14:25:16 +01:00
parent 0f6ad12fd8
commit 01dbebdfc8
3 changed files with 37 additions and 20 deletions

View File

@ -396,7 +396,6 @@ DownloadUpdateTask::processFileLists(NetJob *job,
// We need to download the file to the updatefiles folder and add a task
// to copy it to its install path.
auto download = MD5EtagDownload::make(source.url, dlPath);
download->m_check_md5 = true;
download->m_expected_md5 = entry.md5;
job->addNetAction(download);
}
@ -487,9 +486,13 @@ bool DownloadUpdateTask::writeInstallScript(UpdateOperationList &opsList, QStrin
QString DownloadUpdateTask::preparePath(const QString &path)
{
QString foo = path;
foo.replace("$PWD", qApp->applicationDirPath());
return QUrl::fromLocalFile(foo).toString(QUrl::FullyEncoded);
if(path.startsWith("$PWD"))
{
QString foo = path;
foo.replace("$PWD", qApp->applicationDirPath());
return QUrl::fromLocalFile(foo).toString(QUrl::FullyEncoded);
}
return path;
}
void DownloadUpdateTask::fileDownloadFinished()