From a1d4aa8dc18f190adea573ac0a70366b4d5085e7 Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 24 Nov 2017 09:39:14 +0100 Subject: [PATCH] Tweak startup scripts way to find python3 --- data/carla | 6 +++--- data/carla-control | 6 +++--- data/carla-database | 10 +++++++--- data/carla-jack-multi | 6 +++--- data/carla-jack-single | 6 +++--- data/carla-patchbay | 6 +++--- data/carla-rack | 6 +++--- data/carla-settings | 10 +++++++--- 8 files changed, 32 insertions(+), 24 deletions(-) diff --git a/data/carla b/data/carla index 44c382dd1..4b6def81e 100755 --- a/data/carla +++ b/data/carla @@ -1,8 +1,8 @@ #!/bin/sh -if [ -f /usr/bin/python3 ]; then - PYTHON=/usr/bin/python3 -else +PYTHON=$(which python3 2>/dev/null) + +if [ ! -f ${PYTHON} ]; then PYTHON=python fi diff --git a/data/carla-control b/data/carla-control index e0f056c37..3338fee16 100755 --- a/data/carla-control +++ b/data/carla-control @@ -1,8 +1,8 @@ #!/bin/sh -if [ -f /usr/bin/python3 ]; then - PYTHON=/usr/bin/python3 -else +PYTHON=$(which python3 2>/dev/null) + +if [ ! -f ${PYTHON} ]; then PYTHON=python fi diff --git a/data/carla-database b/data/carla-database index b43f5de4a..0aebdd130 100755 --- a/data/carla-database +++ b/data/carla-database @@ -1,11 +1,15 @@ #!/bin/sh -if [ -f /usr/bin/python3 ]; then - PYTHON=/usr/bin/python3 -else +PYTHON=$(which python3 2>/dev/null) + +if [ ! -f ${PYTHON} ]; then PYTHON=python fi +if [ "$1" = "--gdb" ]; then + PYTHON="gdb --args $PYTHON" +fi + INSTALL_PREFIX="X-PREFIX-X" export PATH="$INSTALL_PREFIX"/lib/carla:$PATH exec $PYTHON "$INSTALL_PREFIX"/share/carla/carla_database.py --with-libprefix="$INSTALL_PREFIX" "$@" diff --git a/data/carla-jack-multi b/data/carla-jack-multi index c0b48b028..5caef0cce 100755 --- a/data/carla-jack-multi +++ b/data/carla-jack-multi @@ -1,8 +1,8 @@ #!/bin/sh -if [ -f /usr/bin/python3 ]; then - PYTHON=/usr/bin/python3 -else +PYTHON=$(which python3 2>/dev/null) + +if [ ! -f ${PYTHON} ]; then PYTHON=python fi diff --git a/data/carla-jack-single b/data/carla-jack-single index 5e382213a..64ffacb97 100755 --- a/data/carla-jack-single +++ b/data/carla-jack-single @@ -1,8 +1,8 @@ #!/bin/sh -if [ -f /usr/bin/python3 ]; then - PYTHON=/usr/bin/python3 -else +PYTHON=$(which python3 2>/dev/null) + +if [ ! -f ${PYTHON} ]; then PYTHON=python fi diff --git a/data/carla-patchbay b/data/carla-patchbay index 8a907d4a9..83bafb08f 100755 --- a/data/carla-patchbay +++ b/data/carla-patchbay @@ -1,8 +1,8 @@ #!/bin/sh -if [ -f /usr/bin/python3 ]; then - PYTHON=/usr/bin/python3 -else +PYTHON=$(which python3 2>/dev/null) + +if [ ! -f ${PYTHON} ]; then PYTHON=python fi diff --git a/data/carla-rack b/data/carla-rack index 51febe803..7462511e5 100755 --- a/data/carla-rack +++ b/data/carla-rack @@ -1,8 +1,8 @@ #!/bin/sh -if [ -f /usr/bin/python3 ]; then - PYTHON=/usr/bin/python3 -else +PYTHON=$(which python3 2>/dev/null) + +if [ ! -f ${PYTHON} ]; then PYTHON=python fi diff --git a/data/carla-settings b/data/carla-settings index dcd1990bc..da6c8b817 100755 --- a/data/carla-settings +++ b/data/carla-settings @@ -1,11 +1,15 @@ #!/bin/sh -if [ -f /usr/bin/python3 ]; then - PYTHON=/usr/bin/python3 -else +PYTHON=$(which python3 2>/dev/null) + +if [ ! -f ${PYTHON} ]; then PYTHON=python fi +if [ "$1" = "--gdb" ]; then + PYTHON="gdb --args $PYTHON" +fi + INSTALL_PREFIX="X-PREFIX-X" export PATH="$INSTALL_PREFIX"/lib/carla:$PATH exec $PYTHON "$INSTALL_PREFIX"/share/carla/carla_settings.py --with-libprefix="$INSTALL_PREFIX" "$@"