DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Arnon Warshavsky <arnon@qwilt.com>
Cc: "Yigit, Ferruh" <ferruh.yigit@intel.com>,
	ajit.khaparde@broadcom.com,  thomasm@mellanox.com, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v1] devtools: fix error propagation from check-forbidden-tokens.awk
Date: Tue, 18 Dec 2018 15:16:47 +0100	[thread overview]
Message-ID: <CAJFAV8xAZq8-yvvBhuNXxyPLZGR4u2hmcwT3X_HwEceH3Xsp=g@mail.gmail.com> (raw)
In-Reply-To: <CAJFAV8ybiKKeNioBJMCa6O=JY=MJEy5JgZ-gjs_4hxq7yk0ZCw@mail.gmail.com>

On Tue, Dec 18, 2018 at 3:12 PM David Marchand <david.marchand@redhat.com>
wrote:

>
>
> On Tue, Dec 18, 2018 at 3:03 PM Arnon Warshavsky <arnon@qwilt.com> wrote:
>
>> Bugzilla ID: 165
>> Fixes: 4d4c612e6a30 ("devtools: check wrong svg include in guides")
>> Signed-off-by: Arnon Warshavsky <arnon@qwilt.com>
>>
>> Explicitly collect the output and result of the
>> multiple awk script calls, print and return error
>> if any of them fails
>> ---
>>  devtools/checkpatches.sh | 21 +++++++++++++++++----
>>  1 file changed, 17 insertions(+), 4 deletions(-)
>>
>> diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
>> index ee8debe..df4336c 100755
>> --- a/devtools/checkpatches.sh
>> +++ b/devtools/checkpatches.sh
>> @@ -44,22 +44,35 @@ print_usage () {
>>  }
>>
>>  check_forbidden_additions() { # <patch>
>> +       res=0
>> +
>>         # refrain from new additions of rte_panic() and rte_exit()
>>         # multiple folders and expressions are separated by spaces
>> -       awk -v FOLDERS="lib drivers" \
>> +       result=$(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")
>> +       if [ $? -ne 0 ] ; then
>> +               echo $result
>> +               res=1
>> +       fi
>> +
>>         # svg figures must be included with wildcard extension
>>         # because of png conversion for pdf docs
>> -       awk -v FOLDERS='doc' \
>> +       result=$(awk -v FOLDERS='doc' \
>>                 -v EXPRESSIONS='::[[:space:]]*[^[:space:]]*\\.svg' \
>>                 -v RET_ON_FAIL=1 \
>>                 -v MESSAGE='Using explicit .svg extension instead of .*' \
>>                 -f $(dirname $(readlink -e
>> $0))/check-forbidden-tokens.awk \
>> -               "$1"
>> +               "$1")
>> +        if [ $? -ne 0 ] ; then
>> +                echo $result
>> +                res=1
>> +        fi
>> +
>> +       return $res
>>  }
>>
>>  number=0
>> --
>> 1.8.3.1
>>
>
> How about just this change ?
>
> diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
> index ee8debe..8385384 100755
> --- a/devtools/checkpatches.sh
> +++ b/devtools/checkpatches.sh
> @@ -51,7 +51,7 @@ check_forbidden_additions() { # <patch>
>                 -v RET_ON_FAIL=1 \
>                 -v MESSAGE='Using rte_panic/rte_exit' \
>                 -f $(dirname $(readlink -e $0))/check-forbidden-tokens.awk
> \
> -               "$1"
> +               "$1" &&
>         # svg figures must be included with wildcard extension
>         # because of png conversion for pdf docs
>         awk -v FOLDERS='doc' \
>

Ah ok, nevermind, two issues.

-- 
David Marchand

  reply	other threads:[~2018-12-18 14:16 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 [this message]
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
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='CAJFAV8xAZq8-yvvBhuNXxyPLZGR4u2hmcwT3X_HwEceH3Xsp=g@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=thomasm@mellanox.com \
    /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).