Fix dependency option handling.
- formula_installer: only recompute dependencies when necessary i.e. when a bottle pour fails. - formula_installer: re-add accidentally remove dependency options - dependency: missing options are only those that actually exist on a formula
This commit is contained in:
parent
a566540c46
commit
f7f15673a8
@ -43,8 +43,12 @@ class Dependency
|
|||||||
end
|
end
|
||||||
|
|
||||||
def missing_options(inherited_options)
|
def missing_options(inherited_options)
|
||||||
required = options | inherited_options
|
formula = to_formula
|
||||||
required - Tab.for_formula(to_formula).used_options
|
required = options
|
||||||
|
required |= inherited_options
|
||||||
|
required &= formula.options.to_a
|
||||||
|
required -= Tab.for_formula(formula).used_options
|
||||||
|
required
|
||||||
end
|
end
|
||||||
|
|
||||||
def modify_build_environment
|
def modify_build_environment
|
||||||
|
|||||||
@ -236,8 +236,7 @@ class FormulaInstaller
|
|||||||
|
|
||||||
@@attempted << formula
|
@@attempted << formula
|
||||||
|
|
||||||
pour_bottle = pour_bottle?(warn: true)
|
if pour_bottle?(warn: true)
|
||||||
if pour_bottle
|
|
||||||
begin
|
begin
|
||||||
pour
|
pour
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
@ -251,18 +250,17 @@ class FormulaInstaller
|
|||||||
onoe e.message
|
onoe e.message
|
||||||
opoo "Bottle installation failed: building from source."
|
opoo "Bottle installation failed: building from source."
|
||||||
raise BuildToolsError, [formula] unless DevelopmentTools.installed?
|
raise BuildToolsError, [formula] unless DevelopmentTools.installed?
|
||||||
|
compute_and_install_dependencies unless skip_deps_check?
|
||||||
else
|
else
|
||||||
puts_requirement_messages
|
|
||||||
@poured_bottle = true
|
@poured_bottle = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
puts_requirement_messages
|
||||||
|
|
||||||
build_bottle_preinstall if build_bottle?
|
build_bottle_preinstall if build_bottle?
|
||||||
|
|
||||||
unless @poured_bottle
|
unless @poured_bottle
|
||||||
not_pouring = !pour_bottle || @pour_failed
|
|
||||||
compute_and_install_dependencies if not_pouring && !ignore_deps?
|
|
||||||
puts_requirement_messages
|
|
||||||
build
|
build
|
||||||
clean
|
clean
|
||||||
|
|
||||||
@ -467,6 +465,7 @@ class FormulaInstaller
|
|||||||
|
|
||||||
fi = DependencyInstaller.new(df)
|
fi = DependencyInstaller.new(df)
|
||||||
fi.options |= tab.used_options
|
fi.options |= tab.used_options
|
||||||
|
fi.options |= Tab.remap_deprecated_options(df.deprecated_options, dep.options)
|
||||||
fi.options |= inherited_options
|
fi.options |= inherited_options
|
||||||
fi.options &= df.options
|
fi.options &= df.options
|
||||||
fi.build_from_source = ARGV.build_formula_from_source?(df)
|
fi.build_from_source = ARGV.build_formula_from_source?(df)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user