From e1da0efcd2eece82b0326798cfeaeb8dd48797fc Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Thu, 1 Oct 2020 15:54:53 -0400 Subject: meta-app-framework: Handle html5 apps not having debug widgets The previous aglwgt.bbclass change to make build/package errors fatal now trips up on the HTML5 applications, as they do not produce a debug widget, and the logic changes assumed that all widget builds would have one. To handle this, if there is no debug widget present when doing do_install, check the config.xml file in the release widget and do not throw an error if the widget type is "text/html". Bug-AGL: SPEC-3593 Signed-off-by: Scott Murray Change-Id: If58c3065464d2d2ea3d78b8ce31304d00fae6504 Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl/+/25368 Tested-by: Jenkins Job builder account ci-image-build: Jenkins Job builder account ci-image-boot-test: Jenkins Job builder account Reviewed-by: Jan-Simon Moeller --- meta-app-framework/classes/aglwgt.bbclass | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'meta-app-framework/classes') diff --git a/meta-app-framework/classes/aglwgt.bbclass b/meta-app-framework/classes/aglwgt.bbclass index bdd38f6f1..00d3f9744 100644 --- a/meta-app-framework/classes/aglwgt.bbclass +++ b/meta-app-framework/classes/aglwgt.bbclass @@ -114,19 +114,30 @@ aglwgt_do_install() { DEST=manualinstall fi - if [ "$(find ${B}/build-release -name '*.wgt' -maxdepth 1)" ]; then + wgt="$(find ${B}/build-release -maxdepth 1 -name '*.wgt'| head -n 1)" + if [ -n "$wgt" ]; then install -d ${D}/usr/AGL/apps/$DEST - install -m 0644 ${B}/build-release/*.wgt ${D}/usr/AGL/apps/$DEST/ + install -m 0644 $wgt ${D}/usr/AGL/apps/$DEST/ else bbfatal "no package found in widget directory" fi for t in debug coverage test; do - if [ "$(find ${B}/build-${t} -name *-${t}.wgt -maxdepth 1)" ]; then + if [ "$(find ${B}/build-${t} -maxdepth 1 -name *-${t}.wgt)" ]; then install -d ${D}/usr/AGL/apps/${t} install -m 0644 ${B}/build-${t}/*-${t}.wgt ${D}/usr/AGL/apps/${t}/ elif [ "$t" = "debug" ]; then - bbfatal "no package found in ${t} widget directory" + # HTML5 widgets complicate things here, need to detect them and + # not error out in that case. ATM this requires looking in the + # config.xml of the release widget. + rm -rf ${B}/tmp + unzip $wgt config.xml -d ${B}/tmp + if [ -f ${B}/tmp/config.xml -a \ + ! cat ${B}/tmp/config.xml | \ + grep -q '^[[:space:]]*