config/functions: add listcontains function, and uses it

This commit is contained in:
MilhouseVH 2017-10-11 09:10:00 +01:00
parent 9928350609
commit 6822da552e
2 changed files with 6 additions and 5 deletions

View File

@ -171,6 +171,11 @@ get_pkg_variable() {
fi
}
# return 0 if $2 in space-separated list $1, otherwise return 1
listcontains() {
[[ ${1} =~ (^|[[:space:]])${2}($|[[:space:]]) ]] && return 0 || return 1
}
install_binary_addon() {
local addon_name="$1" addon_id="$2" addon_so

View File

@ -32,8 +32,4 @@ PKG_AUTORECONF="no"
get_graphicdrivers
for drv in $GRAPHIC_DRIVERS; do
if [ "$drv" = "vmware" ]; then
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET open-vm-tools"
fi
done
listcontains "$GRAPHIC_DRIVERS" "vmware" && PKG_DEPENDS_TARGET+=" open-vm-tools"