From: David Marchand <david.marchand@redhat.com>
To: Arnon Warshavsky <arnon@qwilt.com>
Cc: Thomas Monjalon <thomas@monjalon.net>,
dev@dpdk.org, "Yigit, Ferruh" <ferruh.yigit@intel.com>,
Ajit Khaparde <ajit.khaparde@broadcom.com>
Subject: Re: [dpdk-dev] [PATCH v1] devtools: fix error propagation from check-forbidden-tokens.awk
Date: Tue, 18 Dec 2018 15:49:16 +0100 [thread overview]
Message-ID: <CAJFAV8x1Aem67igVrinWXxDyoxha8P0BOTMV=saDWYLYLQX27A@mail.gmail.com> (raw)
In-Reply-To: <CAKy9EB1yRZvxeuZT1u0QdALAcpzi5cLro-gOBNKSVVufv406hA@mail.gmail.com>
On Tue, Dec 18, 2018 at 3:45 PM Arnon Warshavsky <arnon@qwilt.com> wrote:
> The reason I did not use the && approach is that if both checks have
> errors,
> only the first will be reported and we want all errors to be reported at
> once
> without discovering them one by one after every fix.
>
>
Ok, then:
diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
index ee8debe..7457f01 100755
--- a/devtools/checkpatches.sh
+++ b/devtools/checkpatches.sh
@@ -46,12 +46,13 @@ print_usage () {
check_forbidden_additions() { # <patch>
# refrain from new additions of rte_panic() and rte_exit()
# multiple folders and expressions are separated by spaces
+ ret=0
awk -v FOLDERS="lib drivers" \
-v EXPRESSIONS="rte_panic\\\( rte_exit\\\(" \
-v RET_ON_FAIL=1 \
-v MESSAGE='Using rte_panic/rte_exit' \
-f $(dirname $(readlink -e $0))/check-forbidden-tokens.awk \
- "$1"
+ "$1" || ret=1
# svg figures must be included with wildcard extension
# because of png conversion for pdf docs
awk -v FOLDERS='doc' \
@@ -59,7 +60,9 @@ check_forbidden_additions() { # <patch>
-v RET_ON_FAIL=1 \
-v MESSAGE='Using explicit .svg extension instead of .*' \
-f $(dirname $(readlink -e $0))/check-forbidden-tokens.awk \
- "$1"
+ "$1" || ret=1
+
+ return $ret
}
number=0
No need for all those checks on $? and the output saving.
--
David Marchand
next prev parent reply other threads:[~2018-12-18 14:49 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-18 14:03 Arnon Warshavsky
2018-12-18 14:12 ` David Marchand
2018-12-18 14:16 ` David Marchand
2018-12-18 14:27 ` David Marchand
2018-12-18 14:35 ` Thomas Monjalon
2018-12-18 14:44 ` Arnon Warshavsky
2018-12-18 14:48 ` Thomas Monjalon
2018-12-18 14:49 ` David Marchand [this message]
2018-12-18 14:53 ` Arnon Warshavsky
2018-12-18 14:55 ` David Marchand
2018-12-18 15:19 ` [dpdk-dev] [PATCH v2] " Arnon Warshavsky
2018-12-21 0:59 ` Thomas Monjalon
2019-01-17 12:20 ` David Marchand
2019-01-17 15:32 ` Thomas Monjalon
2019-01-17 17:25 ` David Marchand
2019-01-17 21:34 ` Ajit Khaparde
2019-01-17 21:47 ` Thomas Monjalon
2019-01-18 4:59 ` Ajit Khaparde
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='CAJFAV8x1Aem67igVrinWXxDyoxha8P0BOTMV=saDWYLYLQX27A@mail.gmail.com' \
--to=david.marchand@redhat.com \
--cc=ajit.khaparde@broadcom.com \
--cc=arnon@qwilt.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--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).