From 57369676c25fb5698a439cefef49297bfe570dca Mon Sep 17 00:00:00 2001 From: Jan Pfeifer Date: Tue, 26 Nov 2024 14:19:26 +0100 Subject: [PATCH] Fixed installation scripts. --- cmd/install_linux_amd64.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cmd/install_linux_amd64.sh b/cmd/install_linux_amd64.sh index d722df5..e1d2bac 100755 --- a/cmd/install_linux_amd64.sh +++ b/cmd/install_linux_amd64.sh @@ -24,8 +24,18 @@ PLATFORM="linux_amd64" # Base installation directory: GOPJRT_INSTALL_DIR="${GOPJRT_INSTALL_DIR:-/usr/local}" +echo "Installing GoPJRT C/C++ dependencies under ${GOPJRT_INSTALL_DIR} (lib/ and include/ sub-directories)" +echo " - Set GOPJRT_INSTALL_DIR if you want another directory." + +# Should it use 'sudo' while installing ? _SUDO="sudo" if [[ "${GOPJRT_NOSUDO}" != "" ]] ; then + echo " - Not using sudo during installation, disabled with GOPJRT_NOSUDO != ''." + _SUDO="" +elif command -v sudo ; then + echo " - Using sudo when extracting files to final destination (Set GOPJRT_NOSUDO=1 if you don't want sudo to be used)" +else + echo " - Not using sudo during installation, no program 'sudo' found in PATH." _SUDO="" fi @@ -50,7 +60,8 @@ if [[ "${_SUDO}" != "" ]] ; then echo "Checking sudo authorization for installation" ${_SUDO} printf "\tsudo authorized\n" fi -sudo tar xvzf "${tar_file}" | xargs ls -ldh +set -o pipefail +${_SUDO} tar xvzf "${tar_file}" | xargs ls -ldh rm -f "${tar_file}" # Remove older version using dynamically linked library -- it would be picked up on this otherwise and fail to link.