aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend
diff options
context:
space:
mode:
authorAndrew Janke2016-05-06 12:02:13 -0700
committerAndrew Janke2016-05-06 12:02:13 -0700
commitd887dd39ec60c70e76a696e5fc9309172962d3c8 (patch)
tree8270bd0b75395b3f0334a2fb91393f67d160fe90 /Library/Homebrew/extend
parent12686ad417c40274f1da439c5cb7484aefde8b8c (diff)
downloadbrew-d887dd39ec60c70e76a696e5fc9309172962d3c8.tar.bz2
brew install: make -s apply only to given formula, not deps (#205)
Diffstat (limited to 'Library/Homebrew/extend')
-rw-r--r--Library/Homebrew/extend/ARGV.rb14
1 files changed, 13 insertions, 1 deletions
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)