From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <thomas@monjalon.net>
Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com
 [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 5C853235
 for <dev@dpdk.org>; Wed, 18 Jul 2018 23:06:34 +0200 (CEST)
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41])
 by mailout.nyi.internal (Postfix) with ESMTP id 5A58821B0B;
 Wed, 18 Jul 2018 17:06:32 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute1.internal (MEProxy); Wed, 18 Jul 2018 17:06:32 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=
 cc:date:from:message-id:subject:to:x-me-sender:x-me-sender
 :x-sasl-enc; s=mesmtp; bh=/l+cPFFMMdH2o4FZuitsHG1PdBxiBmYzPOXuiw
 ffxRo=; b=HJtfkkGqFspGFahQl/8yRkEhK/p+Z/3rjkako9S+gFiLkJ5HMU0q5S
 BcoNrQNWFqtnpxA+WnbS0DTNMPqdsk+tT4KA8K59++UdbkHpZpsSjkbJfmgZfwlY
 EHFu5wOG7/SiC4e2lS5JDlmlhgVJiCzHmFQ+l0V7LxeArLtUlY+7s=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:date:from:message-id:subject:to
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=/l+cPFFMMdH2o4FZu
 itsHG1PdBxiBmYzPOXuiwffxRo=; b=GuBpTiBn9xXuqSfU3ZKuSOHgAJXsXso9o
 R2LR65q3yCH7b8gzwqJHWwwy/8pTRHjZs90exu/pjyJac6W3vwobOwrbDXyKhQMe
 0g/Q3P0w/43NGJebQjZ509qik7wd8UXvuE1BTfsHi/WUTU78m+g3FUgt8HZhME3h
 WopFzHxIcG6dG9ls5DrglxmcY9P138gDLBmaUs60Di+lTnt6v7yKDsDSgWkvBgOy
 34+Z+4URQuMnNICBmdSri+FHi6v+NlGPemDZWFBgCy8aS97pgEV3HrSqYVt/yNEW
 6ok7zvlRCxbJ2A8DcsS6jzk4qASOmPSscGfK2fnoc7r/o6jIxa1Lw==
X-ME-Proxy: <xmx:1qtPWyjjjk6QotTkAFjB7mMGAQ9QRMbgB4Hkc0UZWf3LlZD-hzbpTg>
 <xmx:1qtPW-bGCwqtCPeWm0N6p0ztDxVUMMnEeoJQtSGhi-zYBoeo683aHQ>
 <xmx:1qtPWzdab9ibdwkjcoIurstOAKFPYLT1rb58tnzlx2Duv4bylXdVNg>
 <xmx:1qtPWzAbloIytVGabSlheO1PeryFtfkVBddF_V06ylJH4vpmVolZ9g>
 <xmx:1qtPW7WePyxEkMlfKPSTcnngHUAI7nJJgh1GxcFRQ_UvvMZjRbB0Sw>
 <xmx:2KtPW1tEOPvUyivhlZy6m1KAGovhMGe74_2u_Wp8MvUIkvhMWMahWQ>
X-ME-Sender: <xms:1qtPW2Rxg4lC6iMZXk5GFS70ldDH-kjnK8R-KkSLAtXZ368XfOJTCQ>
Received: from xps.monjalon.net (unknown [37.168.67.16])
 by mail.messagingengine.com (Postfix) with ESMTPA id 73164E45C9;
 Wed, 18 Jul 2018 17:06:28 -0400 (EDT)
From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: nhorman@tuxdriver.com
Date: Wed, 18 Jul 2018 23:06:09 +0200
Message-Id: <20180718210609.32547-1-thomas@monjalon.net>
X-Mailer: git-send-email 2.17.1
Subject: [dpdk-dev] [PATCH] devtools: fix symbol check for filename with
	space
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Wed, 18 Jul 2018 21:06:34 -0000

If the patch filename or the temporary file path have a space
in their name, the script check-symbol-change.sh does not work.
The variables for the filenames must be enclosed in quotes
in order to preserve spaces.

Fixes: 4bec48184e33 ("devtools: add checks for ABI symbol addition")
Cc: nhorman@tuxdriver.com

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 devtools/check-symbol-change.sh | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/devtools/check-symbol-change.sh b/devtools/check-symbol-change.sh
index 9952a8d66..69b874ace 100755
--- a/devtools/check-symbol-change.sh
+++ b/devtools/check-symbol-change.sh
@@ -7,7 +7,7 @@ build_map_changes()
 	local fname=$1
 	local mapdb=$2
 
-	cat $fname | awk '
+	cat "$fname" | awk '
 		# Initialize our variables
 		BEGIN {map="";sym="";ar="";sec=""; in_sec=0; in_map=0}
 
@@ -71,10 +71,10 @@ build_map_changes()
 					print map " " sym " unknown del"
 				}
 			}
-		}' > ./$mapdb
+		}' > "$mapdb"
 
-		sort -u $mapdb > ./$mapdb.2
-		mv -f $mapdb.2 $mapdb
+		sort -u "$mapdb" > "$mapdb.2"
+		mv -f "$mapdb.2" "$mapdb"
 
 }
 
@@ -111,7 +111,7 @@ check_for_rule_violations()
 				# to be moving from an already supported
 				# section or its a violation
 				grep -q \
-				"$mname $symname [^EXPERIMENTAL] del" $mapdb
+				"$mname $symname [^EXPERIMENTAL] del" "$mapdb"
 				if [ $? -ne 0 ]
 				then
 					echo -n "ERROR: symbol $symname "
@@ -133,7 +133,7 @@ check_for_rule_violations()
 				echo "gone through the deprecation process"
 			fi
 		fi
-	done < $mapdb
+	done < "$mapdb"
 
 	return $ret
 }
@@ -150,10 +150,10 @@ clean_and_exit_on_sig()
 	exit $exit_code
 }
 
-build_map_changes $patch $mapfile
-check_for_rule_violations $mapfile
+build_map_changes "$patch" "$mapfile"
+check_for_rule_violations "$mapfile"
 exit_code=$?
 
-rm -f $mapfile
+rm -f "$mapfile"
 
 exit $exit_code
-- 
2.17.1