From 1dcd66081531f4568a8de69637fc7a3f4ef3214f Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Tue, 13 Aug 2024 21:22:13 -0700 Subject: [PATCH] fix bash + python3 shebangs (#33287) fix shebangs --- launch_chffrplus.sh | 2 +- launch_env.sh | 2 +- launch_openpilot.sh | 2 +- release/build_devel.sh | 2 +- release/build_release.sh | 2 +- release/check-dirty.sh | 2 +- release/check-submodules.sh | 2 +- scripts/apply-pr.sh | 2 +- scripts/build_small.sh | 2 +- scripts/cell.sh | 2 +- scripts/checkout-pr.sh | 2 +- scripts/launch_corolla.sh | 2 +- scripts/lint.sh | 2 +- scripts/retry.sh | 2 +- selfdrive/assets/compress-images.sh | 2 +- selfdrive/assets/strip-svg-metadata.sh | 2 +- selfdrive/car/tests/big_cars_test.sh | 4 ++-- selfdrive/debug/adb.sh | 2 +- selfdrive/modeld/tests/tf_test/build.sh | 2 +- selfdrive/test/scons_build_test.sh | 6 +++--- selfdrive/test/setup_device_ci.sh | 4 ++-- selfdrive/test/setup_vsound.sh | 2 +- selfdrive/ui/installer/continue_openpilot.sh | 2 +- selfdrive/ui/tests/create_test_translations.sh | 2 +- system/hardware/tici/restart_modem.sh | 2 +- tools/joystick/joystickd.py | 2 +- tools/lib/kbhit.py | 2 +- tools/profiling/clpeak/build.sh | 2 +- tools/profiling/ftrace.sh | 2 +- tools/profiling/palanteer/setup.sh | 2 +- tools/profiling/perfetto/build.sh | 2 +- tools/profiling/perfetto/copy.sh | 2 +- tools/profiling/perfetto/record.sh | 2 +- tools/profiling/perfetto/server.sh | 2 +- tools/profiling/perfetto/traces.sh | 2 +- tools/profiling/snapdragon/setup-agnos.sh | 2 +- tools/profiling/snapdragon/setup-profiler.sh | 4 ++-- tools/profiling/watch-irqs.sh | 2 +- tools/rerun/run.sh | 2 +- tools/scripts/save_ubloxraw_stream.py | 2 +- tools/serial/connect.sh | 2 +- tools/sim/launch_openpilot.sh | 2 +- tools/sim/run_bridge.py | 2 +- tools/webcam/start_camerad.sh | 2 +- 44 files changed, 49 insertions(+), 49 deletions(-) diff --git a/launch_chffrplus.sh b/launch_chffrplus.sh index 9256f463a..442a811b1 100755 --- a/launch_chffrplus.sh +++ b/launch_chffrplus.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash if [ -z "$BASEDIR" ]; then BASEDIR="/data/openpilot" diff --git a/launch_env.sh b/launch_env.sh index 81578aff0..1e5bc7b60 100755 --- a/launch_env.sh +++ b/launch_env.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash export OMP_NUM_THREADS=1 export MKL_NUM_THREADS=1 diff --git a/launch_openpilot.sh b/launch_openpilot.sh index 2888814c2..d6e3424c3 100755 --- a/launch_openpilot.sh +++ b/launch_openpilot.sh @@ -1,3 +1,3 @@ -#!/usr/bin/bash +#!/usr/bin/env bash exec ./launch_chffrplus.sh diff --git a/release/build_devel.sh b/release/build_devel.sh index 7fce11ca7..c6d04396f 100755 --- a/release/build_devel.sh +++ b/release/build_devel.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash set -ex DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" diff --git a/release/build_release.sh b/release/build_release.sh index 510df75e5..bcc4b5cde 100755 --- a/release/build_release.sh +++ b/release/build_release.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash set -e set -x diff --git a/release/check-dirty.sh b/release/check-dirty.sh index 9c6389f38..ac049970c 100755 --- a/release/check-dirty.sh +++ b/release/check-dirty.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash set -e DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" diff --git a/release/check-submodules.sh b/release/check-submodules.sh index 5305cecd3..48850deaf 100755 --- a/release/check-submodules.sh +++ b/release/check-submodules.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash while read hash submodule ref; do git -C $submodule fetch --depth 3000 origin master diff --git a/scripts/apply-pr.sh b/scripts/apply-pr.sh index 74f765391..ad0af46b4 100755 --- a/scripts/apply-pr.sh +++ b/scripts/apply-pr.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash if [ $# -eq 0 ]; then echo "usage: $0 " diff --git a/scripts/build_small.sh b/scripts/build_small.sh index 90f55373e..176ca5aaa 100755 --- a/scripts/build_small.sh +++ b/scripts/build_small.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -ex DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" diff --git a/scripts/cell.sh b/scripts/cell.sh index 4ba007a53..310a9694f 100755 --- a/scripts/cell.sh +++ b/scripts/cell.sh @@ -1,3 +1,3 @@ -#!/usr/bin/bash +#!/usr/bin/env bash nmcli connection modify --temporary esim ipv4.route-metric 1 ipv6.route-metric 1 nmcli con up esim diff --git a/scripts/checkout-pr.sh b/scripts/checkout-pr.sh index 43f658bef..eeba816d8 100755 --- a/scripts/checkout-pr.sh +++ b/scripts/checkout-pr.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e if [ $# -eq 0 ]; then diff --git a/scripts/launch_corolla.sh b/scripts/launch_corolla.sh index 4e5bca6ce..926569a1e 100755 --- a/scripts/launch_corolla.sh +++ b/scripts/launch_corolla.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" diff --git a/scripts/lint.sh b/scripts/lint.sh index 2b6fd0718..9f4db8e35 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e RED='\033[0;31m' diff --git a/scripts/retry.sh b/scripts/retry.sh index 4861748e5..23501d755 100755 --- a/scripts/retry.sh +++ b/scripts/retry.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash function fail { echo $1 >&2 diff --git a/selfdrive/assets/compress-images.sh b/selfdrive/assets/compress-images.sh index a1a4f8bb4..de59099bd 100755 --- a/selfdrive/assets/compress-images.sh +++ b/selfdrive/assets/compress-images.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash echo "compressing training guide images" optipng -o7 -strip all training/* diff --git a/selfdrive/assets/strip-svg-metadata.sh b/selfdrive/assets/strip-svg-metadata.sh index a8b35eadd..e51dc9481 100755 --- a/selfdrive/assets/strip-svg-metadata.sh +++ b/selfdrive/assets/strip-svg-metadata.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # sudo apt install scour diff --git a/selfdrive/car/tests/big_cars_test.sh b/selfdrive/car/tests/big_cars_test.sh index af45c9cd1..8b0e96d98 100755 --- a/selfdrive/car/tests/big_cars_test.sh +++ b/selfdrive/car/tests/big_cars_test.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash SCRIPT_DIR=$(dirname "$0") BASEDIR=$(realpath "$SCRIPT_DIR/../../../") @@ -9,4 +9,4 @@ INTERNAL_SEG_CNT=300 FILEREADER_CACHE=1 INTERNAL_SEG_LIST=selfdrive/car/tests/test_models_segs.txt -cd selfdrive/car/tests && pytest test_models.py test_car_interfaces.py \ No newline at end of file +cd selfdrive/car/tests && pytest test_models.py test_car_interfaces.py diff --git a/selfdrive/debug/adb.sh b/selfdrive/debug/adb.sh index 919a82fef..8fa267fd4 100755 --- a/selfdrive/debug/adb.sh +++ b/selfdrive/debug/adb.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash set -e PORT=5555 diff --git a/selfdrive/modeld/tests/tf_test/build.sh b/selfdrive/modeld/tests/tf_test/build.sh index 4e92ca069..df1d24761 100755 --- a/selfdrive/modeld/tests/tf_test/build.sh +++ b/selfdrive/modeld/tests/tf_test/build.sh @@ -1,2 +1,2 @@ -#!/bin/bash +#!/usr/bin/env bash clang++ -I /home/batman/one/external/tensorflow/include/ -L /home/batman/one/external/tensorflow/lib -Wl,-rpath=/home/batman/one/external/tensorflow/lib main.cc -ltensorflow diff --git a/selfdrive/test/scons_build_test.sh b/selfdrive/test/scons_build_test.sh index a3b33f797..efc9469de 100755 --- a/selfdrive/test/scons_build_test.sh +++ b/selfdrive/test/scons_build_test.sh @@ -1,10 +1,10 @@ -#!/bin/bash +#!/usr/bin/env bash SCRIPT_DIR=$(dirname "$0") BASEDIR=$(realpath "$SCRIPT_DIR/../../") cd $BASEDIR -# tests that our build system's dependencies are configured properly, +# tests that our build system's dependencies are configured properly, # needs a machine with lots of cores scons --clean -scons --no-cache --random -j$(nproc) \ No newline at end of file +scons --no-cache --random -j$(nproc) diff --git a/selfdrive/test/setup_device_ci.sh b/selfdrive/test/setup_device_ci.sh index 84dae2582..fdc222e7e 100755 --- a/selfdrive/test/setup_device_ci.sh +++ b/selfdrive/test/setup_device_ci.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash set -e @@ -23,7 +23,7 @@ rm -rf /data/safe_staging/* || true CONTINUE_PATH="/data/continue.sh" tee $CONTINUE_PATH << EOF -#!/usr/bin/bash +#!/usr/bin/env bash sudo abctl --set_success diff --git a/selfdrive/test/setup_vsound.sh b/selfdrive/test/setup_vsound.sh index a6601d0a6..aab149974 100755 --- a/selfdrive/test/setup_vsound.sh +++ b/selfdrive/test/setup_vsound.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash { #start pulseaudio daemon diff --git a/selfdrive/ui/installer/continue_openpilot.sh b/selfdrive/ui/installer/continue_openpilot.sh index 3da67313e..ed41ab6f3 100755 --- a/selfdrive/ui/installer/continue_openpilot.sh +++ b/selfdrive/ui/installer/continue_openpilot.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash cd /data/openpilot exec ./launch_openpilot.sh diff --git a/selfdrive/ui/tests/create_test_translations.sh b/selfdrive/ui/tests/create_test_translations.sh index 451a3cbfb..ed0890d94 100755 --- a/selfdrive/ui/tests/create_test_translations.sh +++ b/selfdrive/ui/tests/create_test_translations.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e diff --git a/system/hardware/tici/restart_modem.sh b/system/hardware/tici/restart_modem.sh index 3c67d9d21..741dc7205 100755 --- a/system/hardware/tici/restart_modem.sh +++ b/system/hardware/tici/restart_modem.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash #nmcli connection modify --temporary lte gsm.home-only yes #nmcli connection modify --temporary lte gsm.auto-config yes diff --git a/tools/joystick/joystickd.py b/tools/joystick/joystickd.py index 176ff25be..6b85be877 100755 --- a/tools/joystick/joystickd.py +++ b/tools/joystick/joystickd.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import os import argparse import threading diff --git a/tools/lib/kbhit.py b/tools/lib/kbhit.py index 4451d02ae..3881ee7d1 100755 --- a/tools/lib/kbhit.py +++ b/tools/lib/kbhit.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import sys import termios import atexit diff --git a/tools/profiling/clpeak/build.sh b/tools/profiling/clpeak/build.sh index 1dcb05cbb..5206ed0c4 100755 --- a/tools/profiling/clpeak/build.sh +++ b/tools/profiling/clpeak/build.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" cd $DIR diff --git a/tools/profiling/ftrace.sh b/tools/profiling/ftrace.sh index fe91a3c0d..7d5d1f5f9 100755 --- a/tools/profiling/ftrace.sh +++ b/tools/profiling/ftrace.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash set -e cd /sys/kernel/tracing diff --git a/tools/profiling/palanteer/setup.sh b/tools/profiling/palanteer/setup.sh index e912a9367..6f115dc86 100755 --- a/tools/profiling/palanteer/setup.sh +++ b/tools/profiling/palanteer/setup.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e diff --git a/tools/profiling/perfetto/build.sh b/tools/profiling/perfetto/build.sh index 448c1d04a..24255ac3b 100755 --- a/tools/profiling/perfetto/build.sh +++ b/tools/profiling/perfetto/build.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash if [ ! -d perfetto ]; then git clone https://android.googlesource.com/platform/external/perfetto/ diff --git a/tools/profiling/perfetto/copy.sh b/tools/profiling/perfetto/copy.sh index 8deca9a6e..b91d49a80 100755 --- a/tools/profiling/perfetto/copy.sh +++ b/tools/profiling/perfetto/copy.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash DEST=tici:/data/openpilot/selfdrive/debug/profiling/perfetto diff --git a/tools/profiling/perfetto/record.sh b/tools/profiling/perfetto/record.sh index 99f216877..9715a7e7e 100755 --- a/tools/profiling/perfetto/record.sh +++ b/tools/profiling/perfetto/record.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" cd $DIR diff --git a/tools/profiling/perfetto/server.sh b/tools/profiling/perfetto/server.sh index 19958c653..103ad9bd8 100755 --- a/tools/profiling/perfetto/server.sh +++ b/tools/profiling/perfetto/server.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash curl -LO https://get.perfetto.dev/trace_processor chmod +x ./trace_processor diff --git a/tools/profiling/perfetto/traces.sh b/tools/profiling/perfetto/traces.sh index 489b04237..17ca89da7 100755 --- a/tools/profiling/perfetto/traces.sh +++ b/tools/profiling/perfetto/traces.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash DEST=tici:/data/openpilot/selfdrive/debug/profiling/perfetto diff --git a/tools/profiling/snapdragon/setup-agnos.sh b/tools/profiling/snapdragon/setup-agnos.sh index f036ca211..9a781bf3c 100755 --- a/tools/profiling/snapdragon/setup-agnos.sh +++ b/tools/profiling/snapdragon/setup-agnos.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # TODO: there's probably a better way to do this diff --git a/tools/profiling/snapdragon/setup-profiler.sh b/tools/profiling/snapdragon/setup-profiler.sh index aaec1bf75..b97c1ae68 100755 --- a/tools/profiling/snapdragon/setup-profiler.sh +++ b/tools/profiling/snapdragon/setup-profiler.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # install depends sudo apt update @@ -11,4 +11,4 @@ echo "deb https://download.mono-project.com/repo/ubuntu stable-xenial main" | su sudo apt update sudo apt-get install -y mono-complete -echo "Setup successful, you should now be able to run the profiler with cd SnapdragonProfiler and ./run_sdp.sh" \ No newline at end of file +echo "Setup successful, you should now be able to run the profiler with cd SnapdragonProfiler and ./run_sdp.sh" diff --git a/tools/profiling/watch-irqs.sh b/tools/profiling/watch-irqs.sh index 34cc4596f..4e5cfde3c 100755 --- a/tools/profiling/watch-irqs.sh +++ b/tools/profiling/watch-irqs.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/usr/bin/env bash set -e RUBYOPT="-W0" irqtop -d1 -R diff --git a/tools/rerun/run.sh b/tools/rerun/run.sh index 25190411d..0c0261536 100755 --- a/tools/rerun/run.sh +++ b/tools/rerun/run.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#!/usr/bin/env bash # TODO: remove this file once Rerun has interface to set log message level set -e diff --git a/tools/scripts/save_ubloxraw_stream.py b/tools/scripts/save_ubloxraw_stream.py index ecbc2bb31..b5354a783 100755 --- a/tools/scripts/save_ubloxraw_stream.py +++ b/tools/scripts/save_ubloxraw_stream.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import argparse import os import sys diff --git a/tools/serial/connect.sh b/tools/serial/connect.sh index a073310b0..0ea4a7362 100755 --- a/tools/serial/connect.sh +++ b/tools/serial/connect.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash while true; do if ls /dev/serial/by-id/usb-FTDI_FT230X* 2> /dev/null; then diff --git a/tools/sim/launch_openpilot.sh b/tools/sim/launch_openpilot.sh index 1b4ac4ef8..30c5b7382 100755 --- a/tools/sim/launch_openpilot.sh +++ b/tools/sim/launch_openpilot.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash export PASSIVE="0" export NOBOARD="1" diff --git a/tools/sim/run_bridge.py b/tools/sim/run_bridge.py index 0992ef4bf..b4da703da 100755 --- a/tools/sim/run_bridge.py +++ b/tools/sim/run_bridge.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import argparse from typing import Any diff --git a/tools/webcam/start_camerad.sh b/tools/webcam/start_camerad.sh index fbda2be9f..d4828b3e2 100755 --- a/tools/webcam/start_camerad.sh +++ b/tools/webcam/start_camerad.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # export the block below when call manager.py export BLOCK="${BLOCK},camerad"