From 0ff9bf6cb46c52997bd5175cc93f229065130ee4 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Thu, 8 Apr 2021 09:08:20 +0100 Subject: [PATCH] github_packages: fix `source` for Linuxbrew bottles. Addresses https://github.com/Homebrew/brew/pull/11056#issuecomment-815261503 --- Library/Homebrew/github_packages.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/github_packages.rb b/Library/Homebrew/github_packages.rb index 90c65d3db7..62dc0419b3 100644 --- a/Library/Homebrew/github_packages.rb +++ b/Library/Homebrew/github_packages.rb @@ -221,7 +221,15 @@ class GitHubPackages git_path = bottle_hash["formula"]["tap_git_path"] git_revision = bottle_hash["formula"]["tap_git_revision"] - source = "https://github.com/#{org}/#{repo}/blob/#{git_revision.presence || "HEAD"}/#{git_path}" + + # we're uploading Homebrew/linuxbrew-core bottles to Linuxbrew with a core/ + # prefix. + source_org_repo = if org.casecmp("linuxbrew").zero? && repo == "homebrew-core" + "Homebrew/linuxbrew-core" + else + "#{org}/#{repo}" + end + source = "https://github.com/#{source_org_repo}/blob/#{git_revision.presence || "HEAD"}/#{git_path}" formula_core_tap = formula_full_name.exclude?("/") documentation = if formula_core_tap