[oe-commits] [openembedded-core] 47/63: kernel-yocto: explicitly trap subcommand errors

git at git.openembedded.org git at git.openembedded.org
Tue Dec 13 22:57:05 UTC 2016


rpurdie pushed a commit to branch master
in repository openembedded-core.

commit a4705e62d0973c290011fc0d250501d358b659e8
Author: Bruce Ashfield <bruce.ashfield at windriver.com>
AuthorDate: Fri Dec 9 14:28:00 2016 -0500

    kernel-yocto: explicitly trap subcommand errors
    
    To trap errors and halt processing, do_kernel_metadata was recently
    switched to exit on any non zero return code. While the concept is
    sound, there are subcommands that have legitimate non-zero return
    codes.
    
    Instead of removing set +e, we'll explicitly check the return code
    of the commands that can error, and throw a bbfatal to alert the
    user.
    
    Signed-off-by: Bruce Ashfield <bruce.ashfield at windriver.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/classes/kernel-yocto.bbclass | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index 7c32c96..a60327a 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -61,6 +61,7 @@ def get_machine_branch(d, default):
     return default
 
 do_kernel_metadata() {
+	set +e
 	cd ${S}
 	export KMETA=${KMETA}
 
@@ -148,12 +149,18 @@ do_kernel_metadata() {
 	elements="`echo -n ${bsp_definition} ${sccs} ${patches} ${KERNEL_FEATURES}`"
 	if [ -n "${elements}" ]; then
 		scc --force -o ${S}/${meta_dir}:cfg,meta ${includes} ${bsp_definition} ${sccs} ${patches} ${KERNEL_FEATURES}
+		if [ $? -ne 0 ]; then
+			bbfatal_log "Could not generate configuration queue for ${KMACHINE}."
+		fi
 	fi
 
 	# run2: only generate patches for elements that have been passed on the SRC_URI
 	elements="`echo -n ${sccs} ${patches} ${KERNEL_FEATURES}`"
 	if [ -n "${elements}" ]; then
 		scc --force -o ${S}/${meta_dir}:patch --cmds patch ${includes} ${sccs} ${patches} ${KERNEL_FEATURES}
+		if [ $? -ne 0 ]; then
+			bbfatal_log "Could not generate configuration queue for ${KMACHINE}."
+		fi
 	fi
 }
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list