From 8f13cfc529caab8943866a2cdb67035a08698a0f Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Fri, 7 Jul 2023 19:35:05 +0100 Subject: [PATCH 1/2] cmd/update: adjustments for setup-homebrew in brew CI --- Library/Homebrew/cmd/update.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index 9d2aa59f2a..76da1beda6 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -613,6 +613,11 @@ EOS declare UPSTREAM_BRANCH"${TAP_VAR}"="${UPSTREAM_BRANCH_DIR}" declare PREFETCH_REVISION"${TAP_VAR}"="$(git rev-parse -q --verify refs/remotes/origin/"${UPSTREAM_BRANCH_DIR}")" + if [[ -n "${GITHUB_ACTIONS}" && -n "${HOMEBREW_UPDATE_SKIP_BREW}" && "${DIR}" == "${HOMEBREW_REPOSITORY}" ]] + then + continue + fi + # Force a full update if we don't have any tags. if [[ "${DIR}" == "${HOMEBREW_REPOSITORY}" && -z "$(git tag --list)" ]] then @@ -767,9 +772,10 @@ EOS if [[ -n "${HOMEBREW_SIMULATE_FROM_CURRENT_BRANCH}" ]] then simulate_from_current_branch "${DIR}" "${TAP_VAR}" "${UPSTREAM_BRANCH}" "${CURRENT_REVISION}" - elif [[ -z "${HOMEBREW_UPDATE_FORCE}" ]] && - [[ "${PREFETCH_REVISION}" == "${POSTFETCH_REVISION}" ]] && - [[ "${CURRENT_REVISION}" == "${POSTFETCH_REVISION}" ]] + elif [[ -z "${HOMEBREW_UPDATE_FORCE}" && + "${PREFETCH_REVISION}" == "${POSTFETCH_REVISION}" && + "${CURRENT_REVISION}" == "${POSTFETCH_REVISION}" ]] || + [[ -n "${GITHUB_ACTIONS}" && -n "${HOMEBREW_UPDATE_SKIP_BREW}" && "${DIR}" == "${HOMEBREW_REPOSITORY}" ]] then export HOMEBREW_UPDATE_BEFORE"${TAP_VAR}"="${CURRENT_REVISION}" export HOMEBREW_UPDATE_AFTER"${TAP_VAR}"="${CURRENT_REVISION}" From dc7a47d0accb4d4e4d81ea35df204206c736aafd Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Fri, 7 Jul 2023 20:21:27 +0100 Subject: [PATCH 2/2] test: drop deprecated uses_from_macos_elements checks --- Library/Homebrew/test/formulary_spec.rb | 1 - Library/Homebrew/test/os/mac/formula_spec.rb | 4 ---- Library/Homebrew/test/software_spec_spec.rb | 2 -- 3 files changed, 7 deletions(-) diff --git a/Library/Homebrew/test/formulary_spec.rb b/Library/Homebrew/test/formulary_spec.rb index 89a627b950..ca6455fe73 100644 --- a/Library/Homebrew/test/formulary_spec.rb +++ b/Library/Homebrew/test/formulary_spec.rb @@ -346,7 +346,6 @@ describe Formulary do else expect(formula.deps.count).to eq 6 end - expect(formula.uses_from_macos_elements).to eq ["uses_from_macos_dep"] expect(formula.requirements.count).to eq 1 req = formula.requirements.first diff --git a/Library/Homebrew/test/os/mac/formula_spec.rb b/Library/Homebrew/test/os/mac/formula_spec.rb index a188ee4269..1a2344ff25 100644 --- a/Library/Homebrew/test/os/mac/formula_spec.rb +++ b/Library/Homebrew/test/os/mac/formula_spec.rb @@ -23,8 +23,6 @@ describe Formula do expect(f.class.head.declared_deps).not_to be_empty expect(f.class.stable.declared_deps.first.name).to eq("foo") expect(f.class.head.declared_deps.first.name).to eq("foo") - expect(f.class.stable.uses_from_macos_elements.first).to eq("foo") - expect(f.class.head.uses_from_macos_elements.first).to eq("foo") end it "adds a dependency to any spec if the OS version doesn't meet requirements" do @@ -40,8 +38,6 @@ describe Formula do expect(f.class.head.deps.first.name).to eq("foo") expect(f.class.stable.declared_deps).not_to be_empty expect(f.class.head.declared_deps).not_to be_empty - expect(f.class.stable.uses_from_macos_elements).to eq(["foo"]) - expect(f.class.head.uses_from_macos_elements).to eq(["foo"]) end end diff --git a/Library/Homebrew/test/software_spec_spec.rb b/Library/Homebrew/test/software_spec_spec.rb index 458248468a..52b14b72fb 100644 --- a/Library/Homebrew/test/software_spec_spec.rb +++ b/Library/Homebrew/test/software_spec_spec.rb @@ -208,7 +208,6 @@ describe SoftwareSpec do expect(spec.declared_deps).not_to be_empty expect(spec.declared_deps.first).to be_uses_from_macos expect(spec.declared_deps.first).to be_use_macos_install - expect(spec.uses_from_macos_elements.first).to eq("foo") end it "add a macOS dependency if the OS version doesn't meet requirements" do @@ -219,7 +218,6 @@ describe SoftwareSpec do expect(spec.deps.first.name).to eq("foo") expect(spec.deps.first).to be_uses_from_macos expect(spec.deps.first).not_to be_use_macos_install - expect(spec.uses_from_macos_elements).to eq(["foo"]) end it "works with tags" do