From 7c62275e1394eacc22b0abe8073a35d610d9fd1e Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Thu, 13 Mar 2014 10:10:59 -0500 Subject: [PATCH] Whitelist arguments that are passed to build process --- Library/Homebrew/formula_installer.rb | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 28052b9be9..8282cda73c 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -411,9 +411,25 @@ class FormulaInstaller end def sanitized_ARGV_options - args = ARGV.options_only - args.delete "--ignore-dependencies" unless ignore_deps - args.delete "--build-bottle" unless build_bottle + args = [] + args << "--ignore-dependencies" if ignore_deps + + if build_bottle + args << "--build-bottle" + args << "--bottle-arch=#{ARGV.bottle_arch}" if ARGV.bottle_arch + end + + if ARGV.interactive? + args << "--interactive" + args << "--git" if ARGV.flag? "--git" + end + + args << "--verbose" if ARGV.verbose? + args << "--debug" if ARGV.debug? + args << "--cc=#{ARGV.cc}" if ARGV.cc + args << "--env=#{ARGV.env}" if ARGV.env + args << "--HEAD" if ARGV.build_head? + args << "--devel" if ARGV.build_devel? args end