diff options
| author | Andrew Janke | 2016-05-06 12:02:13 -0700 |
|---|---|---|
| committer | Andrew Janke | 2016-05-06 12:02:13 -0700 |
| commit | d887dd39ec60c70e76a696e5fc9309172962d3c8 (patch) | |
| tree | 8270bd0b75395b3f0334a2fb91393f67d160fe90 /Library/Homebrew | |
| parent | 12686ad417c40274f1da439c5cb7484aefde8b8c (diff) | |
| download | brew-d887dd39ec60c70e76a696e5fc9309172962d3c8.tar.bz2 | |
brew install: make -s apply only to given formula, not deps (#205)
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/cmd/fetch.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/install.rb | 11 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/reinstall.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/upgrade.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/extend/ARGV.rb | 14 | ||||
| -rw-r--r-- | Library/Homebrew/formula.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/formula_installer.rb | 2 |
7 files changed, 27 insertions, 8 deletions
diff --git a/Library/Homebrew/cmd/fetch.rb b/Library/Homebrew/cmd/fetch.rb index 3a3956607..1dd6da4b3 100644 --- a/Library/Homebrew/cmd/fetch.rb +++ b/Library/Homebrew/cmd/fetch.rb @@ -64,7 +64,7 @@ module Homebrew def fetch_bottle?(f) return true if ARGV.force_bottle? && f.bottle return false unless f.bottle && f.pour_bottle? - return false if ARGV.build_from_source? || ARGV.build_bottle? + return false if ARGV.build_formula_from_source?(f) return false unless f.bottle.compatible_cellar? true end diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 22be53ad0..d41ef66d4 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -24,8 +24,13 @@ #: `gcc-4.2` for Apple's GCC 4.2, or `gcc-4.9` for a Homebrew-provided GCC #: 4.9. #: -#: If `--build-from-source` is passed, compile from source even if a bottle -#: is provided for <formula>. +#: If `--build-from-source` or `-s` is passed, compile the specified <formula> from +#: source even if a bottle is provided. Dependencies will still be installed +#: from bottles if they are available. +#: +#: If `HOMEBREW_BUILD_FROM_SOURCE` is set, regardless of whether `--build-from-source` was +#: passed, then both <formula> and the dependencies installed as part of this process +#: are built from source even if bottles are available. #: #: If `--force-bottle` is passed, install from a bottle if it exists #: for the current version of OS X, even if custom options are given. @@ -259,7 +264,7 @@ module Homebrew fi.ignore_deps = ARGV.ignore_deps? fi.only_deps = ARGV.only_deps? fi.build_bottle = ARGV.build_bottle? - fi.build_from_source = ARGV.build_from_source? + fi.build_from_source = ARGV.build_from_source? || ARGV.build_all_from_source? fi.force_bottle = ARGV.force_bottle? fi.interactive = ARGV.interactive? fi.git = ARGV.git? diff --git a/Library/Homebrew/cmd/reinstall.rb b/Library/Homebrew/cmd/reinstall.rb index 8cf81fb61..4a23c00ec 100644 --- a/Library/Homebrew/cmd/reinstall.rb +++ b/Library/Homebrew/cmd/reinstall.rb @@ -26,7 +26,7 @@ module Homebrew fi = FormulaInstaller.new(f) fi.options = options fi.build_bottle = ARGV.build_bottle? || (!f.bottled? && tab.build_bottle?) - fi.build_from_source = ARGV.build_from_source? + fi.build_from_source = ARGV.build_from_source? || ARGV.build_all_from_source? fi.force_bottle = ARGV.force_bottle? fi.interactive = ARGV.interactive? fi.git = ARGV.git? diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb index 2f8407feb..c296e7757 100644 --- a/Library/Homebrew/cmd/upgrade.rb +++ b/Library/Homebrew/cmd/upgrade.rb @@ -71,7 +71,7 @@ module Homebrew fi = FormulaInstaller.new(f) fi.options = tab.used_options fi.build_bottle = ARGV.build_bottle? || (!f.bottled? && tab.build_bottle?) - fi.build_from_source = ARGV.build_from_source? + fi.build_from_source = ARGV.build_from_source? || ARGV.build_all_from_source? fi.verbose = ARGV.verbose? fi.quieter = ARGV.quieter? fi.debug = ARGV.debug? diff --git a/Library/Homebrew/extend/ARGV.rb b/Library/Homebrew/extend/ARGV.rb index eec2172a2..bb26d453f 100644 --- a/Library/Homebrew/extend/ARGV.rb +++ b/Library/Homebrew/extend/ARGV.rb @@ -185,7 +185,19 @@ module HomebrewArgvExtension end def build_from_source? - switch?("s") || include?("--build-from-source") || !!ENV["HOMEBREW_BUILD_FROM_SOURCE"] + switch?("s") || include?("--build-from-source") + end + + def build_all_from_source? + !!ENV["HOMEBREW_BUILD_FROM_SOURCE"] + end + + # Whether a given formula should be built from source during the current + # installation run. + def build_formula_from_source?(f) + return true if build_all_from_source? + return false unless (build_from_source? || build_bottle?) + formulae.any? { |argv_f| argv_f.full_name == f.full_name } end def flag?(flag) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index afeb3ec27..a25a78f44 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -794,6 +794,8 @@ class Formula opt_prefix+"Frameworks" end + # Indicates that this formula supports bottles. (Not necessarily that one + # should be used in the current installation run.) # Can be overridden to selectively disable bottles from formulae. # Defaults to true so overridden version does not have to check if bottles # are supported. diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 4de4a79dc..4b8dcf202 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -428,7 +428,7 @@ class FormulaInstaller fi.options |= tab.used_options fi.options |= Tab.remap_deprecated_options(df.deprecated_options, dep.options) fi.options |= inherited_options - fi.build_from_source = build_from_source? + fi.build_from_source = ARGV.build_formula_from_source?(df) fi.verbose = verbose? && !quieter? fi.debug = debug? fi.prelude |
