formula_installer: don't pass spec arguments from ARGV to postinstall

Postinstall should be executed with the spec of the target formula not
the spec argument from ARGV, otherwise the prefix can be incorrect. In
other words, if the stable version of a dependency gets installed,
postinstall for the dependency should use the prefix of the dependency's
stable version, not the prefix of its devel or head version.

Fixes #2941.
This commit is contained in:
ilovezfs 2018-06-10 04:29:34 -07:00
parent 9ebcef785e
commit fda353e827

View File

@ -858,7 +858,7 @@ class FormulaInstaller
--
#{HOMEBREW_LIBRARY_PATH}/postinstall.rb
#{formula.path}
].concat(ARGV.options_only)
].concat(ARGV.options_only) - ["--HEAD", "--devel"]
if formula.head?
args << "--HEAD"