From 5dc902232f12e98c9e0138f285c84e466ea6b518 Mon Sep 17 00:00:00 2001 From: Hanoh Haim Date: Mon, 28 Dec 2015 11:50:38 +0200 Subject: add bcov utility for coverity --- linux_dpdk/bcov | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 linux_dpdk/bcov diff --git a/linux_dpdk/bcov b/linux_dpdk/bcov new file mode 100644 index 00000000..7eb76fa7 --- /dev/null +++ b/linux_dpdk/bcov @@ -0,0 +1,32 @@ +#!/bin/bash + +# if no variable of $PYTHON is define - we try to find it +function find_python { + # two candidates - machine python and cisco linux python + MACHINE_PYTHON=python + CEL_PYTHON=/router/bin/python + + # try the machine python + PYTHON=$MACHINE_PYTHON + + PCHECK=`$PYTHON -c "import sys; ver = sys.version_info[0] * 10 + sys.version_info[1];sys.exit(ver < 27)"` + if [ $? -ne 0 ]; then + PYTHON=$CEL_PYTHON + PCHECK=`$PYTHON -c "import sys; ver = sys.version_info[0] * 10 + sys.version_info[1];sys.exit(ver < 27)"` + + if [ $? -ne 0 ]; then + echo "*** $PYTHON - python version is too old, 2.7 at least is required" + exit -1 + fi + + fi + +} + +if [ -z "$PYTHON" ]; then + find_python +fi + +$PYTHON cov.py $@ + + -- cgit