Commit 5303265a48eb276b8cdee84f8e91e7f971224c5e
Committed by
Michal Marek
1 parent
26e5672091
Exists in
master
and in
20 other branches
coccicheck: Allow to show the executed command line
On my system one of the tests failed with "Fatal error: exception Failure("No OCaml compiler found! Install either ocamlopt or ocamlopt.opt")". Investigating such issues is easier if the executed command line is being shown. Signed-off-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de> CC: Julia Lawall <Julia.Lawall@lip6.fr> Acked-by: Nicolas Palix <nicolas.palix@imag.fr> Signed-off-by: Michal Marek <mmarek@suse.cz>
Showing 1 changed file with 21 additions and 7 deletions Side-by-side Diff
scripts/coccicheck
... | ... | @@ -55,6 +55,14 @@ |
55 | 55 | echo '' |
56 | 56 | fi |
57 | 57 | |
58 | +run_cmd() { | |
59 | + if [ $VERBOSE -ne 0 ] ; then | |
60 | + echo "Running: $@" | |
61 | + fi | |
62 | + eval $@ | |
63 | +} | |
64 | + | |
65 | + | |
58 | 66 | coccinelle () { |
59 | 67 | COCCI="$1" |
60 | 68 | |
61 | 69 | |
62 | 70 | |
... | ... | @@ -100,15 +108,21 @@ |
100 | 108 | fi |
101 | 109 | |
102 | 110 | if [ "$MODE" = "chain" ] ; then |
103 | - $SPATCH -D patch $FLAGS -sp_file $COCCI $OPT $OPTIONS || \ | |
104 | - $SPATCH -D report $FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff || \ | |
105 | - $SPATCH -D context $FLAGS -sp_file $COCCI $OPT $OPTIONS || \ | |
106 | - $SPATCH -D org $FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff || exit 1 | |
111 | + run_cmd $SPATCH -D patch \ | |
112 | + $FLAGS -sp_file $COCCI $OPT $OPTIONS || \ | |
113 | + run_cmd $SPATCH -D report \ | |
114 | + $FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff || \ | |
115 | + run_cmd $SPATCH -D context \ | |
116 | + $FLAGS -sp_file $COCCI $OPT $OPTIONS || \ | |
117 | + run_cmd $SPATCH -D org \ | |
118 | + $FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff || exit 1 | |
107 | 119 | elif [ "$MODE" = "rep+ctxt" ] ; then |
108 | - $SPATCH -D report $FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff && \ | |
109 | - $SPATCH -D context $FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1 | |
120 | + run_cmd $SPATCH -D report \ | |
121 | + $FLAGS -sp_file $COCCI $OPT $OPTIONS -no_show_diff && \ | |
122 | + run_cmd $SPATCH -D context \ | |
123 | + $FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1 | |
110 | 124 | else |
111 | - $SPATCH -D $MODE $FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1 | |
125 | + run_cmd $SPATCH -D $MODE $FLAGS -sp_file $COCCI $OPT $OPTIONS || exit 1 | |
112 | 126 | fi |
113 | 127 | |
114 | 128 | } |