scripts/create_addon: output diagnostic when filter not matching

This commit is contained in:
MilhouseVH 2019-02-13 15:10:54 +00:00
parent 78d97cc12b
commit a8d6e99f82

View File

@ -69,6 +69,7 @@ get_addons() {
[ ${exited} -eq 1 ] && continue
validpkg="no"
VERIFY_FAIL=
# Should only build embedded addons when they are explictly specified in the addon list
if [ "${PKG_IS_ADDON}" = "embedded" ]; then
if [ -n "${filter}" ]; then
@ -81,6 +82,8 @@ get_addons() {
if [ "${validpkg}" = "yes" ]; then
echo "${PKG_NAME}"
count=$((count + 1))
elif [ -n "${VERIFY_FAIL}" -a -n "${filter}" ]; then
echo "$(print_color CLR_ERROR "${PKG_NAME}"): ${VERIFY_FAIL}" >&2
fi
done
@ -96,6 +99,7 @@ get_addons() {
# Return 0 if package is a suitable addon, 1 otherwise
verify_addon() {
if [ -n "${PKG_ARCH}" ]; then
VERIFY_FAIL="Incompatible arch: \"${TARGET_ARCH}\" not in [ ${PKG_ARCH} ]"
listcontains "${PKG_ARCH}" "!${TARGET_ARCH}" && return 1
listcontains "${PKG_ARCH}" "${TARGET_ARCH}" || listcontains "${PKG_ARCH}" "any" || return 1
fi
@ -103,6 +107,8 @@ verify_addon() {
if [ -n "${PKG_ADDON_PROJECTS}" ]; then
[ "${DEVICE}" = "RPi" ] && _DEVICE="RPi1" || _DEVICE="${DEVICE}"
VERIFY_FAIL="Incompatible project or device: \"${_DEVICE:-${PROJECT}}\" not in [ ${PKG_ADDON_PROJECTS} ]"
if listcontains "${PKG_ADDON_PROJECTS}" "!${_DEVICE:-$PROJECT}" ||
listcontains "${PKG_ADDON_PROJECTS}" "!${PROJECT}"; then
return 1