* [PATCH] coccinelle: grep Options and Requires fields more precisely
@ 2017-10-26 4:50 Masahiro Yamada
2017-10-26 4:59 ` Julia Lawall
0 siblings, 1 reply; 5+ messages in thread
From: Masahiro Yamada @ 2017-10-26 4:50 UTC (permalink / raw)
To: cocci, linux-kbuild, Julia Lawall
Cc: Masahiro Yamada, Nicolas Palix, linux-kernel, Gilles Muller,
Michal Marek
Currently, the required version for badzero.cocci is picked up from
its "Comments:" line since it contains the word "Requires".
Surprisingly, ld-version.sh can extract the version number from the
string "Requires Coccinelle version 1.0.0-rc20 or later", but this
expectation is fragile. Fix the .cocci file. I removed "-rc20"
because ld-version.sh cannot handle it.
Make the coccicheck script to see exact patterns for "Options:" and
"Requires:" in order to avoid accidental matching to what just happens
to appear in comment lines.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
scripts/coccicheck | 4 ++--
scripts/coccinelle/null/badzero.cocci | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/scripts/coccicheck b/scripts/coccicheck
index 3e21a1b..1bfa2d2 100755
--- a/scripts/coccicheck
+++ b/scripts/coccicheck
@@ -168,8 +168,8 @@ OPTIONS="$OPTIONS $SPFLAGS"
coccinelle () {
COCCI="$1"
- OPT=`grep "Option" $COCCI | cut -d':' -f2`
- REQ=`grep "Requires" $COCCI | cut -d':' -f2 | sed "s| ||"`
+ OPT=`grep "Options:" $COCCI | cut -d':' -f2`
+ REQ=`grep "Requires:" $COCCI | cut -d':' -f2 | sed "s| ||"`
REQ_NUM=$(echo $REQ | ${DIR}/scripts/ld-version.sh)
if [ "$REQ_NUM" != "0" ] ; then
if [ "$SPATCH_VERSION_NUM" -lt "$REQ_NUM" ] ; then
diff --git a/scripts/coccinelle/null/badzero.cocci b/scripts/coccinelle/null/badzero.cocci
index 5551da2..f597c80 100644
--- a/scripts/coccinelle/null/badzero.cocci
+++ b/scripts/coccinelle/null/badzero.cocci
@@ -10,7 +10,7 @@
// Copyright: (C) 2012 Julia Lawall, INRIA/LIP6. GPLv2.
// Copyright: (C) 2012 Gilles Muller, INRIA/LiP6. GPLv2.
// URL: http://coccinelle.lip6.fr/
-// Comments: Requires Coccinelle version 1.0.0-rc20 or later
+// Requires: 1.0.0
// Options:
virtual patch
--
2.7.4
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] coccinelle: grep Options and Requires fields more precisely
2017-10-26 4:50 [PATCH] coccinelle: grep Options and Requires fields more precisely Masahiro Yamada
@ 2017-10-26 4:59 ` Julia Lawall
2017-10-26 7:26 ` Nicolas Palix (LIG)
0 siblings, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2017-10-26 4:59 UTC (permalink / raw)
To: Masahiro Yamada
Cc: cocci, linux-kbuild, Julia Lawall, Nicolas Palix, linux-kernel,
Gilles Muller, Michal Marek
On Thu, 26 Oct 2017, Masahiro Yamada wrote:
> Currently, the required version for badzero.cocci is picked up from
> its "Comments:" line since it contains the word "Requires".
>
> Surprisingly, ld-version.sh can extract the version number from the
> string "Requires Coccinelle version 1.0.0-rc20 or later", but this
> expectation is fragile. Fix the .cocci file. I removed "-rc20"
> because ld-version.sh cannot handle it.
OK.
> Make the coccicheck script to see exact patterns for "Options:" and
> "Requires:" in order to avoid accidental matching to what just happens
> to appear in comment lines.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Thanks for checking on this!
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
> ---
>
> scripts/coccicheck | 4 ++--
> scripts/coccinelle/null/badzero.cocci | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/coccicheck b/scripts/coccicheck
> index 3e21a1b..1bfa2d2 100755
> --- a/scripts/coccicheck
> +++ b/scripts/coccicheck
> @@ -168,8 +168,8 @@ OPTIONS="$OPTIONS $SPFLAGS"
> coccinelle () {
> COCCI="$1"
>
> - OPT=`grep "Option" $COCCI | cut -d':' -f2`
> - REQ=`grep "Requires" $COCCI | cut -d':' -f2 | sed "s| ||"`
> + OPT=`grep "Options:" $COCCI | cut -d':' -f2`
> + REQ=`grep "Requires:" $COCCI | cut -d':' -f2 | sed "s| ||"`
> REQ_NUM=$(echo $REQ | ${DIR}/scripts/ld-version.sh)
> if [ "$REQ_NUM" != "0" ] ; then
> if [ "$SPATCH_VERSION_NUM" -lt "$REQ_NUM" ] ; then
> diff --git a/scripts/coccinelle/null/badzero.cocci b/scripts/coccinelle/null/badzero.cocci
> index 5551da2..f597c80 100644
> --- a/scripts/coccinelle/null/badzero.cocci
> +++ b/scripts/coccinelle/null/badzero.cocci
> @@ -10,7 +10,7 @@
> // Copyright: (C) 2012 Julia Lawall, INRIA/LIP6. GPLv2.
> // Copyright: (C) 2012 Gilles Muller, INRIA/LiP6. GPLv2.
> // URL: http://coccinelle.lip6.fr/
> -// Comments: Requires Coccinelle version 1.0.0-rc20 or later
> +// Requires: 1.0.0
> // Options:
>
> virtual patch
> --
> 2.7.4
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] coccinelle: grep Options and Requires fields more precisely
2017-10-26 4:59 ` Julia Lawall
@ 2017-10-26 7:26 ` Nicolas Palix (LIG)
2017-11-07 0:27 ` Masahiro Yamada
0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Palix (LIG) @ 2017-10-26 7:26 UTC (permalink / raw)
To: Julia Lawall, Masahiro Yamada
Cc: cocci, linux-kbuild, linux-kernel, Gilles Muller, Michal Marek
[-- Attachment #1: Type: text/plain, Size: 2375 bytes --]
Le 26/10/17 à 06:59, Julia Lawall a écrit :
>
>
> On Thu, 26 Oct 2017, Masahiro Yamada wrote:
>
>> Currently, the required version for badzero.cocci is picked up from
>> its "Comments:" line since it contains the word "Requires".
>>
>> Surprisingly, ld-version.sh can extract the version number from the
>> string "Requires Coccinelle version 1.0.0-rc20 or later", but this
>> expectation is fragile. Fix the .cocci file. I removed "-rc20"
>> because ld-version.sh cannot handle it.
>
> OK.
>
>> Make the coccicheck script to see exact patterns for "Options:" and
>> "Requires:" in order to avoid accidental matching to what just happens
>> to appear in comment lines.
>>
>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>
> Thanks for checking on this!
>
> Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Acked-by: Nicolas Palix <nicolas.palix@imag.fr>
>
>> ---
>>
>> scripts/coccicheck | 4 ++--
>> scripts/coccinelle/null/badzero.cocci | 2 +-
>> 2 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/scripts/coccicheck b/scripts/coccicheck
>> index 3e21a1b..1bfa2d2 100755
>> --- a/scripts/coccicheck
>> +++ b/scripts/coccicheck
>> @@ -168,8 +168,8 @@ OPTIONS="$OPTIONS $SPFLAGS"
>> coccinelle () {
>> COCCI="$1"
>>
>> - OPT=`grep "Option" $COCCI | cut -d':' -f2`
>> - REQ=`grep "Requires" $COCCI | cut -d':' -f2 | sed "s| ||"`
>> + OPT=`grep "Options:" $COCCI | cut -d':' -f2`
>> + REQ=`grep "Requires:" $COCCI | cut -d':' -f2 | sed "s| ||"`
>> REQ_NUM=$(echo $REQ | ${DIR}/scripts/ld-version.sh)
>> if [ "$REQ_NUM" != "0" ] ; then
>> if [ "$SPATCH_VERSION_NUM" -lt "$REQ_NUM" ] ; then
>> diff --git a/scripts/coccinelle/null/badzero.cocci b/scripts/coccinelle/null/badzero.cocci
>> index 5551da2..f597c80 100644
>> --- a/scripts/coccinelle/null/badzero.cocci
>> +++ b/scripts/coccinelle/null/badzero.cocci
>> @@ -10,7 +10,7 @@
>> // Copyright: (C) 2012 Julia Lawall, INRIA/LIP6. GPLv2.
>> // Copyright: (C) 2012 Gilles Muller, INRIA/LiP6. GPLv2.
>> // URL: http://coccinelle.lip6.fr/
>> -// Comments: Requires Coccinelle version 1.0.0-rc20 or later
>> +// Requires: 1.0.0
>> // Options:
>>
>> virtual patch
>> --
>> 2.7.4
>>
>>
--
Nicolas Palix
http://lig-membres.imag.fr/palix/
[-- Attachment #2: Signature cryptographique S/MIME --]
[-- Type: application/pkcs7-signature, Size: 2959 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] coccinelle: grep Options and Requires fields more precisely
2017-10-26 7:26 ` Nicolas Palix (LIG)
@ 2017-11-07 0:27 ` Masahiro Yamada
2017-11-08 13:03 ` Julia Lawall
0 siblings, 1 reply; 5+ messages in thread
From: Masahiro Yamada @ 2017-11-07 0:27 UTC (permalink / raw)
To: Nicolas Palix (LIG)
Cc: Julia Lawall, cocci, Linux Kbuild mailing list,
Linux Kernel Mailing List, Gilles Muller, Michal Marek
2017-10-26 16:26 GMT+09:00 Nicolas Palix (LIG) <Nicolas.Palix@imag.fr>:
> Le 26/10/17 à 06:59, Julia Lawall a écrit :
>>
>>
>>
>> On Thu, 26 Oct 2017, Masahiro Yamada wrote:
>>
>>> Currently, the required version for badzero.cocci is picked up from
>>> its "Comments:" line since it contains the word "Requires".
>>>
>>> Surprisingly, ld-version.sh can extract the version number from the
>>> string "Requires Coccinelle version 1.0.0-rc20 or later", but this
>>> expectation is fragile. Fix the .cocci file. I removed "-rc20"
>>> because ld-version.sh cannot handle it.
>>
>>
>> OK.
>>
>>> Make the coccicheck script to see exact patterns for "Options:" and
>>> "Requires:" in order to avoid accidental matching to what just happens
>>> to appear in comment lines.
>>>
>>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>>
>>
>> Thanks for checking on this!
>>
>> Acked-by: Julia Lawall <julia.lawall@lip6.fr>
>
> Acked-by: Nicolas Palix <nicolas.palix@imag.fr>
>
>>
>>> ---
>>>
>>> scripts/coccicheck | 4 ++--
>>> scripts/coccinelle/null/badzero.cocci | 2 +-
>>> 2 files changed, 3 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/scripts/coccicheck b/scripts/coccicheck
>>> index 3e21a1b..1bfa2d2 100755
>>> --- a/scripts/coccicheck
>>> +++ b/scripts/coccicheck
>>> @@ -168,8 +168,8 @@ OPTIONS="$OPTIONS $SPFLAGS"
>>> coccinelle () {
>>> COCCI="$1"
>>>
>>> - OPT=`grep "Option" $COCCI | cut -d':' -f2`
>>> - REQ=`grep "Requires" $COCCI | cut -d':' -f2 | sed "s| ||"`
>>> + OPT=`grep "Options:" $COCCI | cut -d':' -f2`
>>> + REQ=`grep "Requires:" $COCCI | cut -d':' -f2 | sed "s| ||"`
>>> REQ_NUM=$(echo $REQ | ${DIR}/scripts/ld-version.sh)
>>> if [ "$REQ_NUM" != "0" ] ; then
>>> if [ "$SPATCH_VERSION_NUM" -lt "$REQ_NUM" ] ; then
>>> diff --git a/scripts/coccinelle/null/badzero.cocci
>>> b/scripts/coccinelle/null/badzero.cocci
>>> index 5551da2..f597c80 100644
>>> --- a/scripts/coccinelle/null/badzero.cocci
>>> +++ b/scripts/coccinelle/null/badzero.cocci
>>> @@ -10,7 +10,7 @@
>>> // Copyright: (C) 2012 Julia Lawall, INRIA/LIP6. GPLv2.
>>> // Copyright: (C) 2012 Gilles Muller, INRIA/LiP6. GPLv2.
>>> // URL: http://coccinelle.lip6.fr/
>>> -// Comments: Requires Coccinelle version 1.0.0-rc20 or later
>>> +// Requires: 1.0.0
>>> // Options:
>>>
>>> virtual patch
>>> --
>>> 2.7.4
>>>
>>>
>
>
> --
> Nicolas Palix
> http://lig-membres.imag.fr/palix/
>
Applied to linux-kbuild/misc.
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] coccinelle: grep Options and Requires fields more precisely
2017-11-07 0:27 ` Masahiro Yamada
@ 2017-11-08 13:03 ` Julia Lawall
0 siblings, 0 replies; 5+ messages in thread
From: Julia Lawall @ 2017-11-08 13:03 UTC (permalink / raw)
To: Masahiro Yamada
Cc: Nicolas Palix (LIG),
Julia Lawall, cocci, Linux Kbuild mailing list,
Linux Kernel Mailing List, Gilles Muller, Michal Marek
[-- Attachment #1: Type: text/plain, Size: 2715 bytes --]
On Tue, 7 Nov 2017, Masahiro Yamada wrote:
> 2017-10-26 16:26 GMT+09:00 Nicolas Palix (LIG) <Nicolas.Palix@imag.fr>:
> > Le 26/10/17 à 06:59, Julia Lawall a écrit :
> >>
> >>
> >>
> >> On Thu, 26 Oct 2017, Masahiro Yamada wrote:
> >>
> >>> Currently, the required version for badzero.cocci is picked up from
> >>> its "Comments:" line since it contains the word "Requires".
> >>>
> >>> Surprisingly, ld-version.sh can extract the version number from the
> >>> string "Requires Coccinelle version 1.0.0-rc20 or later", but this
> >>> expectation is fragile. Fix the .cocci file. I removed "-rc20"
> >>> because ld-version.sh cannot handle it.
> >>
> >>
> >> OK.
> >>
> >>> Make the coccicheck script to see exact patterns for "Options:" and
> >>> "Requires:" in order to avoid accidental matching to what just happens
> >>> to appear in comment lines.
> >>>
> >>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> >>
> >>
> >> Thanks for checking on this!
> >>
> >> Acked-by: Julia Lawall <julia.lawall@lip6.fr>
> >
> > Acked-by: Nicolas Palix <nicolas.palix@imag.fr>
> >
> >>
> >>> ---
> >>>
> >>> scripts/coccicheck | 4 ++--
> >>> scripts/coccinelle/null/badzero.cocci | 2 +-
> >>> 2 files changed, 3 insertions(+), 3 deletions(-)
> >>>
> >>> diff --git a/scripts/coccicheck b/scripts/coccicheck
> >>> index 3e21a1b..1bfa2d2 100755
> >>> --- a/scripts/coccicheck
> >>> +++ b/scripts/coccicheck
> >>> @@ -168,8 +168,8 @@ OPTIONS="$OPTIONS $SPFLAGS"
> >>> coccinelle () {
> >>> COCCI="$1"
> >>>
> >>> - OPT=`grep "Option" $COCCI | cut -d':' -f2`
> >>> - REQ=`grep "Requires" $COCCI | cut -d':' -f2 | sed "s| ||"`
> >>> + OPT=`grep "Options:" $COCCI | cut -d':' -f2`
> >>> + REQ=`grep "Requires:" $COCCI | cut -d':' -f2 | sed "s| ||"`
> >>> REQ_NUM=$(echo $REQ | ${DIR}/scripts/ld-version.sh)
> >>> if [ "$REQ_NUM" != "0" ] ; then
> >>> if [ "$SPATCH_VERSION_NUM" -lt "$REQ_NUM" ] ; then
> >>> diff --git a/scripts/coccinelle/null/badzero.cocci
> >>> b/scripts/coccinelle/null/badzero.cocci
> >>> index 5551da2..f597c80 100644
> >>> --- a/scripts/coccinelle/null/badzero.cocci
> >>> +++ b/scripts/coccinelle/null/badzero.cocci
> >>> @@ -10,7 +10,7 @@
> >>> // Copyright: (C) 2012 Julia Lawall, INRIA/LIP6. GPLv2.
> >>> // Copyright: (C) 2012 Gilles Muller, INRIA/LiP6. GPLv2.
> >>> // URL: http://coccinelle.lip6.fr/
> >>> -// Comments: Requires Coccinelle version 1.0.0-rc20 or later
> >>> +// Requires: 1.0.0
> >>> // Options:
> >>>
> >>> virtual patch
> >>> --
> >>> 2.7.4
> >>>
> >>>
> >
> >
> > --
> > Nicolas Palix
> > http://lig-membres.imag.fr/palix/
> >
>
>
> Applied to linux-kbuild/misc.
Thanks!
julia
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-11-08 13:04 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-26 4:50 [PATCH] coccinelle: grep Options and Requires fields more precisely Masahiro Yamada
2017-10-26 4:59 ` Julia Lawall
2017-10-26 7:26 ` Nicolas Palix (LIG)
2017-11-07 0:27 ` Masahiro Yamada
2017-11-08 13:03 ` Julia Lawall
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®