diff --git a/.cirrus.tasks.yml b/.cirrus.tasks.yml index f0fbc600b9..e597d8c029 100644 --- a/.cirrus.tasks.yml +++ b/.cirrus.tasks.yml @@ -464,6 +464,8 @@ task: # Include the OS major version in the cache key. If the OS image changes # to a different major version, we need to reinstall. sw_vers -productVersion | sed 's/\..*//' + # Also start afresh if we change our MacPorts install script. + md5 src/tools/ci/ci_macports_packages.sh reupload_on_changes: true setup_additional_packages_script: | sh src/tools/ci/ci_macports_packages.sh \ diff --git a/src/tools/ci/ci_macports_packages.sh b/src/tools/ci/ci_macports_packages.sh index 03cbe48a5d..71248bd22b 100755 --- a/src/tools/ci/ci_macports_packages.sh +++ b/src/tools/ci/ci_macports_packages.sh @@ -16,13 +16,10 @@ packages="$@" macos_major_version="` sw_vers -productVersion | sed 's/\..*//' `" echo "macOS major version: $macos_major_version" -# Scan the avialable MacPorts releases to find the latest one for the -# running macOS release. By default we assume the first match is the most -# recent MacPorts version but that can be changed below if it turns out to be -# problematic or a particular MacPorts release turns out to be broken. +# Scan the available MacPorts releases to find one that matches the running +# macOS release. macports_release_list_url="https://api.github.com/repos/macports/macports-base/releases" -macports_version_pattern=".*" -#macports_version_pattern="2\.9\.3" +macports_version_pattern="2\.9\.3" macports_url="$( curl -s $macports_release_list_url | grep "\"https://github.com/macports/macports-base/releases/download/v$macports_version_pattern/MacPorts-$macports_version_pattern-$macos_major_version-[A-Za-z]*\.pkg\"" | sed 's/.*: "//;s/".*//' | head -1 )" echo "MacPorts package URL: $macports_url"