git: 30aaa5ae3f98 - main - framework: fix grep call in check_files hook

From: Tobias C. Berner <tcberner_at_FreeBSD.org>
Date: Wed, 16 Nov 2022 05:18:39 UTC
The branch main has been updated by tcberner:

URL: https://cgit.FreeBSD.org/ports/commit/?id=30aaa5ae3f985c3f28a8fbec8c5c9e078eb06a96

commit 30aaa5ae3f985c3f28a8fbec8c5c9e078eb06a96
Author:     Tobias C. Berner <tcberner@FreeBSD.org>
AuthorDate: 2022-11-16 05:16:46 +0000
Commit:     Tobias C. Berner <tcberner@FreeBSD.org>
CommitDate: 2022-11-16 05:18:26 +0000

    framework: fix grep call in check_files hook
    
    Reported by:            dch
---
 .hooks/pre-commit.d/check_files | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.hooks/pre-commit.d/check_files b/.hooks/pre-commit.d/check_files
index 01eae4f2b3d8..e9891f3cc827 100755
--- a/.hooks/pre-commit.d/check_files
+++ b/.hooks/pre-commit.d/check_files
@@ -17,7 +17,7 @@ if [ $? -eq 0 ] ; then
 		category=$(echo "${newish_file}" | awk -F '/' '{print $1}')
 		port=$(echo "${newish_file}" | awk -F '/' '{print $2}')
 		file=$(echo "${newish_file}" | awk -F '/' '{print $3}')
-		valid=$(echo "${file}" | grep -q '^((Makefile|distinfo|pkg-)(.*))|(.*\.mk)$')
+		valid=$(echo "${file}" | grep -Eq '^((Makefile|distinfo|pkg-)(.*))|(.*\.mk)$')
 		if [ $? -ne 0 ] ; then
 			echo "[pre-commit] ERROR: invalid file '${file}' in '${category}/${port}'"
 			status=1