diff options
| author | Jack Nagel | 2014-03-10 14:56:01 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-03-10 14:56:01 -0500 |
| commit | 8887913a09613d933db7309f2d1f819a592a4f14 (patch) | |
| tree | ae32ccfdd3272b01c70dcf291719f0e87c189f7d | |
| parent | 01133788db8b65d8cb9041fedf39d8e7a4fd9835 (diff) | |
| download | homebrew-8887913a09613d933db7309f2d1f819a592a4f14.tar.bz2 | |
Make build_bottle an explicit installer mode
| -rw-r--r-- | Library/Homebrew/cmd/install.rb | 1 | ||||
| -rw-r--r-- | Library/Homebrew/extend/ARGV.rb | 3 | ||||
| -rw-r--r-- | Library/Homebrew/formula.rb | 6 | ||||
| -rw-r--r-- | Library/Homebrew/formula_installer.rb | 7 |
4 files changed, 11 insertions, 6 deletions
diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 64de95ba2..6a3d370ea 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -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 diff --git a/Library/Homebrew/extend/ARGV.rb b/Library/Homebrew/extend/ARGV.rb index 5bc88142b..a8197309c 100644 --- a/Library/Homebrew/extend/ARGV.rb +++ b/Library/Homebrew/extend/ARGV.rb @@ -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 diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index e6e46ecb5..57c8a2edf 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -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 diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index e7027b73b..600d31f78 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -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 |
