Add environment variable detection support to _autosetup

This commit is contained in:
Manatsawin Hanmongkolchai 2016-02-27 15:16:06 +07:00
parent 45bff1ed17
commit dbb60355bb
1 changed files with 28 additions and 23 deletions

View File

@ -25,6 +25,11 @@ check_version()
desired=`echo $2 | awk -F. '{print $1*100+$2}'`
echo $ECHO_N "Checking version of '$1' >= $desired... $ECHO_C"
name=$1
app_var_name=`echo $name | tr '[:lower:]-' '[:upper:]_'`
if [ ! -z ${!app_var_name+x} ]; then
name=${!app_var_name}
fi
fullpath=`type $name | awk '{ print $(NF) }'`;
if [ -x "$fullpath" ]; then
foundit=yes;