aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMartin Afanasjew2016-05-11 06:04:35 +0200
committerMartin Afanasjew2016-05-12 08:09:19 +0200
commit2e961dc9dee63f641f7f162fd7a2845c5fd092fe (patch)
tree1b791e2dc3c154a8924d61722b95120f02036dc4 /Library
parent745a1312dce936ddd519c2e151e889459243c543 (diff)
downloadbrew-2e961dc9dee63f641f7f162fd7a2845c5fd092fe.tar.bz2
formula_installer: fix option-with-value handling
When passing formula options with value, e.g. `--with-qt=5`, to the child process responsible for building a formula, `ARGV.value` would be invoked with `nil`. Handle this more elegantly (no change in behavior). For consistency, use a regular expression adapted from `Options.create` instead of the somewhat bogus one used before.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formula_installer.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index 00678935d..c9d1f42d6 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -538,9 +538,9 @@ class FormulaInstaller
end
formula.options.each do |opt|
- name = opt.name[/\A(.+)=\z$/, 1]
- value = ARGV.value(name)
- args << "--#{name}=#{value}" if name && value
+ name = opt.name[/^([^=])+=$/, 1]
+ value = ARGV.value(name) if name
+ args << "--#{name}=#{value}" if value
end
args