]> code.ossystems Code Review - openembedded-core.git/commitdiff
bin_package: fail if ${S} doesn't actually contain anything
authorRoss Burton <ross.burton@intel.com>
Thu, 15 Jun 2017 16:48:58 +0000 (17:48 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 2 Dec 2017 11:24:35 +0000 (11:24 +0000)
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>
meta/classes/bin_package.bbclass

index a52b75be5c00d175c437780721890420cc4ba61f..cbc9b1fa13114462aded565b34af38c7b509c2ba 100644 (file)
@@ -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}
 }