diff --git a/build/macos/1_build-deps-macports.sh b/build/macos/1_build-deps-macports.sh index 115cfe70df..f06193588b 100644 --- a/build/macos/1_build-deps-macports.sh +++ b/build/macos/1_build-deps-macports.sh @@ -43,7 +43,9 @@ if [ -f "$OPT_PREFIX/bin/port" ]; then elif echo "$CI_JOB_NAME" | grep -q 'deps'; then export first_cache=true fi - eval $( [ "$OPT_PREFIX" = /opt/local ] && echo sudo ) port sync -Nv + if echo "$CI_JOB_NAME" | grep -q 'deps' && { [ "$CI_COMMIT_BRANCH" = "$CI_DEFAULT_BRANCH" ] || [ "$first_cache" ] }; then + eval $( [ "$OPT_PREFIX" = /opt/local ] && echo sudo ) port sync -Nv + fi eval $( [ "$OPT_PREFIX" = /opt/local ] && echo sudo ) port install -N $(grep -v '^#' build/macos/all-deps-uni.txt | sed 's/|homebrew:[^ ]*//g' | tr -d '\' | xargs) if echo "$CI_JOB_NAME" | grep -q 'deps' && { [ "$CI_COMMIT_BRANCH" = "$CI_DEFAULT_BRANCH" ] || [ "$first_cache" ] }; then mkdir -p macports-cached-$(uname -m) && cp -fa $OPT_PREFIX/var/macports/* macports-cached-$(uname -m) || true