buildsystem: replace printf with echo where able

Signed-off-by: Ian Leonard <antonlacon@gmail.com>
This commit is contained in:
Ian Leonard 2018-11-03 23:57:34 +00:00
parent acca8326ce
commit 59b2228fcd
3 changed files with 11 additions and 16 deletions

View File

@ -934,8 +934,7 @@ install_addon_files() {
install_driver_addon_files() { install_driver_addon_files() {
if [ "$#" -eq 0 ] ; then if [ "$#" -eq 0 ] ; then
printf "$(print_color CLR_ERROR "no module search path defined")\n" die "$(print_color CLR_ERROR "no module search path defined")"
die
fi fi
PKG_MODULE_DIR="$INSTALL/$(get_full_module_dir $PKG_ADDON_ID)/updates/$PKG_ADDON_ID" PKG_MODULE_DIR="$INSTALL/$(get_full_module_dir $PKG_ADDON_ID)/updates/$PKG_ADDON_ID"

View File

@ -93,9 +93,9 @@ function find_addons() {
# abort when nothing found and not embedded # abort when nothing found and not embedded
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
printf "$(print_color CLR_ERROR "ERROR: '$1' matches nothing...")\n" ' '>&$SILENT_OUT echo "$(print_color CLR_ERROR "ERROR: '$1' matches nothing...")" >&$SILENT_OUT
printf "for more informations type: ./scripts/create_addon --help\n" ' '>&$SILENT_OUT echo "for more informations type: ./scripts/create_addon --help" >&$SILENT_OUT
exit 1 die
fi fi
fi fi
@ -297,13 +297,13 @@ for addon in $(tr " " "\n" <<< $addons | sort -u); do
fi fi
# build package # 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' _count+='x'
( build_addon $addon ) \ ( build_addon $addon ) \
2>&1 | tee $log_file 2>&1 | tee $log_file
if [ ${PIPESTATUS[0]} != 0 ]; then if [ ${PIPESTATUS[0]} != 0 ]; then
addons_failed+="$addon " 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 echo "failed: ${addon}" >> $summary_file
else else
if [ "$remove_success_logs" = "true" ]; then if [ "$remove_success_logs" = "true" ]; then
@ -321,10 +321,9 @@ fi
# print summary # print summary
if [ "$_count" != 'x' ]; then if [ "$_count" != 'x' ]; then
if [ -z "$addons_failed" ]; 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 exit 0
else else
printf "$(print_color CLR_ERROR "FAILED ADDONS: $addons_failed")\n" die "$(print_color CLR_ERROR "FAILED ADDONS: $addons_failed")"
exit 1
fi fi
fi fi

View File

@ -8,13 +8,11 @@
. config/options $1 . config/options $1
if [ -z "$1" ]; then if [ -z "$1" ]; then
echo "usage: $0 package_name" die "usage: $0 package_name"
exit 1
fi fi
if [ -z "$INSTALL" ] ; then if [ -z "$INSTALL" ] ; then
echo "error: '\$INSTALL' not set! this script is not intended to be run manually" die "error: '\$INSTALL' not set! this script is not intended to be run manually"
exit 1
fi fi
# set defaults # set defaults
@ -38,8 +36,7 @@ if [ -n "$PKG_ARCH" ]; then
fi fi
if [ ! -f $PKG_DIR/package.mk ]; then if [ ! -f $PKG_DIR/package.mk ]; then
printf "$(print_color CLR_ERROR "${PACKAGE_NAME}: no package.mk file found")\n" die "$(print_color CLR_ERROR "${PACKAGE_NAME}: no package.mk file found")"
exit 1
fi fi
$SCRIPTS/build $@ $SCRIPTS/build $@