Check if tools/genenv binary dependencies are met.
The check is using the bash-native 'type' instead of which, because which is not always available on all environments. Current implementation only checks for the availability of openssl but this can be easily expanded. Change-Id: I97e8f52ea664ef80901deae9dea8acc93b6e1ca4 Closes-Bug: #1463101
This commit is contained in:
parent
999a51b6f3
commit
24577bdeac
20
tools/genenv
20
tools/genenv
@ -6,6 +6,26 @@
|
||||
#
|
||||
# It also creates a suitable 'openrc' for use with the installed system.
|
||||
|
||||
function check_binarydependencies {
|
||||
local binaries="openssl"
|
||||
local missingbinaries=""
|
||||
local space=""
|
||||
|
||||
for bin in $binaries; do
|
||||
if [[ ! $(type -t $bin) ]]; then
|
||||
missingbinaries+=${space}$bin
|
||||
space=" "
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -n "$missingbinaries" ]; then
|
||||
echo Missing dependencies: $missingbinaries
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
check_binarydependencies
|
||||
|
||||
# Move to top level directory
|
||||
REAL_PATH=$(python -c "import os,sys;print os.path.realpath('$0')")
|
||||
cd "$(dirname "$REAL_PATH")/.."
|
||||
|
Loading…
Reference in New Issue
Block a user