From 9b907989b8eabe663d12fae6421c39a6c088ec80 Mon Sep 17 00:00:00 2001 From: Jan Pfeifer Date: Tue, 26 Nov 2024 14:29:56 +0100 Subject: [PATCH] Removed dependency on xargs --- cmd/install_darwin_amd64.sh | 2 +- cmd/install_darwin_arm64.sh | 2 +- cmd/install_linux_amd64.sh | 12 ++++++++---- docs/CHANGELOG.md | 1 + 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/cmd/install_darwin_amd64.sh b/cmd/install_darwin_amd64.sh index 42fa541..1d4faae 100644 --- a/cmd/install_darwin_amd64.sh +++ b/cmd/install_darwin_amd64.sh @@ -30,7 +30,7 @@ _SUDO="sudo" if [[ "${GOPJRT_NOSUDO}" != "" ]] ; then echo " - Not using sudo during installation, disabled with GOPJRT_NOSUDO != ''." _SUDO="" -elif command -v sudo ; then +elif command -v sudo > /dev/null ; 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." diff --git a/cmd/install_darwin_arm64.sh b/cmd/install_darwin_arm64.sh index 91b24ff..89665db 100755 --- a/cmd/install_darwin_arm64.sh +++ b/cmd/install_darwin_arm64.sh @@ -35,7 +35,7 @@ _SUDO="sudo" if [[ "${GOPJRT_NOSUDO}" != "" ]] ; then echo " - Not using sudo during installation, disabled with GOPJRT_NOSUDO != ''." _SUDO="" -elif command -v sudo ; then +elif command -v sudo > /dev/null ; 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." diff --git a/cmd/install_linux_amd64.sh b/cmd/install_linux_amd64.sh index e1d2bac..bc7eb0a 100755 --- a/cmd/install_linux_amd64.sh +++ b/cmd/install_linux_amd64.sh @@ -32,7 +32,7 @@ _SUDO="sudo" if [[ "${GOPJRT_NOSUDO}" != "" ]] ; then echo " - Not using sudo during installation, disabled with GOPJRT_NOSUDO != ''." _SUDO="" -elif command -v sudo ; then +elif command -v sudo > /dev/null ; 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." @@ -60,9 +60,13 @@ if [[ "${_SUDO}" != "" ]] ; then echo "Checking sudo authorization for installation" ${_SUDO} printf "\tsudo authorized\n" fi -set -o pipefail -${_SUDO} tar xvzf "${tar_file}" | xargs ls -ldh -rm -f "${tar_file}" + +list_files=$(mktemp --tmpdir gopjrt_list_files.XXXXXXXX) +${_SUDO} tar xvzf "${tar_file}" > "${list_files}" +ls -lhd $(cat "${list_files}") + +# Clean up temporary files. +rm -f "${tar_file}" "${list_files}" # Remove older version using dynamically linked library -- it would be picked up on this otherwise and fail to link. # (Remove these lines after v0.5.x). diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 5fd20f1..e7723f8 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,6 +1,7 @@ # Next * Fixed installation scripts: s/sudo/$_SUDO. Also made them more verbose. +* Removed dependency on `xargs` in installation script for Linux. # v0.4.9 - 2024-11-25