From 4734c22edc654522fad23b82a66a140b46a29266 Mon Sep 17 00:00:00 2001 From: Ed Tanous Date: Mon, 20 Sep 2021 11:11:34 -0700 Subject: Ignore grep failures When the last round of reviews added -e to the bash statement, it exposed a slight flaw, in that when there aren't failures, grep will return a code if it's not able to find any matches. This commit changes that such that grep errors are "ignored" in the context of bash. Tested: ran run-repotest.sh on a clean repository, and observed "repo test passed" Signed-off-by: Ed Tanous Change-Id: I716220652d48b9a8489bf4dc0c3b4734b98a70e4 --- meta-phosphor/scripts/run-repotest.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-phosphor/scripts/run-repotest.sh b/meta-phosphor/scripts/run-repotest.sh index 88501b20f..bd82176d3 100755 --- a/meta-phosphor/scripts/run-repotest.sh +++ b/meta-phosphor/scripts/run-repotest.sh @@ -73,7 +73,7 @@ files_diff=$(comm -23 $patch_files_tmp $allowed_patches_tmp) rm $allowed_patches_tmp rm $patch_files_tmp -files_count=$(echo -n "$files_diff" | grep -c '^') +files_count=$(echo -n "$files_diff" | grep -c '^' || true) if [[ $files_count -ne 0 ]]; then echo "Patch files found not in allow list" echo "$files_diff" -- cgit v1.2.3