Make build_bottle an explicit installer mode

This commit is contained in:
Jack Nagel 2014-03-10 14:56:01 -05:00
parent 15ad296cfd
commit 42e60f7c59
4 changed files with 11 additions and 6 deletions

View File

@ -106,6 +106,7 @@ module Homebrew extend self
fi = FormulaInstaller.new(f)
fi.ignore_deps = ARGV.ignore_deps? || ARGV.interactive?
fi.only_deps = ARGV.only_deps?
fi.build_bottle = ARGV.build_bottle?
fi.prelude
fi.install
fi.caveats

View File

@ -144,7 +144,7 @@ module HomebrewArgvExtension
def build_from_source?
include? '--build-from-source' or !ENV['HOMEBREW_BUILD_FROM_SOURCE'].nil? \
or build_head? or build_devel? or build_universal? or build_bottle?
or build_head? or build_devel? or build_universal?
end
def flag? flag
@ -184,7 +184,6 @@ module HomebrewArgvExtension
old_args = clone
flags_to_clear = %w[
--build-bottle
--debug -d
--devel
--interactive -i

View File

@ -80,11 +80,15 @@ class Formula
end
end
def select_bottle?
!ARGV.build_bottle? && install_bottle?(self)
end
def determine_active_spec
case
when head && ARGV.build_head? then head # --HEAD
when devel && ARGV.build_devel? then devel # --devel
when bottle && install_bottle?(self) then bottle # bottle available
when bottle && select_bottle? then bottle # bottle available
when stable then stable
when devel && stable.nil? then devel # devel-only
when head && stable.nil? then head # head-only

View File

@ -118,7 +118,7 @@ class FormulaInstaller
return if only_deps
if ARGV.build_bottle? && (arch = ARGV.bottle_arch) && !Hardware::CPU.optimization_flags.include?(arch)
if build_bottle && (arch = ARGV.bottle_arch) && !Hardware::CPU.optimization_flags.include?(arch)
raise "Unrecognized architecture for --bottle-arch: #{arch}"
end
@ -152,7 +152,7 @@ class FormulaInstaller
opoo "Bottle installation failed: building from source."
end
build_bottle_preinstall if ARGV.build_bottle?
build_bottle_preinstall if build_bottle
unless @poured_bottle
compute_and_install_dependencies if @pour_failed and not ignore_deps
@ -160,7 +160,7 @@ class FormulaInstaller
clean
end
build_bottle_postinstall if ARGV.build_bottle?
build_bottle_postinstall if build_bottle
opoo "Nothing was installed to #{f.prefix}" unless f.installed?
end
@ -394,6 +394,7 @@ class FormulaInstaller
def sanitized_ARGV_options
args = ARGV.options_only
args.delete "--ignore-dependencies" unless ignore_deps
args.delete "--build-bottle" unless build_bottle
args
end