Merge pull request #2854 from MilhouseVH/le90_pr2773_cleanup

scripts/create_addon: minor cleanup
This commit is contained in:
CvH 2018-08-02 16:41:30 +02:00 committed by GitHub
commit c26408a09c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,20 +79,20 @@ function find_addons() {
`# make entries unique` \ `# make entries unique` \
| sort -u \ | sort -u \
`# select packages with PKG_IS_ADDON=yes (slow, but is a short list, now)` \ `# select packages with PKG_IS_ADDON=yes (slow, but is a short list, now)` \
| xargs -n1 -I{} $SHELL -c '. ./config/options {} &>/dev/null; [ "$PKG_IS_ADDON" == "yes" ] && echo $PKG_NAME' | xargs -n1 -I{} /bin/bash -c '. ./config/options {} &>/dev/null; [ "$PKG_IS_ADDON" = "yes" ] && echo $PKG_NAME'
) )
# check if anything is found # check if anything is found
local _count=$(wc -w <<< $_addons) local _count=$(wc -w <<< $_addons)
if [ "$_count" == 0 ]; then if [ $_count -eq 0 ]; then
# handle embedded addons here. Should only build, when they explicte in the addon list # handle embedded addons here. Should only build when they are explictly specified in the addon list
( . ./config/options "$1" &>/dev/null ( . ./config/options "$1" &>/dev/null
[ "$PKG_IS_ADDON" != "embedded" ] && exit 1 [ "$PKG_IS_ADDON" != "embedded" ] && exit 1
echo $PKG_NAME echo $PKG_NAME
) )
# abort when nothing found and not embedded # abort when nothing found and not embedded
if [ $? != 0 ]; then if [ $? -ne 0 ]; then
printf "$(print_color CLR_ERROR "ERROR: '$1' matches nothing...")\n" ' '>&$SILENT_OUT printf "$(print_color CLR_ERROR "ERROR: '$1' matches nothing...")\n" ' '>&$SILENT_OUT
printf "for more informations type: ./scripts/create_addon --help\n" ' '>&$SILENT_OUT printf "for more informations type: ./scripts/create_addon --help\n" ' '>&$SILENT_OUT
exit 1 exit 1
@ -226,7 +226,7 @@ build_addon() {
} }
# need parameter # need parameter
if [ $# == 0 ]; then if [ $# -eq 0 ]; then
usage 1 usage 1
fi fi
@ -280,7 +280,7 @@ for addon in $(tr " " "\n" <<< $addons | sort -u); do
fi fi
# show-only: print name and continue with next addon # show-only: print name and continue with next addon
if [ $show_only == "true" ]; then if [ "$show_only" = "true" ]; then
echo $addon echo $addon
continue continue
fi fi
@ -301,14 +301,14 @@ for addon in $(tr " " "\n" <<< $addons | sort -u); do
printf "$(print_color CLR_ERROR "ADDON FAILED $addon")\n" ' '>&$SILENT_OUT printf "$(print_color CLR_ERROR "ADDON FAILED $addon")\n" ' '>&$SILENT_OUT
else else
printf "$(print_color CLR_INFO "ADDON SUCCESS $addon")\n" ' '>&$SILENT_OUT printf "$(print_color CLR_INFO "ADDON SUCCESS $addon")\n" ' '>&$SILENT_OUT
if [ $remove_success_logs == "true" ]; then if [ "$remove_success_logs" = "true" ]; then
rm -f $log_file rm -f $log_file
fi fi
fi fi
done done
# show-only has no summary, can exit here # show-only has no summary, can exit here
if [ $show_only == "true" ]; then if [ "$show_only" = "true" ]; then
exit 0 exit 0
fi fi