From 88e32bab5084efff7bda0247e4d1a9ab50dd7a71 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Thu, 17 Jun 2021 00:26:05 +0300 Subject: kbuild: Avoid false matches in directory pattern Require matches for the directory pattern to be a full directory name, to reduce the risk of false matches. Signed-off-by: Laurent Pinchart --- kbuild.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kbuild.sh b/kbuild.sh index 93df105..c548718 100755 --- a/kbuild.sh +++ b/kbuild.sh @@ -156,7 +156,7 @@ if [[ -z "$platform" || "$platform" == "auto" ]] ; then pattern=$(cat $f | grep "dir_pattern=" | head -1) pattern=${pattern/#dir_pattern=/} if [[ -n "$pattern" ]] ; then - echo "$kernel_root" | grep -q "$pattern" || continue + echo "$kernel_root" | grep -q "/$pattern/" || continue platform=$(basename -s .sh $f) break fi -- cgit v1.2.3