buildsystem: remove grep from PKG_ARCH check

More efficient, slightly more functional.

Can be a space delimited list of architectures.

Architectures to be excluded can be specified with !ARCH.

Allows "any !arm" to be interpreted as "any arch, but not arm".

Blank/undefined is equivalent to "any".
This commit is contained in:
MilhouseVH 2017-10-29 12:01:52 +01:00 committed by Sascha Kuehndel (InuSasha)
parent 430f6e33a0
commit e0b833c782
No known key found for this signature in database
GPG Key ID: 15FED89617B88D1B
4 changed files with 12 additions and 12 deletions

View File

@ -44,9 +44,9 @@ else
fi
[ -z "$TARGET" ] && TARGET="target"
if [ -n "$PKG_ARCH" -a ! "$PKG_ARCH" = "any" ]; then
echo "$PKG_ARCH" | grep -q "$TARGET_ARCH" || exit 0
echo "$PKG_ARCH" | grep -q "\-$TARGET_ARCH" && exit 0
if [ -n "$PKG_ARCH" ]; then
listcontains "$PKG_ARCH" "!$TARGET_ARCH" && exit 0
listcontains "$PKG_ARCH" "$TARGET_ARCH" || listcontains "$PKG_ARCH" "any" || exit 0
fi
unset INSTALL

View File

@ -25,9 +25,9 @@ if [ -z "$1" ]; then
exit 1
fi
if [ -n "$PKG_ARCH" -a ! "$PKG_ARCH" = "any" ]; then
echo "$PKG_ARCH" | grep -q "$TARGET_ARCH" || exit 0
echo "$PKG_ARCH" | grep -q "\-$TARGET_ARCH" && exit 0
if [ -n "$PKG_ARCH" ]; then
listcontains "$PKG_ARCH" "!$TARGET_ARCH" && exit 0
listcontains "$PKG_ARCH" "$TARGET_ARCH" || listcontains "$PKG_ARCH" "any" || exit 0
fi
if [ -n "$PKG_ADDON_PROJECTS" -a ! "$PKG_ADDON_PROJECTS" = "any" ]; then

View File

@ -46,9 +46,9 @@ mkdir -p $STAMPS_INSTALL/$PACKAGE_NAME
[ -f $STAMP ] && exit 0
if [ -n "$PKG_ARCH" -a ! "$PKG_ARCH" = "any" ]; then
echo "$PKG_ARCH" | grep -q "$TARGET_ARCH" || exit 0
echo "$PKG_ARCH" | grep -q "\-$TARGET_ARCH" && exit 0
if [ -n "$PKG_ARCH" ]; then
listcontains "$PKG_ARCH" "!$TARGET_ARCH" && exit 0
listcontains "$PKG_ARCH" "$TARGET_ARCH" || listcontains "$PKG_ARCH" "any" || exit 0
fi
if [ ! -f $PKG_DIR/package.mk ]; then

View File

@ -34,9 +34,9 @@ else
fi
[ -z "$TARGET" ] && TARGET="target"
if [ -n "$PKG_ARCH" -a ! "$PKG_ARCH" = "any" ]; then
echo "$PKG_ARCH" | grep -q "$TARGET_ARCH" || exit 0
echo "$PKG_ARCH" | grep -q "\-$TARGET_ARCH" && exit 0
if [ -n "$PKG_ARCH" ]; then
listcontains "$PKG_ARCH" "!$TARGET_ARCH" && exit 0
listcontains "$PKG_ARCH" "$TARGET_ARCH" || listcontains "$PKG_ARCH" "any" || exit 0
fi
STAMP=$STAMPS/$PACKAGE_NAME/build_$TARGET