[Intel-gfx] [maintainer-tools PATCH 2/4] dim: Fix shellcheck SC2162 and SC2166

Jani Nikula jani.nikula at intel.com
Thu Aug 10 14:08:14 UTC 2017


Fixes: 809748225c4e ("dim: Add add-missing-cc command")
Cc: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula at intel.com>
---
 dim | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/dim b/dim
index 28a137221535..070b199c699b 100755
--- a/dim
+++ b/dim
@@ -1959,7 +1959,9 @@ function dim_fixes
 
 function dim_add_missing_cc
 {
-	git show | scripts/get_maintainer.pl --email --norolestats --pattern-depth 1 | while read cc; do
+	local email name matches
+
+	git show | scripts/get_maintainer.pl --email --norolestats --pattern-depth 1 | while read -r cc; do
 		email="$(echo "$cc" | sed -e 's/.*<//' -e 's/>.*//')"
 		name=''
 
@@ -1968,15 +1970,15 @@ function dim_add_missing_cc
 		fi
 
 		# Don't add main mailing lists
-		if [ "$email" = "dri-devel at lists.freedesktop.org" -o \
-		     "$email" = "linux-kernel at vger.kernel.org}" ]; then
+		if [[ "$email" = "dri-devel at lists.freedesktop.org" || \
+		      "$email" = "linux-kernel at vger.kernel.org}" ]]; then
 			continue
 		fi
 
 		# Variables from the while loop don't propagate,
 		# print out a 1 on success
 		matches=$(
-			git show -s | grep -i "^    Cc:" | sed 's/^ *[Cc][Cc]: *//' | while read testcc; do
+			git show -s | grep -i "^    Cc:" | sed 's/^ *[Cc][Cc]: *//' | while read -r testcc; do
 				testemail="$(echo "$testcc" | sed -e 's/.*<//' -e 's/>.*//')"
 
 				if [ "$testemail" != "$email" ]; then
-- 
2.11.0



More information about the Intel-gfx mailing list