#!/bin/sh # Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: $ [ -z "${FEATURE_FLAWFINDER_MINLEVEL}" ] && export FEATURE_FLAWFINDER_MINLEVEL=5 if [ "$PWD" = "${S}" -a "`has flawfinder ${FEATURES}`" != "" -a -x /usr/bin/flawfinder ]; then c_files="`find ${S} -name '*.c' -o -name '*.cpp'`" flaws="" if [ -n "$c_files" ]; then c_count=`echo ${c_files} | tr ' ' '\n' | wc -l | awk '{print $1}'` einfo "Running flawfinder on [$c_count] files" flaws=$(flawfinder --quiet --dataonly --minlevel=${FEATURE_FLAWFINDER_MINLEVEL} ${c_files}) if [ -n "$flaws" ]; then echo -ne "\a"; sleep 0,25 &>/dev/null; echo -ne "\a"; sleep 0,25 &>/dev/null echo -ne "\a"; sleep 0,25 &>/dev/null; echo -ne "\a"; sleep 0,25 &>/dev/null ewarn "$flaws" i=5 while [ $i != 0 ]; do echo -ne ".\a" sleep 0.25 i=$(($i - 1)) done has interactive ${FEATURES} && read -p "- Press Enter To Continue or CTRL+C to abort" fi fi fi