Skip to content

Commit 609a5c3

Browse files
tools/setup: skip native package managers if we can (commaai#38112)
* tools/setup: skip native package managers if we can * revert that
1 parent d937401 commit 609a5c3

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

tools/setup_dependencies.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,19 @@ function install_linux_deps() {
3030
SUDO="sudo"
3131
fi
3232

33+
local missing_linux_deps=0
34+
for cmd in gcc g++ make curl curl-config git; do
35+
if ! command -v "$cmd" > /dev/null 2>&1; then
36+
missing_linux_deps=1
37+
break
38+
fi
39+
done
40+
3341
# normal stuff, this mostly for bare docker images
34-
if command -v apt-get > /dev/null 2>&1; then
42+
if [[ "$missing_linux_deps" -eq 0 ]]; then
43+
# the native package managers are slow, so skip if we canNM_CONNECTIONS_DIRS
44+
echo "[ ] system packages already installed t=$SECONDS"
45+
elif command -v apt-get > /dev/null 2>&1; then
3546
$SUDO apt-get update
3647
$SUDO apt-get install -y --no-install-recommends ca-certificates build-essential curl libcurl4-openssl-dev locales git
3748
elif command -v dnf > /dev/null 2>&1; then

0 commit comments

Comments
 (0)