]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commit
recipetool: create: ensure meaningful error for malformed tarballs
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Wed, 19 Jul 2017 10:07:17 +0000 (12:07 +0200)
committerPaul Eggleton <paul.eggleton@linux.intel.com>
Thu, 20 Jul 2017 14:35:47 +0000 (16:35 +0200)
commitb9b65e8c79ac27cf8bd7cf1ae155f632e6d72ec8
tree5a927abd5b679fce83104841a64a8455966d4837
parent3535b61b9a52aaa7d626252de8504c3378a6d0d7
recipetool: create: ensure meaningful error for malformed tarballs

If you pointed recipetool at a URL that should be a tarball e.g.
https://tls.mbed.org/download/start/mbedtls-2.4.2-apache.tgz but instead
it returns an HTML page, we try to unpack it, gzip complains but the
operation doesn't seem to fail - instead we just get back an empty
source tree. Change the checks to account for this - if the source tree
is empty, check if the downloaded file in DL_DIR looks like an HTML file
and error accordingly if it is. If it's not, error out anyway because
no source was unpacked and it should have been (otherwise we just
blindly set up EXTERNALSRC for this which is pointless).

Fixes an aspect of [YOCTO #11407].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
scripts/lib/recipetool/create.py