From 7d4a76cef36a229b3a3ffae7972a64f5ed499873 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 | 6 +++--- 2 files changed, 7 insertions(+), 11 deletions(-) (limited to 'classes') diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index 0acc786..9ecaaa1 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass @@ -113,8 +113,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 f677491..04f9851 100644 --- a/classes/image_types_ota.bbclass +++ b/classes/image_types_ota.bbclass @@ -40,7 +40,7 @@ calculate_size () { return -1 fi fi - + echo "${SIZE}" } @@ -79,8 +79,8 @@ IMAGE_CMD_otaimg () { elif [ "${OSTREE_BOOTLOADER}" = "u-boot" ]; then touch ${PHYS_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