Bottles: use options hash for install_bottle?
This commit is contained in:
parent
1390d5cc12
commit
a7e1dbae63
@ -3,8 +3,6 @@ require 'macos'
|
|||||||
require 'extend/ARGV'
|
require 'extend/ARGV'
|
||||||
require 'bottle_version'
|
require 'bottle_version'
|
||||||
|
|
||||||
# TODO: use options={} for some arguments.
|
|
||||||
|
|
||||||
def bottle_filename f, bottle_revision=nil
|
def bottle_filename f, bottle_revision=nil
|
||||||
name = f.name.downcase
|
name = f.name.downcase
|
||||||
version = f.stable.version
|
version = f.stable.version
|
||||||
@ -12,7 +10,7 @@ def bottle_filename f, bottle_revision=nil
|
|||||||
"#{name}-#{version}#{bottle_native_suffix(bottle_revision)}"
|
"#{name}-#{version}#{bottle_native_suffix(bottle_revision)}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def install_bottle? f, warn=false
|
def install_bottle? f, options={:warn=>false}
|
||||||
return true if f.downloader and defined? f.downloader.local_bottle_path \
|
return true if f.downloader and defined? f.downloader.local_bottle_path \
|
||||||
and f.downloader.local_bottle_path
|
and f.downloader.local_bottle_path
|
||||||
|
|
||||||
@ -22,7 +20,9 @@ def install_bottle? f, warn=false
|
|||||||
return false unless f.build.used_options.empty?
|
return false unless f.build.used_options.empty?
|
||||||
return false unless bottle_current?(f)
|
return false unless bottle_current?(f)
|
||||||
if f.bottle.cellar != :any && f.bottle.cellar != HOMEBREW_CELLAR.to_s
|
if f.bottle.cellar != :any && f.bottle.cellar != HOMEBREW_CELLAR.to_s
|
||||||
opoo "Building source; cellar of #{f}'s bottle is #{f.bottle.cellar}" if warn
|
if options[:warn]
|
||||||
|
opoo "Building source; cellar of #{f}'s bottle is #{f.bottle.cellar}"
|
||||||
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -30,8 +30,9 @@ class FormulaInstaller
|
|||||||
check_install_sanity
|
check_install_sanity
|
||||||
end
|
end
|
||||||
|
|
||||||
def pour_bottle? warn=false
|
def pour_bottle? install_bottle_options={:warn=>false}
|
||||||
tab.used_options.empty? && options.empty? && install_bottle?(f, warn)
|
tab.used_options.empty? && options.empty? && \
|
||||||
|
install_bottle?(f, install_bottle_options)
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_install_sanity
|
def check_install_sanity
|
||||||
@ -167,7 +168,7 @@ class FormulaInstaller
|
|||||||
@poured_bottle = false
|
@poured_bottle = false
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if pour_bottle? true
|
if pour_bottle? :warn => true
|
||||||
pour
|
pour
|
||||||
@poured_bottle = true
|
@poured_bottle = true
|
||||||
tab = Tab.for_keg f.prefix
|
tab = Tab.for_keg f.prefix
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user