From 251c79b66fd552a7499e96d7ab13e3e36c726e00 Mon Sep 17 00:00:00 2001 From: Brian Potchik Date: Thu, 17 Jan 2019 21:24:41 -0500 Subject: Update Linux install scripts. --- scripts/install_api.py | 5 +++-- scripts/linux-setup.sh | 10 ++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) mode change 100755 => 100644 scripts/install_api.py mode change 100755 => 100644 scripts/linux-setup.sh (limited to 'scripts') diff --git a/scripts/install_api.py b/scripts/install_api.py old mode 100755 new mode 100644 index 646bd4fe..0ffd04ab --- a/scripts/install_api.py +++ b/scripts/install_api.py @@ -8,10 +8,11 @@ import os from site import check_enableusersite # Handle both normal environments and virtualenvs -from distutils.sysconfig import get_python_lib as getsitepackages try: - from site import getusersitepackages + from site import getusersitepackages, getsitepackages except ImportError: + from sysconfig import get_path + getsitepackages = lambda: get_path('purelib') getusersitepackages = getsitepackages # Hacky command line parsing to accept a silent-install -s flag like linux-setup.sh: diff --git a/scripts/linux-setup.sh b/scripts/linux-setup.sh old mode 100755 new mode 100644 index 4c9be22e..43c6ec88 --- a/scripts/linux-setup.sh +++ b/scripts/linux-setup.sh @@ -71,8 +71,14 @@ pythonpath() else SILENT="" fi - python -V >/dev/null 2>&1 && ${SUDO}python ${BNPATH}/scripts/install_api.py ${ROOT} ${SILENT} - python3 -V >/dev/null 2>&1 && ${SUDO}python3 ${BNPATH}/scripts/install_api.py ${ROOT} ${SILENT} + if [[ -x "`which python`" ]] + then + python -V >/dev/null 2>&1 && ${SUDO}python ${BNPATH}/scripts/install_api.py ${ROOT} ${SILENT} + fi + if [[ -x "`which python3`" ]] + then + python3 -V >/dev/null 2>&1 && ${SUDO}python3 ${BNPATH}/scripts/install_api.py ${ROOT} ${SILENT} + fi } createdesktopfile() -- cgit v1.3.1