From 1eb81fdf36a165ea2703b6ccdc96ec2ece9dbfc1 Mon Sep 17 00:00:00 2001 From: hexcoder- Date: Sat, 4 Apr 2020 18:38:38 +0200 Subject: [PATCH] unicorn_mode build script: find setuptools more reliably --- unicorn_mode/build_unicorn_support.sh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) mode change 100755 => 100644 unicorn_mode/build_unicorn_support.sh diff --git a/unicorn_mode/build_unicorn_support.sh b/unicorn_mode/build_unicorn_support.sh old mode 100755 new mode 100644 index a8999dca..0d915238 --- a/unicorn_mode/build_unicorn_support.sh +++ b/unicorn_mode/build_unicorn_support.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#! /bin/sh # # american fuzzy lop++ - unicorn mode build script # ------------------------------------------------ @@ -107,8 +107,21 @@ done 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 + # work around for installs with executable easy_install + EASY_INSTALL_FOUND=0 + MYPYTHONPATH=`python -v &1 >/dev/null | sed -n -e '/^# \/.*\/os.py/{ s/.*matches //; s/os.py$//; p}'` + for PATHCANDIDATE in \ + "dist-packages/" \ + "site-packages/" + do + if [ -e "${MYPYTHONPATH}/${PATHCANDIDATE}/easy_install.py" ] ; then + + EASY_INSTALL_FOUND=1 + break + + fi + done + if [ '!' $EASY_INSTALL_FOUND ]; then echo "[-] Error: Python setup-tools not found. Run 'sudo apt-get install python-setuptools'." PREREQ_NOTFOUND=1