download: handle possibly invalid local tarballs
authorPetr Štetiar <ynezz@true.cz>
Thu, 19 Nov 2020 15:32:46 +0000 (16:32 +0100)
committerRISCi_ATOM <bob@bobcall.me>
Sun, 6 Dec 2020 06:35:52 +0000 (01:35 -0500)
commit68ef46d836637a07e01255aeb54303c2ecd8f981
tree0ac647dd08a84f2231791151daef3989f1ac246f
parente04c69fc1f70245b566bd6725828341d1020459e
download: handle possibly invalid local tarballs

Currently it's assumed, that already downloaded tarballs are always
fine, so no checksum checking is performed and the tarball is used even
if it might be corrupted.

From now on, we're going to always check the downloaded tarballs before
considering them valid.

Steps to reproduce:

 1. Remove cached tarball

   rm dl/libubox-2020-08-06-9e52171d.tar.xz

 2. Download valid tarball again

   make package/libubox/download

 3. Invalidate the tarball

   sed -i 's/PKG_MIRROR_HASH:=../PKG_MIRROR_HASH:=ff/' package/libs/libubox/Makefile

 4. Now compile with corrupt tarball source

   make package/libubox/{clean,compile}

Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 4e19cbc553350b8146985367ba46514cf50e3393)
include/host-build.mk
include/package.mk
scripts/download.pl