From 6055dcfb9cf3edb6a02eaca8cab17bea5f8a9573 Mon Sep 17 00:00:00 2001 From: Jonas Karlman Date: Mon, 11 Dec 2017 00:29:43 +0100 Subject: [PATCH] scripts/create_addon: improve PKG_ADDON_PROJECTS check Use same slightly more functional check as PKG_ARCH Allows "any !DEVICE" to be interpreted as "any device, but not DEVICE" --- scripts/create_addon | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/create_addon b/scripts/create_addon index 2be57c43ae..f6b9c22487 100755 --- a/scripts/create_addon +++ b/scripts/create_addon @@ -30,11 +30,14 @@ if [ -n "$PKG_ARCH" ]; then listcontains "$PKG_ARCH" "$TARGET_ARCH" || listcontains "$PKG_ARCH" "any" || exit 0 fi -if [ -n "$PKG_ADDON_PROJECTS" -a ! "$PKG_ADDON_PROJECTS" = "any" ]; then - if ! listcontains "${PKG_ADDON_PROJECTS}" "${DEVICE:-${PROJECT}}"; then - echo "*** ERROR: $PKG_ADDON_ID: '${DEVICE:-${PROJECT}}' not supported ***" - exit 0 - fi +not_supported() { + echo "*** ERROR: $PKG_ADDON_ID: '${DEVICE:-$PROJECT}' not supported ***" + exit 0 +} + +if [ -n "$PKG_ADDON_PROJECTS" ]; then + listcontains "$PKG_ADDON_PROJECTS" "!${DEVICE:-$PROJECT}" && not_supported + listcontains "$PKG_ADDON_PROJECTS" "${DEVICE:-$PROJECT}" || listcontains "$PKG_ADDON_PROJECTS" "any" || not_supported fi $SCRIPTS/checkdeps