lkml.org 
[lkml]   [2017]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] coccinelle: fix verbose message about .cocci file being run
On Wed, Oct 25, 2017 at 9:55 PM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> If you run coccicheck with V=1 and COCCI=, you will see a strange
> path to the semantic patch file. For example, run the following:
>
> $ make V=1 COCCI=scripts/coccinelle/free/kfree.cocci coccicheck
> [ snip ]
> The semantic patch that makes this report is available
> in scriptcoccinelle/free/kfree.cocci.
>
> Notice "s/" was dropped from "scripts/coccinelle/free/kfree.cocci".
>
> When running coccicheck without O=, $srctree is expanded to ".", which
> represents one arbitrary character in the regular expression. Using
> sed is not a good choice here. Strip $srctree/ simply without sed.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
> scripts/coccicheck | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/coccicheck b/scripts/coccicheck
> index 1bfa2d2..9d18662 100755
> --- a/scripts/coccicheck
> +++ b/scripts/coccicheck
> @@ -186,7 +186,7 @@ coccinelle () {
>
> if [ $VERBOSE -ne 0 -a $ONLINE -eq 0 ] ; then
>
> - FILE=`echo $COCCI | sed "s|$srctree/||"`
> + FILE=${COCCI#$srctree/}

[jim@krebstar linux-rc]$ make CONFIG_SHELL=dash V=1
COCCI=scripts/coccinelle/free/kfree.cocci coccicheck
dash ./scripts/coccicheck
./scripts/coccicheck: 63: ./scripts/coccicheck: Bad substitution
make: *** [Makefile:1585: coccicheck] Error 2

--
Jim

\
 
 \ /
  Last update: 2017-10-28 20:22    [W:0.131 / U:0.400 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site