formula_installer: preinstall any pre-fetch dependencies
This commit is contained in:
parent
d0de6ac249
commit
508b48d19e
@ -45,7 +45,7 @@ class DependencyCollector
|
|||||||
end
|
end
|
||||||
|
|
||||||
def cache_key(spec)
|
def cache_key(spec)
|
||||||
if spec.is_a?(Resource) && spec.download_strategy == CurlDownloadStrategy
|
if spec.is_a?(Resource) && spec.download_strategy <= CurlDownloadStrategy
|
||||||
File.extname(spec.url)
|
File.extname(spec.url)
|
||||||
else
|
else
|
||||||
spec
|
spec
|
||||||
@ -148,7 +148,7 @@ class DependencyCollector
|
|||||||
strategy = spec.download_strategy
|
strategy = spec.download_strategy
|
||||||
|
|
||||||
if strategy <= HomebrewCurlDownloadStrategy
|
if strategy <= HomebrewCurlDownloadStrategy
|
||||||
brewed_curl_dep_if_needed(tags)
|
@deps << brewed_curl_dep_if_needed(tags)
|
||||||
parse_url_spec(spec.url, tags)
|
parse_url_spec(spec.url, tags)
|
||||||
elsif strategy <= CurlDownloadStrategy
|
elsif strategy <= CurlDownloadStrategy
|
||||||
parse_url_spec(spec.url, tags)
|
parse_url_spec(spec.url, tags)
|
||||||
|
@ -215,6 +215,7 @@ class FormulaInstaller
|
|||||||
forbidden_license_check
|
forbidden_license_check
|
||||||
|
|
||||||
check_install_sanity
|
check_install_sanity
|
||||||
|
install_fetch_deps unless ignore_deps?
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { void }
|
sig { void }
|
||||||
@ -343,6 +344,19 @@ class FormulaInstaller
|
|||||||
"#{formula.full_name} requires the latest version of pinned dependencies"
|
"#{formula.full_name} requires the latest version of pinned dependencies"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
sig { void }
|
||||||
|
def install_fetch_deps
|
||||||
|
return if @compute_dependencies.blank?
|
||||||
|
|
||||||
|
compute_dependencies(use_cache: false) if @compute_dependencies.any? do |dep, options|
|
||||||
|
next false unless dep.tags == [:build, :test]
|
||||||
|
|
||||||
|
fetch_dependencies
|
||||||
|
install_dependency(dep, options)
|
||||||
|
true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def build_bottle_preinstall
|
def build_bottle_preinstall
|
||||||
@etc_var_dirs ||= [HOMEBREW_PREFIX/"etc", HOMEBREW_PREFIX/"var"]
|
@etc_var_dirs ||= [HOMEBREW_PREFIX/"etc", HOMEBREW_PREFIX/"var"]
|
||||||
@etc_var_preinstall = Find.find(*@etc_var_dirs.select(&:directory?)).to_a
|
@etc_var_preinstall = Find.find(*@etc_var_dirs.select(&:directory?)).to_a
|
||||||
|
Loading…
x
Reference in New Issue
Block a user