DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ilya Maximets <i.maximets@samsung.com>
To: dev@dpdk.org
Cc: Thomas Monjalon <thomas@monjalon.net>,
	Arnon Warshavsky <arnon@qwilt.com>,
	Stephen Hemminger <stephen@networkplumber.org>,
	Ilya Maximets <i.maximets@samsung.com>,
	stable@dpdk.org
Subject: [dpdk-dev] [PATCH] devtools: don't use bash extension in checkpatches
Date: Wed, 15 Aug 2018 18:33:46 +0300	[thread overview]
Message-ID: <20180815153346.11495-1-i.maximets@samsung.com> (raw)
In-Reply-To: <CGME20180815153249eucas1p2e13cf746fda4b82519b40f3b760a2c33@eucas1p2.samsung.com>

'read -d' is a bash extension and doesn't work in POSIX shells.
For example 'checkpatches.sh' doesn't work properly on ubuntu,
where 'dash' is a default shell:

  ./devtools/checkpatches.sh: 52: read: Illegal option -d

Let's use single quotes instead of variable.

Fixes: 7413e7f2aeb3 ("devtools: alert on new calls to exit from libs")
CC: stable@dpdk.org

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
---
 devtools/checkpatches.sh | 34 ++++++++++++++++------------------
 1 file changed, 16 insertions(+), 18 deletions(-)

diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
index ba795ad1d..aad35275c 100755
--- a/devtools/checkpatches.sh
+++ b/devtools/checkpatches.sh
@@ -44,12 +44,18 @@ print_usage () {
 }
 
 check_forbidden_additions() {
-    # This awk script receives a list of expressions to monitor
-    # and a list of folders to search these expressions in
-    # - No search is done inside comments
-    # - Both additions and removals of the expressions are checked
-    #   A positive balance of additions fails the check
-	read -d '' awk_script << 'EOF'
+	# This awk script receives a list of expressions to monitor
+	# and a list of folders to search these expressions in
+	# - No search is done inside comments
+	# - Both additions and removals of the expressions are checked
+	#   A positive balance of additions fails the check
+	# ---------------------------------
+	# refrain from new additions of rte_panic() and rte_exit()
+	# multiple folders and expressions are separated by spaces
+	awk -v FOLDERS="lib drivers" \
+		-v EXPRESSIONS="rte_panic\\\( rte_exit\\\(" \
+		-v RET_ON_FAIL=1 \
+	'
 	BEGIN {
 		split(FOLDERS,deny_folders," ");
 		split(EXPRESSIONS,deny_expr," ");
@@ -70,7 +76,7 @@ check_forbidden_additions() {
 		# non comment code
 		if (in_comment == 0) {
 			for (i in deny_expr) {
-				forbidden_added = "^\+.*" deny_expr[i];
+				forbidden_added = "^+.*" deny_expr[i];
 				forbidden_removed="^-.*" deny_expr[i];
 				current = expressions[deny_expr[i]]
 				if ($0 ~ forbidden_added) {
@@ -90,13 +96,13 @@ check_forbidden_additions() {
 	}
 	# switch to next file , check if the balance of add/remove
 	# of previous filehad new additions
-	($0 ~ "^\+\+\+ b/") {
+	($0 ~ "^+++ b/") {
 		in_file = 0;
 		if (count > 0) {
 			exit;
 		}
 		for (i in deny_folders) {
-			re = "^\+\+\+ b/" deny_folders[i];
+			re = "^+++ b/" deny_folders[i];
 			if ($0 ~ deny_folders[i]) {
 				in_file = 1
 				last_file = $0
@@ -114,15 +120,7 @@ check_forbidden_additions() {
 			}
 			exit RET_ON_FAIL
 		}
-	}
-EOF
-	# ---------------------------------
-	# refrain from new additions of rte_panic() and rte_exit()
-	# multiple folders and expressions are separated by spaces
-	awk -v FOLDERS="lib drivers" \
-		-v EXPRESSIONS="rte_panic\\\( rte_exit\\\(" \
-		-v RET_ON_FAIL=1 \
-		"$awk_script" -
+	}' -
 }
 
 number=0
-- 
2.17.1

       reply	other threads:[~2018-08-15 15:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20180815153249eucas1p2e13cf746fda4b82519b40f3b760a2c33@eucas1p2.samsung.com>
2018-08-15 15:33 ` Ilya Maximets [this message]
2018-08-16  5:25   ` Arnon Warshavsky
2018-09-14 14:50     ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
2018-09-14 15:10       ` Ilya Maximets
2018-09-15 21:07         ` Thomas Monjalon
2018-09-15 19:07       ` Arnon Warshavsky
2018-09-15 20:37         ` Thomas Monjalon
2018-09-16  3:13           ` Arnon Warshavsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180815153346.11495-1-i.maximets@samsung.com \
    --to=i.maximets@samsung.com \
    --cc=arnon@qwilt.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).