FormulaInstaller: verify dependencies map to formulae before locking
This commit is contained in:
parent
d0f43ad367
commit
369f9b3251
@ -31,6 +31,7 @@ class FormulaInstaller
|
|||||||
@poured_bottle = false
|
@poured_bottle = false
|
||||||
@pour_failed = false
|
@pour_failed = false
|
||||||
|
|
||||||
|
verify_deps_exist
|
||||||
lock
|
lock
|
||||||
check_install_sanity
|
check_install_sanity
|
||||||
end
|
end
|
||||||
@ -41,6 +42,13 @@ class FormulaInstaller
|
|||||||
install_bottle?(f, install_bottle_options)
|
install_bottle?(f, install_bottle_options)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def verify_deps_exist
|
||||||
|
f.recursive_dependencies.map(&:to_formula)
|
||||||
|
rescue FormulaUnavailableError => e
|
||||||
|
e.dependent = f.name
|
||||||
|
raise
|
||||||
|
end
|
||||||
|
|
||||||
def check_install_sanity
|
def check_install_sanity
|
||||||
raise FormulaInstallationAlreadyAttemptedError, f if @@attempted.include? f
|
raise FormulaInstallationAlreadyAttemptedError, f if @@attempted.include? f
|
||||||
|
|
||||||
@ -70,12 +78,6 @@ class FormulaInstaller
|
|||||||
raise CannotInstallFormulaError,
|
raise CannotInstallFormulaError,
|
||||||
"You must `brew link #{unlinked_deps*' '}' before #{f} can be installed" unless unlinked_deps.empty?
|
"You must `brew link #{unlinked_deps*' '}' before #{f} can be installed" unless unlinked_deps.empty?
|
||||||
end
|
end
|
||||||
|
|
||||||
rescue FormulaUnavailableError => e
|
|
||||||
# this is sometimes wrong if the dependency chain is more than one deep
|
|
||||||
# but can't easily fix this without a rewrite FIXME-brew2
|
|
||||||
e.dependent = f.name
|
|
||||||
raise
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def build_bottle_preinstall
|
def build_bottle_preinstall
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user