Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elide prefix "/usr/local" in bottle block #4875

Merged
merged 1 commit into from
Sep 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions Library/Homebrew/dev-cmd/bottle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@
<% if !root_url.start_with?(HOMEBREW_BOTTLE_DEFAULT_DOMAIN) %>
root_url "<%= root_url %>"
<% end %>
<% if prefix != BottleSpecification::DEFAULT_PREFIX %>
<% if ![Homebrew::DEFAULT_PREFIX, "/usr/local"].include?(prefix) %>
jonchang marked this conversation as resolved.
Show resolved Hide resolved
prefix "<%= prefix %>"
<% end %>
<% if cellar.is_a? Symbol %>
cellar :<%= cellar %>
<% elsif cellar != BottleSpecification::DEFAULT_CELLAR %>
<% elsif ![Homebrew::DEFAULT_CELLAR, "/usr/local/Cellar"].include?(cellar) %>
cellar "<%= cellar %>"
<% end %>
<% if rebuild.positive? %>
Expand Down
2 changes: 2 additions & 0 deletions Library/Homebrew/global.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ module Homebrew
extend FileUtils

DEFAULT_PREFIX ||= "/usr/local".freeze
DEFAULT_CELLAR = "#{DEFAULT_PREFIX}/Cellar".freeze
DEFAULT_REPOSITORY = "#{DEFAULT_PREFIX}/Homebrew".freeze
JCount marked this conversation as resolved.
Show resolved Hide resolved

class << self
attr_writer :failed, :raise_deprecation_exceptions, :auditing, :args
Expand Down
5 changes: 2 additions & 3 deletions Library/Homebrew/software_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -327,16 +327,15 @@ def select_download_strategy(specs)

class BottleSpecification
DEFAULT_PREFIX = Homebrew::DEFAULT_PREFIX
JCount marked this conversation as resolved.
Show resolved Hide resolved
DEFAULT_CELLAR = "#{DEFAULT_PREFIX}/Cellar".freeze
jonchang marked this conversation as resolved.
Show resolved Hide resolved

attr_rw :prefix, :cellar, :rebuild
attr_accessor :tap
attr_reader :checksum, :collector, :root_url_specs

def initialize
@rebuild = 0
@prefix = DEFAULT_PREFIX
@cellar = DEFAULT_CELLAR
@prefix = Homebrew::DEFAULT_PREFIX
@cellar = Homebrew::DEFAULT_CELLAR
@collector = Utils::Bottles::Collector.new
@root_url_specs = {}
end
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/system_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ def dump_verbose_config(f = $stdout)
end
defaults_hash = {
HOMEBREW_PREFIX: Homebrew::DEFAULT_PREFIX,
HOMEBREW_REPOSITORY: "#{Homebrew::DEFAULT_PREFIX}/Homebrew",
HOMEBREW_CELLAR: "#{Homebrew::DEFAULT_PREFIX}/Cellar",
HOMEBREW_REPOSITORY: Homebrew::DEFAULT_REPOSITORY,
HOMEBREW_CELLAR: Homebrew::DEFAULT_CELLAR,
HOMEBREW_CACHE: "#{ENV["HOME"]}/Library/Caches/Homebrew",
HOMEBREW_RUBY_WARNINGS: "-W0",
HOMEBREW_TEMP: ENV["HOMEBREW_SYSTEM_TEMP"],
Expand Down