From: Ross Burton Date: Thu, 15 Jun 2017 16:48:58 +0000 (+0100) Subject: bin_package: fail if ${S} doesn't actually contain anything X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~19444 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf5627ddbe5371eba62f73c33735fb1cf35c2194;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git bin_package: fail if ${S} doesn't actually contain anything If the user is trying to use bin_package but the SRC_URI hasn't extracted anything into ${S}, which is easily done when writing a recipe by hand, instead of silently shippping an empty package abort the build. Signed-off-by: Ross Burton --- diff --git a/meta/classes/bin_package.bbclass b/meta/classes/bin_package.bbclass index a52b75be5c0..cbc9b1fa131 100644 --- a/meta/classes/bin_package.bbclass +++ b/meta/classes/bin_package.bbclass @@ -26,7 +26,10 @@ do_compile[noexec] = "1" bin_package_do_install () { # Do it carefully [ -d "${S}" ] || exit 1 - cd ${S} || exit 1 + if [ -z "$(ls -A ${S})" ]; then + bbfatal bin_package has nothing to install. Be sure the SRC_URI unpacks into S. + fi + cd ${S} tar --no-same-owner --exclude='./patches' --exclude='./.pc' -cpf - . \ | tar --no-same-owner -xpf - -C ${D} }