depot_download_manager: fix verifying failed download

In some instances, the fetchurl progress determined by
depot_download_manager will be empty when the download fails (e.g. due
to a 404), this commit fixes a bug where this would be interpreted as
the download having completed which would subsequently start hash
verification of a package that has never actually been downloaded.

Fixes #4919
This commit is contained in:
Timo Nicolai 2023-06-09 15:30:41 +02:00 committed by Norman Feske
parent c09b4ba46b
commit 0a81bd5d5a

View File

@ -44,6 +44,10 @@ class Depot_download_manager::Import
bool complete() const bool complete() const
{ {
/* fetchurl did not return valid download info */
if (total == "")
return false;
/* fetchurl has not yet determined the file size */ /* fetchurl has not yet determined the file size */
if (total == "0.0") if (total == "0.0")
return false; return false;