Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix install with pip v23+ #500

Merged
merged 2 commits into from
Feb 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion installer/I01_default_apps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ I01_default_apps(){
#sudo -u linuxbrew CI=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
sudo -u linuxbrew CI=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

pip3 install -U requests --break-system-packages 2>/dev/null || true
pip_install "requests" "-U"
;;
esac
fi
Expand Down
2 changes: 1 addition & 1 deletion installer/I01_default_apps_host.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ I01_default_apps_host() {
y|Y )
echo
apt-get install "${INSTALL_APP_LIST[@]}" -y
pip3 install -U requests --break-system-packages 2>/dev/null || true
pip_install "requests" "-U"
;;
esac
}
10 changes: 5 additions & 5 deletions installer/I02_UEFI_fwhunt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ I02_UEFI_fwhunt() {
case ${ANSWER:0:1} in
y|Y )

pip3 install rzpipe --break-system-packages 2>/dev/null
pip3 install click --break-system-packages 2>/dev/null
pip3 install pyyaml --break-system-packages 2>/dev/null
pip3 install uefi_firmware --break-system-packages 2>/dev/null
pip_install "rzpipe"
pip_install "click"
pip_install "pyyaml"
pip_install "uefi_firmware"

# rizin:
apt-get install "${INSTALL_APP_LIST[@]}" -y --no-install-recommends
Expand Down Expand Up @@ -79,7 +79,7 @@ I02_UEFI_fwhunt() {
# ldconfig
# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib64/
# python3 setup.py install
pip3 install fwhunt-scan --break-system-packages
pip_install "fwhunt-scan"
cd "$HOME_PATH" || ( echo "Could not install EMBA component fwhunt-scan" && exit 1 )
;;
esac
Expand Down
2 changes: 1 addition & 1 deletion installer/I108_stacs_password_search.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ I108_stacs_password_search() {
git clone https://github.com/stacscan/stacs.git external/stacs
fi
cd ./external/stacs || ( echo "Could not install EMBA component STACS" && exit 1 )
pip3 install -U setuptools --break-system-packages
pip_install "setuptools" "-U"
python3 setup.py install
cd "$HOME_PATH" || ( echo "Could not install EMBA component STACS" && exit 1 )

Expand Down
2 changes: 1 addition & 1 deletion installer/I199_default_tools_github.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ I199_default_tools_github() {
download_file "EnGenius decryptor" "https://raw.githubusercontent.com/EMBA-support-repos/enfringement/main/decrypt.py" "external/engenius-decrypt.py"

# pixd installation
pip3 install pillow --break-system-packages
pip_install "pillow"
echo -e "\\n""$ORANGE""$BOLD""Downloading of pixd""$NC"
git clone https://github.com/p4cx/pixd_image external/pixd
cd ./external/pixd/ || ( echo "Could not install EMBA component pixd" && exit 1 )
Expand Down
2 changes: 1 addition & 1 deletion installer/I20_sourcecode_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ I20_sourcecode_check() {
y|Y )
apt-get install "${INSTALL_APP_LIST[@]}" -y --no-install-recommends

pip3 install semgrep --break-system-packages
pip_install "semgrep"
if ! [[ -d external/semgrep-rules ]]; then
git clone https://github.com/returntocorp/semgrep-rules.git external/semgrep-rules
fi
Expand Down
4 changes: 2 additions & 2 deletions installer/I24_25_kernel_tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ I24_25_kernel_tools() {
fi

cd external/vmlinux-to-elf || ( echo "Could not install EMBA component vmlinux-to-elf" && exit 1 )
pip3 install --upgrade git+https://github.com/EMBA-support-repos/vmlinux-to-elf --break-system-packages
pip3 install "python-lzo>=1.14" --break-system-packages
pip_install "git+https://github.com/EMBA-support-repos/vmlinux-to-elf" -U
pip_install "python-lzo>=1.14"
cd "$HOME_PATH" || ( echo "Could not install EMBA component vmlinux-to-elf" && exit 1 )

if ! [[ -d external/kconfig-hardened-check ]]; then
Expand Down
30 changes: 15 additions & 15 deletions installer/IF20_cve_search.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,21 @@ IF20_cve_search() {

# we do not need to install the Flask web environment - we do it manually
# python3 -m pip install -r requirements.txt
pip3 install requests==2.28.1 --break-system-packages
pip3 install Whoosh==2.7.4 --break-system-packages
pip3 install tqdm==4.64.0 --break-system-packages
pip3 install pymongo==3.12.1 --break-system-packages
pip3 install dicttoxml==1.7.4 --break-system-packages
pip3 install redis==4.2.2 --break-system-packages
pip3 install ijson==3.1.4 --break-system-packages
pip3 install jsonpickle==3.0.1 --break-system-packages
pip3 install requirements-parser==0.5.0 --break-system-packages
pip3 install ansicolors==1.1.8 --break-system-packages
pip3 install nltk==3.7 --break-system-packages
pip3 install nested-lookup==0.2.25 --break-system-packages
pip3 install dnspython==2.2.1 --break-system-packages
pip3 install Werkzeug --break-system-packages
pip3 install python-dateutil --break-system-packages
pip_install "requests==2.28.1"
pip_install "Whoosh==2.7.4"
pip_install "tqdm==4.64.0"
pip_install "pymongo==3.12.1"
pip_install "dicttoxml==1.7.4"
pip_install "redis==4.2.2"
pip_install "ijson==3.1.4"
pip_install "jsonpickle==3.0.1"
pip_install "requirements-parser==0.5.0"
pip_install "ansicolors==1.1.8"
pip_install "nltk==3.7"
pip_install "nested-lookup==0.2.25"
pip_install "dnspython==2.2.1"
pip_install "Werkzeug"
pip_install "python-dateutil"

REDIS_PW="$(tr -dc A-Za-z0-9 </dev/urandom | head -c 13 || true)"

Expand Down
2 changes: 1 addition & 1 deletion installer/IF50_aggregator_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ IF50_aggregator_common() {
case ${ANSWER:0:1} in
y|Y )
apt-get install "${INSTALL_APP_LIST[@]}" -y --no-install-recommends
pip3 install cve_searchsploit --break-system-packages
pip_install "cve_searchsploit"

# we try to avoid downloading the exploit-database multiple times:
CVE_SEARCH_PATH=$(pip3 show cve-searchsploit | grep "Location" | awk '{print $2}')
Expand Down
10 changes: 5 additions & 5 deletions installer/IP00_extractors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ IP00_extractors(){
echo

apt-get install "${INSTALL_APP_LIST[@]}" -y --no-install-recommends
pip3 install -U setuptools --break-system-packages
pip3 install -U wheel --break-system-packages
pip3 install protobuf --break-system-packages
pip3 install bsdiff4 --break-system-packages
pip3 install "python-lzo>=1.14" --break-system-packages
pip_install "setuptools" "-U"
pip_install "wheel" "-U"
pip_install "protobuf"
pip_install "bsdiff4"
pip_install "python-lzo>=1.14"

if ! [[ -d external/payload_dumper ]]; then
git clone https://github.com/EMBA-support-repos/payload_dumper.git external/payload_dumper
Expand Down
14 changes: 7 additions & 7 deletions installer/IP99_binwalk_default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ IP99_binwalk_default() {
y|Y )
apt-get install "${INSTALL_APP_LIST[@]}" -y --no-install-recommends

pip3 install nose --break-system-packages
pip3 install coverage --break-system-packages
pip3 install pyqtgraph --break-system-packages
pip3 install capstone --break-system-packages
pip3 install cstruct --break-system-packages
pip3 install matplotlib --break-system-packages
pip3 install "python-lzo>=1.14" --break-system-packages
pip_install "nose"
pip_install "coverage"
pip_install "pyqtgraph"
pip_install "capstone"
pip_install "cstruct"
pip_install "matplotlib"
pip_install "python-lzo>=1.14"

if ! [[ -d external/binwalk ]]; then
# git clone https://github.com/ReFirmLabs/binwalk.git external/binwalk
Expand Down
12 changes: 12 additions & 0 deletions installer/helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,18 @@ print_pip_info() {
fi
}

pip_install() {
local PIP_NAME="${1:-}"
local PIP_OPTS="${2:-}"
local PIP_VERS=""
PIP_VERS=$(pip3 -V | awk '{print $2}')
if [[ "$(version "$PIP_VERS")" -lt "$(version "23")" ]]; then
pip3 install "$PIP_NAME" "$PIP_OPTS"
else
pip3 install "$PIP_NAME" --break-system-packages "$PIP_OPTS"
fi
}

# print_file_info a b c d e
# a = file name
# b = description of file
Expand Down