From 59b2228fcd2cc1203be6022951c90082bd1e7dce Mon Sep 17 00:00:00 2001 From: Ian Leonard Date: Sat, 3 Nov 2018 23:57:34 +0000 Subject: [PATCH] buildsystem: replace printf with echo where able Signed-off-by: Ian Leonard --- config/functions | 3 +-- scripts/create_addon | 15 +++++++-------- scripts/install | 9 +++------ 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/config/functions b/config/functions index 9dca01adf5..0c6cfb6523 100644 --- a/config/functions +++ b/config/functions @@ -934,8 +934,7 @@ install_addon_files() { install_driver_addon_files() { if [ "$#" -eq 0 ] ; then - printf "$(print_color CLR_ERROR "no module search path defined")\n" - die + die "$(print_color CLR_ERROR "no module search path defined")" fi PKG_MODULE_DIR="$INSTALL/$(get_full_module_dir $PKG_ADDON_ID)/updates/$PKG_ADDON_ID" diff --git a/scripts/create_addon b/scripts/create_addon index d8cbb15af2..fd99cbe293 100755 --- a/scripts/create_addon +++ b/scripts/create_addon @@ -93,9 +93,9 @@ function find_addons() { # abort when nothing found and not embedded if [ $? -ne 0 ]; then - printf "$(print_color CLR_ERROR "ERROR: '$1' matches nothing...")\n" ' '>&$SILENT_OUT - printf "for more informations type: ./scripts/create_addon --help\n" ' '>&$SILENT_OUT - exit 1 + echo "$(print_color CLR_ERROR "ERROR: '$1' matches nothing...")" >&$SILENT_OUT + echo "for more informations type: ./scripts/create_addon --help" >&$SILENT_OUT + die fi fi @@ -297,13 +297,13 @@ for addon in $(tr " " "\n" <<< $addons | sort -u); do fi # build package - printf "$(print_color CLR_BUILD "CREATE ADDON $addon") (${DEVICE:-$PROJECT}/$TARGET_ARCH)\n" ' '>&$SILENT_OUT + echo "$(print_color CLR_BUILD "CREATE ADDON $addon") (${DEVICE:-$PROJECT}/$TARGET_ARCH)" >&$SILENT_OUT _count+='x' ( build_addon $addon ) \ 2>&1 | tee $log_file if [ ${PIPESTATUS[0]} != 0 ]; then addons_failed+="$addon " - printf "$(print_color CLR_ERROR "ADDON FAILED $addon")\n" ' '>&$SILENT_OUT + echo "$(print_color CLR_ERROR "ADDON FAILED $addon")" >&$SILENT_OUT echo "failed: ${addon}" >> $summary_file else if [ "$remove_success_logs" = "true" ]; then @@ -321,10 +321,9 @@ fi # print summary if [ "$_count" != 'x' ]; then if [ -z "$addons_failed" ]; then - printf "$(print_color CLR_INFO "ALL ADDONS BUILDS SUCCESSFUL")\n" + echo "$(print_color CLR_INFO "ALL ADDONS BUILDS SUCCESSFUL")" exit 0 else - printf "$(print_color CLR_ERROR "FAILED ADDONS: $addons_failed")\n" - exit 1 + die "$(print_color CLR_ERROR "FAILED ADDONS: $addons_failed")" fi fi diff --git a/scripts/install b/scripts/install index 595e78d8e0..db97156d1e 100755 --- a/scripts/install +++ b/scripts/install @@ -8,13 +8,11 @@ . config/options $1 if [ -z "$1" ]; then - echo "usage: $0 package_name" - exit 1 + die "usage: $0 package_name" fi if [ -z "$INSTALL" ] ; then - echo "error: '\$INSTALL' not set! this script is not intended to be run manually" - exit 1 + die "error: '\$INSTALL' not set! this script is not intended to be run manually" fi # set defaults @@ -38,8 +36,7 @@ if [ -n "$PKG_ARCH" ]; then fi if [ ! -f $PKG_DIR/package.mk ]; then - printf "$(print_color CLR_ERROR "${PACKAGE_NAME}: no package.mk file found")\n" - exit 1 + die "$(print_color CLR_ERROR "${PACKAGE_NAME}: no package.mk file found")" fi $SCRIPTS/build $@