From c72d82867d4dd7e2dddaea24e1e56b2349f1af03 Mon Sep 17 00:00:00 2001 From: Ming Liu Date: Sun, 11 Nov 2018 11:53:01 +0100 Subject: meta: replace bberror with bbfatal When calling bbfatal, it reports error message and exit 1, it should be used to replace of 'bberror && exit 1' to avoid being redundant. Also fixed some incorrect bberror usages and typos. Signed-off-by: Ming Liu --- classes/image_types_ostree.bbclass | 12 ++++-------- classes/image_types_ota.bbclass | 4 ++-- 2 files changed, 6 insertions(+), 10 deletions(-) (limited to 'classes') diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index 05c73ff..ec2de9f 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass @@ -112,8 +112,7 @@ IMAGE_CMD_ostree () { if [ -d root ] && [ ! -L root ]; then if [ "$(ls -A root)" ]; then - bberror "Data in /root directory is not preserved by OSTree." - exit 1 + bbfatal "Data in /root directory is not preserved by OSTree." fi if [ -n "$SYSTEMD_USED" ]; then @@ -197,11 +196,9 @@ IMAGE_CMD_garagesign () { java_version=$( java -version 2>&1 | awk -F '"' '/version/ {print $2}' ) if [ "${java_version}" = "" ]; then - bberror "Java is required for synchronization with update backend, but is not installed on the host machine" - exit 1 + bbfatal "Java is required for synchronization with update backend, but is not installed on the host machine" elif [ "${java_version}" \< "1.8" ]; then - bberror "Java version >= 8 is required for synchronization with update backend" - exit 1 + bbfatal "Java version >= 8 is required for synchronization with update backend" fi rm -rf ${GARAGE_SIGN_REPO} @@ -252,8 +249,7 @@ IMAGE_CMD_garagesign () { rm -rf ${GARAGE_SIGN_REPO} if [ "$push_success" -ne "1" ]; then - bberror "Couldn't push to garage repository" - exit 1 + bbfatal "Couldn't push to garage repository" fi fi } diff --git a/classes/image_types_ota.bbclass b/classes/image_types_ota.bbclass index 03fe8d8..790ac31 100644 --- a/classes/image_types_ota.bbclass +++ b/classes/image_types_ota.bbclass @@ -82,8 +82,8 @@ fakeroot do_otasetup () { elif [ "${OSTREE_BOOTLOADER}" = "u-boot" ]; then touch ${OTA_SYSROOT}/boot/loader/uEnv.txt else - bberror "Invalid bootloader: ${OSTREE_BOOTLOADER}" - fi; + bbfatal "Invalid bootloader: ${OSTREE_BOOTLOADER}" + fi ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}) -- cgit v1.2.3-54-g00ecf