Commit 8952cfe4 authored by Benjamin Philip's avatar Benjamin Philip Committed by Julia Lawall
Browse files

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: default avatarBenjamin Philip <benjamin.philip495@gmail.com>
Signed-off-by: default avatarJulia Lawall <julia.lawall@inria.fr>
parent d79526b8
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -138,7 +138,7 @@ run_cmd_parmap() {
	if [ $VERBOSE -ne 0 ] ; then
		echo "Running ($NPROC in parallel): $@"
	fi
	if [ "$DEBUG_FILE" != "/dev/null" -a "$DEBUG_FILE" != "" ]; then
	if [ "$DEBUG_FILE" != "/dev/null" ]; then
                echo $@>>$DEBUG_FILE
                $@ 2>>$DEBUG_FILE
        else
@@ -259,14 +259,14 @@ coccinelle () {

}

if [ "$DEBUG_FILE" != "/dev/null" -a "$DEBUG_FILE" != "" ]; then
if [ "$DEBUG_FILE" = "" ]; then
    DEBUG_FILE="/dev/null"
fi

if [ -f $DEBUG_FILE ]; then
	echo "Debug file $DEBUG_FILE exists, bailing"
	exit
fi
else
	DEBUG_FILE="/dev/null"
fi

if [ "$COCCI" = "" ] ; then
    for f in `find $srctree/scripts/coccinelle/ -name '*.cocci' -type f | sort`; do