Skip to content

Commit 8952cfe

Browse files
Benjamin-PhilipJuliaLawall
authored andcommitted
scripts: coccicheck: simplify debug file handling
This commit separates handling unset files and pre-existing files. It also eliminates a duplicated check for unset files in run_cmd_parmap(). Signed-off-by: Benjamin Philip <benjamin.philip495@gmail.com> Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
1 parent d79526b commit 8952cfe

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

scripts/coccicheck

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ run_cmd_parmap() {
138138
if [ $VERBOSE -ne 0 ] ; then
139139
echo "Running ($NPROC in parallel): $@"
140140
fi
141-
if [ "$DEBUG_FILE" != "/dev/null" -a "$DEBUG_FILE" != "" ]; then
141+
if [ "$DEBUG_FILE" != "/dev/null" ]; then
142142
echo $@>>$DEBUG_FILE
143143
$@ 2>>$DEBUG_FILE
144144
else
@@ -259,13 +259,13 @@ coccinelle () {
259259

260260
}
261261

262-
if [ "$DEBUG_FILE" != "/dev/null" -a "$DEBUG_FILE" != "" ]; then
263-
if [ -f $DEBUG_FILE ]; then
264-
echo "Debug file $DEBUG_FILE exists, bailing"
265-
exit
266-
fi
267-
else
268-
DEBUG_FILE="/dev/null"
262+
if [ "$DEBUG_FILE" = "" ]; then
263+
DEBUG_FILE="/dev/null"
264+
fi
265+
266+
if [ -f $DEBUG_FILE ]; then
267+
echo "Debug file $DEBUG_FILE exists, bailing"
268+
exit
269269
fi
270270

271271
if [ "$COCCI" = "" ] ; then

0 commit comments

Comments
 (0)