pmb.helpers.repo.download: proper error for 404
Flush the progress bar displayed by the function before logging a warning message for 404 not found responses from the server. Without flushing, this message gets lost.
In addition to the warning, display a NOTE and ERROR at the end to explain what went wrong:
[20:16:50] Update package index for x86_64 (4 file(s))
[20:16:51] WARNING: file not found: http://mirror.postmarketos.org/postmarketos_get_404_test/edge/main/x86_64/APKINDEX.tar.gz
[20:16:51] NOTE: check the [mirrors] section in 'pmbootstrap config'
[20:16:51] ERROR: getting APKINDEX from binary package mirror failed!
Without handling this properly, pmbootstrap would fail slightly later with a much less useful error:
[15:14:28] ERROR: expected str, bytes or os.PathLike object, not NoneType
Fixes: #2424 (closed)
Edited by Oliver Smith