Skip to content

Commit 4ce50e3

Browse files
Update gef-extras.sh (#1207)
1 parent 58de027 commit 4ce50e3

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

scripts/gef-extras.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,20 @@ fi
3737

3838
git clone --branch ${branch} https://github.com/hugsy/gef-extras.git "${DIR}"
3939
ver=$(gdb -q -nx -ex 'pi print(f"{sys.version_info.major}.{sys.version_info.minor}", end="")' -ex quit)
40-
python${ver} -m pip install --requirement "${DIR}"/requirements.txt --upgrade
40+
echo "[+] Installing gef-extras dependencies..."
41+
pip_output=$(python${ver} -m pip install --requirement "${DIR}/requirements.txt" --upgrade 2>&1) || failed=1
42+
43+
if [ "$failed" = "1" ]; then
44+
if echo "$pip_output" | grep -qi "externally-managed-environment"; then
45+
echo "[!] Detected externally-managed-environment, retrying with --break-system-packages ..."
46+
python${ver} -m pip install --requirement "${DIR}/requirements.txt" --upgrade --break-system-packages
47+
else
48+
echo "[!] pip failed with unknown error:"
49+
echo "$pip_output"
50+
exit 1
51+
fi
52+
fi
53+
4154
gdb -q -ex "pi gef.config['context.layout'] += ' syscall_args'" \
4255
-ex "pi gef.config['context.layout'] += ' libc_function_args'" \
4356
-ex "gef config gef.extra_plugins_dir '${DIR}/scripts'" \

0 commit comments

Comments
 (0)