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"
This commit is contained in:
Jonas Karlman 2017-12-11 00:29:43 +01:00
parent efdc8f64b7
commit 6055dcfb9c

View File

@ -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