From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id C1A132BAF; Wed, 15 Aug 2018 17:32:52 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180815153251euoutp0177730f2283df74bbd4e375a81470dabc~LGJ9_pgo_2836328363euoutp010; Wed, 15 Aug 2018 15:32:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180815153251euoutp0177730f2283df74bbd4e375a81470dabc~LGJ9_pgo_2836328363euoutp010 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1534347171; bh=Mb4fnXetZOJvnvXSJvMxZBn7L72Vlu7EIRpZYqSMAJo=; h=From:To:Cc:Subject:Date:References:From; b=Hw6b2dLjMYVkz6bPUe7emEVR9EW06t5VBIINkHjFAzFiBqFDhV4LWXpJziXATzLMG PsOLCCIvS3xANbqecJmmZAroAcoGv7OvAguVQHN8XfQ4xulHmJ0rsHF4Q/wWnoGHPt NCB9cjhhsRWoHoRhxlF0l7JCVaHDnZ7fKKz1so0Y= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180815153250eucas1p1306d4bba078497aae1b3dd2e00ed9594~LGJ9aOafI3066930669eucas1p1X; Wed, 15 Aug 2018 15:32:50 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 5E.4C.04806.2A7447B5; Wed, 15 Aug 2018 16:32:50 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180815153249eucas1p2e13cf746fda4b82519b40f3b760a2c33~LGJ8ms-1w3211932119eucas1p2i; Wed, 15 Aug 2018 15:32:49 +0000 (GMT) X-AuditID: cbfec7f5-34dff700000012c6-32-5b7447a28825 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 4A.81.04128.1A7447B5; Wed, 15 Aug 2018 16:32:49 +0100 (BST) Received: from imaximets.rnd.samsung.ru ([106.109.129.180]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PDI0055EDUL2210@eusync4.samsung.com>; Wed, 15 Aug 2018 16:32:49 +0100 (BST) From: Ilya Maximets To: dev@dpdk.org Cc: Thomas Monjalon , Arnon Warshavsky , Stephen Hemminger , Ilya Maximets , stable@dpdk.org Date: Wed, 15 Aug 2018 18:33:46 +0300 Message-id: <20180815153346.11495-1-i.maximets@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprOIsWRmVeSWpSXmKPExsWy7djPc7qL3EuiDRpWS1tceb2O2eLdp+1M Flfaf7Jb/Ov4w26x+I6cxacHJ1gc2Dx+LVjK6nHs5jR2j56T85g8Ftz8y+TRt2UVYwBrFJdN SmpOZllqkb5dAldG9683jAXzxCumfJ3L2MA4WaiLkZNDQsBEYsKWR2xdjFwcQgIrGCVmdb5g gXA+M0qsWvGUDabqwt3fUFXLGCXe/G5nhnCamSSevF8MVsUmoCNxavURRhBbREBA4nMnRJxZ YBejxPVe3S5GDg5hAWeJSa9UQcIsAqoS104vYQWxeQWsJe5P/c8OsUxeYvWGA2DzJQSeskq0 TFgCdYWLxO0nb6BsYYlXx7dANchIXJ7czQJh10vcb3nJCNHcwSgx/dA/JoiEvcSW1+fYIQ7i k5i0bTozyEESArwSHW3QsPCQeLSuH+x+IYFYiXmfV7BPYJRYwMiwilE8tbQ4Nz212DgvtVyv ODG3uDQvXS85P3cTIzC6Tv87/nUH474/SYcYBTgYlXh4HxiWRAuxJpYVV+YeYpTgYFYS4VXj AwrxpiRWVqUW5ccXleakFh9ilOZgURLn5dNKixYSSE8sSc1OTS1ILYLJMnFwSjUw7kxbZlDL d9zmeW88l2W/cBv71FwR0eB9lfqyCsWVRyRn9Lm+bpa89HF72dxf+7dolnlLMNjEd2SfkWqo P1/u38pz9mlPl73mtX6VW+ctGXIuPfh2Yvc63uWRn7pNDGdrWm4U7k1UCfx8uFROMFv60dys xG9Of+/F7a67eOiknenP+comD92UWIozEg21mIuKEwEQcVoAqgIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrFJMWRmVeSWpSXmKPExsVy+t/xa7oL3UuiDV5+UrO48nods8W7T9uZ LK60/2S3+Nfxh91i8R05i08PTrA4sHn8WrCU1ePYzWnsHj0n5zF5LLj5l8mjb8sqxgDWKC6b lNSczLLUIn27BK6M7l9vGAvmiVdM+TqXsYFxslAXIyeHhICJxIW7v9m6GLk4hASWMEpsPLOP CcJpZZLo+HybBaSKTUBH4tTqI4wgtoiAgMTnzsVgHcwCuxglNiz5BJTg4BAWcJaY9EoVpIZF QFXi2uklrCA2r4C1xP2p/9khtslLrN5wgHkCI9cCRoZVjCKppcW56bnFRnrFibnFpXnpesn5 uZsYgSGw7djPLTsYu94FH2IU4GBU4uF9YFgSLcSaWFZcmXuIUYKDWUmEV40PKMSbklhZlVqU H19UmpNafIhRmoNFSZz3vEFllJBAemJJanZqakFqEUyWiYNTqoHRo1PJhr1Letn61vsNL+8f /xW0TO6EelD88qZVHaHZb5/e+XvGU4un5m0DOxPDhi2/+exXtTLs7PEKWdZa8e/nvw655rJ+ xfCb63y3r/n5PMsxmuWwJsPmx8+2rH6zhfH/7La7WkH7fk4TLPf6Np9f4ipLl5nIX/8O3dQX V6ZLLdtYHLqzqOm2EktxRqKhFnNRcSIA28INK/0BAAA= X-CMS-MailID: 20180815153249eucas1p2e13cf746fda4b82519b40f3b760a2c33 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180815153249eucas1p2e13cf746fda4b82519b40f3b760a2c33 References: Subject: [dpdk-dev] [PATCH] devtools: don't use bash extension in checkpatches X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Aug 2018 15:32:52 -0000 '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 --- 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