Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 03ee0c42 authored by Nicolas Palix's avatar Nicolas Palix Committed by Michal Marek
Browse files

Coccinelle: Use the -no_show_diff option for org and report mode



This allows to write the semantic patches with code sharing
for the matching parts.

Signed-off-by: default avatarNicolas Palix <npalix.work@gmail.com>
Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
Signed-off-by: default avatarMichal Marek <mmarek@suse.cz>
parent 2c1160c8
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -31,6 +31,8 @@ if [ "$MODE" = "" ] ; then
	echo 'You can specify the mode with "make coccicheck MODE=<mode>"'
    fi
    MODE="chain"
elif [ "$MODE" = "report" -o "$MODE" = "org" ] ; then
    FLAGS="$FLAGS -no_show_diff"    
fi

if [ "$ONLINE" = "0" ] ; then
@@ -76,9 +78,9 @@ coccinelle () {

    if [ "$MODE" = "chain" ] ; then
	$SPATCH -D patch   $FLAGS -sp_file $COCCI $OPT $OPTIONS               || \
	$SPATCH -D report  $FLAGS -sp_file $COCCI $OPT $OPTIONS || \
	$SPATCH -D report  $FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff || \
	$SPATCH -D context $FLAGS -sp_file $COCCI $OPT $OPTIONS               || \
	$SPATCH -D org     $FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1
	$SPATCH -D org     $FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff || exit 1
    else
	$SPATCH -D $MODE   $FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1
    fi