Skip to content

Commit

Permalink
WIP: Support extracted formulae consuming core tap bottles
Browse files Browse the repository at this point in the history
Fixes Homebrew#6059

WIP because this currently _breaks_ core tap formulae that have an AT
version and have a bottle, e.g. postgresql@9.6. The filename builder
needs to know if it should drop the @Version or not, and that should
probably be a part of the `use_core_bottles!` invocation.
  • Loading branch information
colindean committed Oct 5, 2019
1 parent fd9a09e commit c0fbdde
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions Library/Homebrew/software_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,19 @@ def json
end

def bintray
"#{name}-#{version}#{extname}"
#"#{name}-#{version}#{extname}"
"#{drop_atversion(name)}-#{version}#{extname}"
end

def extname
s = rebuild.positive? ? ".#{rebuild}" : ""
".#{tag}.bottle#{s}.tar.gz"
end

private
def drop_atversion(version_named)
version_named.split('@')[0]
end
end

extend Forwardable
Expand Down Expand Up @@ -345,10 +351,17 @@ def initialize
@cellar = Homebrew::DEFAULT_CELLAR
@collector = Utils::Bottles::Collector.new
@root_url_specs = {}
@use_core_bintray = false
end

def use_core_bottles!
@use_core_bintray = true
end

def root_url(var = nil, specs = {})
if var.nil?
if @use_core_bintray
@root_url ||= "#{HOMEBREW_BOTTLE_DOMAIN}/#{Utils::Bottles::Bintray.repository}"
elsif var.nil?
@root_url ||= "#{HOMEBREW_BOTTLE_DOMAIN}/#{Utils::Bottles::Bintray.repository(tap)}"
else
@root_url = var
Expand Down

0 comments on commit c0fbdde

Please sign in to comment.