Skip to content

Commit

Permalink
test-bot: handle legacy formulae PR from Homebrew/homebrew
Browse files Browse the repository at this point in the history
Closes Homebrew#50635.

Signed-off-by: Xu Cheng <[email protected]>
  • Loading branch information
xu-cheng committed Apr 2, 2016
1 parent 71cba60 commit 6ed1425
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions Library/Homebrew/cmd/test-bot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
# --junit: Generate a JUnit XML test results file.
# --no-bottle: Run brew install without --build-bottle
# --keep-old: Run brew bottle --keep-old to build new bottles for a single platform.
# --legacy Bulid formula from legacy Homebrew/homebrew repo.
# (TODO remove it when it's not longer necessary)
# --HEAD: Run brew install with --HEAD
# --local: Ask Homebrew to write verbose logs under ./logs/ and set HOME to ./home/
# --tap=<tap>: Use the git repository of the given tap
Expand Down Expand Up @@ -329,7 +331,11 @@ def diff_formulae(start_revision, end_revision, path, filter)
# the right commit to BrewTestBot.
unless travis_pr
diff_start_sha1 = current_sha1
test "brew", "pull", "--clean", @url
if ARGV.include?("--legacy")
test "brew", "pull", "--clean", "--legacy", @url
else
test "brew", "pull", "--clean", @url
end
diff_end_sha1 = current_sha1
end
@short_url = @url.gsub("https://github.com/", "")
Expand Down Expand Up @@ -747,6 +753,7 @@ def test_ci_upload(tap)

ARGV << "--verbose"
ARGV << "--keep-old" if ENV["UPSTREAM_BOTTLE_KEEP_OLD"]
ARGV << "--legacy" if ENV["UPSTREAM_BOTTLE_LEGACY"]

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

if pr
pull_pr = "https://github.com/#{tap.user}/homebrew-#{tap.repo}/pull/#{pr}"
safe_system "brew", "pull", "--clean", pull_pr
if ARGV.include?("--legacy")
pull_pr = "https://github.com/Homebrew/homebrew/pull/#{pr}"
safe_system "brew", "pull", "--clean", "--legacy", pull_pr
else
pull_pr = "https://github.com/#{tap.user}/homebrew-#{tap.repo}/pull/#{pr}"
safe_system "brew", "pull", "--clean", pull_pr
end
end

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

0 comments on commit 6ed1425

Please sign in to comment.