diff options
author | hexcoder- <heiko@hexco.de> | 2020-03-21 10:59:58 +0100 |
---|---|---|
committer | hexcoder- <heiko@hexco.de> | 2020-03-21 10:59:58 +0100 |
commit | 350530f664125c355ac56f759ae26dd602ade06e (patch) | |
tree | 42371f5e197d439ad7000f5cacf96d153f009a7d | |
parent | dabce05ec601b07ba04ef1056e40edfe54a41111 (diff) | |
download | afl++-350530f664125c355ac56f759ae26dd602ade06e.tar.gz |
unicorn build script: list all missing prereqs in one invocation,
replace which with type
-rwxr-xr-x | unicorn_mode/build_unicorn_support.sh | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/unicorn_mode/build_unicorn_support.sh b/unicorn_mode/build_unicorn_support.sh index d1873cc1..540c524a 100755 --- a/unicorn_mode/build_unicorn_support.sh +++ b/unicorn_mode/build_unicorn_support.sh @@ -90,26 +90,27 @@ if [ "$PLT" = "NetBSD" ] || [ "$PLT" = "OpenBSD" ]; then TARCMD=gtar fi +PREREQ_NOTFOUND= for i in $PYTHONBIN automake autoconf git $MAKECMD $TARCMD; do - T=`which "$i" 2>/dev/null` + T=`type "$i" | awk '{print $NF}' 2>/dev/null` if [ "$T" = "" ]; then echo "[-] Error: '$i' not found. Run 'sudo apt-get install $i' or similar." - exit 1 + PREREQ_NOTFOUND=1 fi done -if ! which $EASY_INSTALL > /dev/null; then +if ! type $EASY_INSTALL > /dev/null; then # work around for unusual installs if [ '!' -e /usr/lib/python2.7/dist-packages/easy_install.py ] && [ '!' -e /usr/local/lib/python2.7/dist-packages/easy_install.py ] && [ '!' -e /usr/pkg/lib/python2.7/dist-packages/easy_install.py ]; then echo "[-] Error: Python setup-tools not found. Run 'sudo apt-get install python-setuptools'." - exit 1 + PREREQ_NOTFOUND=1 fi @@ -118,8 +119,12 @@ fi if echo "$CC" | grep -qF /afl-; then echo "[-] Error: do not use afl-gcc or afl-clang to compile this tool." - exit 1 + PREREQ_NOTFOUND=1 + +fi +if [ "$PREREQ_NOTFOUND" == "1" ]; then + exit 1 fi echo "[+] All checks passed!" |