formula_installer: build formula options better.

Previously we got all the options based on the build, any inherited
options, any passed options and the tab. We want to make sure that these
then exclude any options that don't exist as, otherwise, passing an
option that doesn't exist (or has been deleted) is enough to stop a
bottle being poured. This was particularly nasty on upgrades where we
deleted options and one left in the tab would stop the bottle being
poured.

Closes Homebrew/homebrew#47891.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Mike McQuaid 2016-01-09 12:00:35 +00:00
parent e7bffe4809
commit 42681b51f8

View File

@ -353,6 +353,7 @@ class FormulaInstaller
args = dependent.build.used_options args = dependent.build.used_options
args |= dependent == formula ? options : inherited_options args |= dependent == formula ? options : inherited_options
args |= Tab.for_formula(dependent).used_options args |= Tab.for_formula(dependent).used_options
args &= dependent.options
BuildOptions.new(args, dependent.options) BuildOptions.new(args, dependent.options)
end end