diff options
author | 2016-01-04 23:31:31 +0200 | |
---|---|---|
committer | 2016-01-04 23:31:31 +0200 | |
commit | 629b54c4c9df9c718d818a004ecf15c2cf6c770a (patch) | |
tree | 7dfc3c64c7561032d690ce6188130e80d344054e /linux_dpdk/bcov | |
parent | 3757099103ed1bf56f85ccf5bb861a331287cbbb (diff) | |
parent | 857bdcf05a920b99e1cf180c700176b04801da00 (diff) |
Merge branch 'master' into dan_stateless
Diffstat (limited to 'linux_dpdk/bcov')
-rw-r--r-- | linux_dpdk/bcov | 32 |
1 files changed, 32 insertions, 0 deletions
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 $@ + + |