aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2017-06-15 17:48:58 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-12-02 11:24:35 +0000
commitbf5627ddbe5371eba62f73c33735fb1cf35c2194 (patch)
treef9b88389e6ed360e99de67f11e34815da9ebb2ef
parentec00c2eb893b1755f9fdf89d0c74dc0e0bc3cf01 (diff)
downloadopenembedded-core-contrib-bf5627ddbe5371eba62f73c33735fb1cf35c2194.tar.gz
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 <ross.burton@intel.com>
-rw-r--r--meta/classes/bin_package.bbclass5
1 files changed, 4 insertions, 1 deletions
diff --git a/meta/classes/bin_package.bbclass b/meta/classes/bin_package.bbclass
index a52b75be5c..cbc9b1fa13 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}
}