X Tutup
Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

Commit 6ed1425

Browse files
committed
test-bot: handle legacy formulae PR from Homebrew/homebrew
Closes #50635. Signed-off-by: Xu Cheng <xucheng@me.com>
1 parent 71cba60 commit 6ed1425

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

Library/Homebrew/cmd/test-bot.rb

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
# --junit: Generate a JUnit XML test results file.
1212
# --no-bottle: Run brew install without --build-bottle
1313
# --keep-old: Run brew bottle --keep-old to build new bottles for a single platform.
14+
# --legacy Bulid formula from legacy Homebrew/homebrew repo.
15+
# (TODO remove it when it's not longer necessary)
1416
# --HEAD: Run brew install with --HEAD
1517
# --local: Ask Homebrew to write verbose logs under ./logs/ and set HOME to ./home/
1618
# --tap=<tap>: Use the git repository of the given tap
@@ -329,7 +331,11 @@ def diff_formulae(start_revision, end_revision, path, filter)
329331
# the right commit to BrewTestBot.
330332
unless travis_pr
331333
diff_start_sha1 = current_sha1
332-
test "brew", "pull", "--clean", @url
334+
if ARGV.include?("--legacy")
335+
test "brew", "pull", "--clean", "--legacy", @url
336+
else
337+
test "brew", "pull", "--clean", @url
338+
end
333339
diff_end_sha1 = current_sha1
334340
end
335341
@short_url = @url.gsub("https://github.com/", "")
@@ -747,6 +753,7 @@ def test_ci_upload(tap)
747753

748754
ARGV << "--verbose"
749755
ARGV << "--keep-old" if ENV["UPSTREAM_BOTTLE_KEEP_OLD"]
756+
ARGV << "--legacy" if ENV["UPSTREAM_BOTTLE_LEGACY"]
750757

751758
bottles = Dir["#{jenkins}/jobs/#{job}/configurations/axis-version/*/builds/#{id}/archive/*.bottle*.*"]
752759
return if bottles.empty?
@@ -767,8 +774,13 @@ def test_ci_upload(tap)
767774
safe_system "brew", "update"
768775

769776
if pr
770-
pull_pr = "https://github.com/#{tap.user}/homebrew-#{tap.repo}/pull/#{pr}"
771-
safe_system "brew", "pull", "--clean", pull_pr
777+
if ARGV.include?("--legacy")
778+
pull_pr = "https://github.com/Homebrew/homebrew/pull/#{pr}"
779+
safe_system "brew", "pull", "--clean", "--legacy", pull_pr
780+
else
781+
pull_pr = "https://github.com/#{tap.user}/homebrew-#{tap.repo}/pull/#{pr}"
782+
safe_system "brew", "pull", "--clean", pull_pr
783+
end
772784
end
773785

774786
bottle_args = ["--merge", "--write", *Dir["*.bottle.rb"]]

0 commit comments

Comments
 (0)
X Tutup