Migration report: validate that bc is installed

Without this the tool reports:

gkotton@ubuntu:~/neutron-lib$ ./tools/migration_report.sh ../vmware-nsx/
You have 2517 total imports
You imported Neutron 477 times
You imported Neutron-Lib 108 times
./tools/migration_report.sh: line 30: bc: command not found
./tools/migration_report.sh: line 31: bc: command not found
./tools/migration_report.sh: line 33: [: : integer expression expected

Closes-bug: #1604438

Change-Id: Ib8236ae214d423c993d9e22035f70af1821af944
This commit is contained in:
Gary Kotton 2016-07-19 07:21:04 -07:00
parent 38d2dc4302
commit cf874bf560
1 changed files with 2 additions and 0 deletions

View File

@ -14,6 +14,8 @@ else
your_project="$1"
fi
command -v bc >/dev/null 2>&1 || { echo "I require bc but it's not installed. Aborting." >&2; exit 1; }
total_imports=$(egrep -R -w "^(import|from)" --exclude-dir=".*tox" $your_project | wc -l)
neutron_imports=$(count_imports neutron $your_project)
lib_imports=$(count_imports neutron_lib $your_project)