abuild: detect /bin/sh dependency even if shebang has spaces

fixes !7
This commit is contained in:
Natanael Copa 2019-11-07 15:38:50 +00:00
parent 6d321050e5
commit d8cfcd5dc9

View File

@ -1004,7 +1004,7 @@ prepare_metafiles() {
for i in $install $triggers; do
local s=${i%=*}
[ "$name" != "${s%.*}" ] && continue
if head -n 1 "$startdir/$s" | grep '^#!/bin/sh' >/dev/null ; then
if head -n 1 "$startdir/$s" | grep -E '^#!\s*/bin/sh' >/dev/null ; then
msg "Script found. /bin/sh added as a dependency for $pkg"
deps="$deps /bin/sh"
break