]> code.ossystems Code Review - openembedded-core.git/commit
recipetool: create: ensure meaningful error for malformed tarballs
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Thu, 20 Jul 2017 14:48:09 +0000 (16:48 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 21 Jul 2017 07:44:18 +0000 (08:44 +0100)
commit8496113b63d5a5d1f99056610c0fdb972a6200d4
tree9f9ac01cc0cd6748380163c46d3e6d9489c10eb9
parent5c7f5031023fb74b5f2f26d6b3c829981f2f54d2
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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/recipetool/create.py