diff --git a/functions b/functions index cc87e17..cf00a6a 100644 --- a/functions +++ b/functions @@ -139,7 +139,7 @@ failcache_key() { fi local canonical_variants - canonical_variants=$("$(readlink "${option_prefix}/bin/port-tclsh")" "${thisdir}/tools/canonical-variants.tcl" "$@") + canonical_variants=$("${option_prefix}/bin/port-tclsh" "${thisdir}/tools/canonical-variants.tcl" "$@") if [ $? -ne 0 ]; then err "tools/canonical-variants.tcl" "$@" "failed" return 4 diff --git a/mpbb-cleanup b/mpbb-cleanup index f7caa72..d2a2599 100644 --- a/mpbb-cleanup +++ b/mpbb-cleanup @@ -86,7 +86,7 @@ cleanup() { echo "----> Uninstalling unneeded ports" # $thisdir is set by mpbb and points to the directory in which this script resides # shellcheck disable=SC2154 - "$(readlink "${option_prefix}/bin/port-tclsh")" "${thisdir}/tools/uninstall-unneeded-ports.tcl" + "${option_prefix}/bin/port-tclsh" "${thisdir}/tools/uninstall-unneeded-ports.tcl" fi if [ ! -L "${option_prefix}/var/macports/distfiles" ]; then echo @@ -99,7 +99,7 @@ cleanup() { if [[ ! -f "$timestamp" || $(($(date +%s) - $(stat -f %m "$timestamp"))) -gt 604800 ]]; then echo echo "----> Deleting unneeded failcache entries" - "$(readlink "${option_prefix}/bin/port-tclsh")" "${thisdir}/tools/failcache-cleanup.tcl" --failcache_dir "${option_failcache_dir}" + "${option_prefix}/bin/port-tclsh" "${thisdir}/tools/failcache-cleanup.tcl" --failcache_dir "${option_failcache_dir}" touch "$timestamp" fi fi @@ -109,7 +109,7 @@ cleanup() { ports="$(find "${option_prefix}/var/macports/${dir}" -name '.*' -prune -o -depth 2 -type d -print | sed 's,^.*/,,' | sort -fu)" for port in ${ports}; do echo "Deleting ${dir} for ${port}" - "$(readlink "${option_prefix}/bin/port-tclsh")" "${thisdir}/tools/noisy-delete.tcl" "${option_prefix}/var/macports/${dir}"/*/"${port}" + "${option_prefix}/bin/port-tclsh" "${thisdir}/tools/noisy-delete.tcl" "${option_prefix}/var/macports/${dir}"/*/"${port}" done rm -rf "${option_prefix}/var/macports/${dir}"/* echo @@ -124,7 +124,7 @@ cleanup() { echo "----> Trying to free more disk space" # $thisdir is set by mpbb and points to the directory in which this script resides # shellcheck disable=SC2154 - "$(readlink "${option_prefix}/bin/port-tclsh")" "${thisdir}/tools/reclaim-space.tcl" "$disk_free_after" "$DISK_FREE_THRESHOLD" + "${option_prefix}/bin/port-tclsh" "${thisdir}/tools/reclaim-space.tcl" "$disk_free_after" "$DISK_FREE_THRESHOLD" # $option_prefix is set in mpbb # shellcheck disable=SC2154 disk_free_after=$(disk_free "$option_prefix") diff --git a/mpbb-gather-archives b/mpbb-gather-archives index 86634b8..cf0a420 100644 --- a/mpbb-gather-archives +++ b/mpbb-gather-archives @@ -53,7 +53,7 @@ gather-archives() { # $option_prefix is set in mpbb # shellcheck disable=SC2154 - tclsh=$(readlink "${option_prefix}/bin/port-tclsh") + tclsh="${option_prefix}/bin/port-tclsh" if [ -d "${option_staging_dir}" ]; then find "${option_staging_dir}" -type f -delete -print | sed -E -e "s|^.*/||" -e 's/^/Deleting previously staged archive: /' diff --git a/mpbb-install-dependencies b/mpbb-install-dependencies index 4593bf7..a69f634 100644 --- a/mpbb-install-dependencies +++ b/mpbb-install-dependencies @@ -28,10 +28,9 @@ install-dependencies() { # Script attempts to get to a state where all dependencies (and # only dependencies) of the port are active - # Use of readlink is due to https://trac.macports.org/ticket/64507 # $option_prefix and $thisdir are set in mpbb # shellcheck disable=SC2154 - "$(readlink "${option_prefix}/bin/port-tclsh")" "${thisdir}/tools/dependencies.tcl" --failcache_dir "${option_failcache_dir}" \ + "${option_prefix}/bin/port-tclsh" "${thisdir}/tools/dependencies.tcl" --failcache_dir "${option_failcache_dir}" \ --logs_dir "${option_log_dir}" "$@" result=$? if [ $result -ne 0 ]; then diff --git a/mpbb-install-port b/mpbb-install-port index 86e0d53..bcf5f8e 100644 --- a/mpbb-install-port +++ b/mpbb-install-port @@ -52,7 +52,7 @@ install-port() { # $option_prefix and $thisdir are set in mpbb # shellcheck disable=SC2154 - local imagepath=$("$(readlink "${option_prefix}/bin/port-tclsh")" "${thisdir}/tools/archive-path.tcl" "$@") + local imagepath=$("${option_prefix}/bin/port-tclsh" "${thisdir}/tools/archive-path.tcl" "$@") if [[ -f "$imagepath" || -d "${imagepath%.*}" ]]; then echo "$* already installed, nothing to do" # log: summary for the portwatcher @@ -74,7 +74,7 @@ install-port() { echo "Fetch of '$port' failed." if [ -n "$option_mirrordb_url" ]; then echo "Waiting for '$port' to be mirrored." - if "$(readlink "${option_prefix}/bin/port-tclsh")" "${thisdir}/tools/wait-for-mirror.tcl" \ + if "${option_prefix}/bin/port-tclsh" "${thisdir}/tools/wait-for-mirror.tcl" \ "$option_mirrordb_url" "$option_mirrordb_credentials" "$port"; then echo "Mirroring of '$port' done. Retrying fetch." if ! "${option_prefix}/bin/port" -d fetch "$@"; then diff --git a/mpbb-list-subports b/mpbb-list-subports index e8b408a..ffa07ee 100644 --- a/mpbb-list-subports +++ b/mpbb-list-subports @@ -35,7 +35,7 @@ print-subports() { # $option_prefix is set in mpbb # shellcheck disable=SC2154 - tclsh=$(readlink "${option_prefix}/bin/port-tclsh") + tclsh="${option_prefix}/bin/port-tclsh" # $option_prefix is set in mpbb # shellcheck disable=SC2154 if [ "${include_deps}" = "yes" ]; then diff --git a/mpbb-mirror-distfiles b/mpbb-mirror-distfiles index 99d9b5f..c0b529d 100644 --- a/mpbb-mirror-distfiles +++ b/mpbb-mirror-distfiles @@ -73,6 +73,6 @@ mirror-distfiles() { # Mirror the distfiles. # $option_prefix is set by mpbb # shellcheck disable=SC2154 - "$(readlink "${option_prefix}/bin/port-tclsh")" "${thisdir}/tools/mirror-multi.tcl" -c "${option_work_dir}/mirrorcache" "$@" + "${option_prefix}/bin/port-tclsh" "${thisdir}/tools/mirror-multi.tcl" -c "${option_work_dir}/mirrorcache" "$@" #"${option_prefix}/bin/port" -p mirror "$@" $("${option_prefix}/bin/port" -pq rdeps --index "$@" | sed -E -e '/^--$/d' -e 's/^[[:space:]]+//' | sort -u) } diff --git a/mpbb-print-info b/mpbb-print-info index bd8d4b8..e967131 100644 --- a/mpbb-print-info +++ b/mpbb-print-info @@ -37,7 +37,7 @@ print-info() { # $option_prefix is set in mpbb # shellcheck disable=SC2154 - if portvariants=$("$(readlink "${option_prefix}/bin/port-tclsh")" tools/canonical-variants.tcl "$port"); then + if portvariants=$("${option_prefix}/bin/port-tclsh" tools/canonical-variants.tcl "$port"); then printf "portvariants=%s\n" "$portvariants" fi