Merge pull request #12296 from EricFromCanada/svn-certificates
formula_installer: always pre-install formulae required for fetching sources
This commit is contained in:
commit
95d2ca289c
4
.github/workflows/tests.yml
vendored
4
.github/workflows/tests.yml
vendored
@ -305,10 +305,6 @@ jobs:
|
|||||||
|
|
||||||
- name: Install brew tests dependencies
|
- name: Install brew tests dependencies
|
||||||
run: |
|
run: |
|
||||||
brew install subversion
|
|
||||||
brew sh -c "svn --homebrew=print-path"
|
|
||||||
which svn
|
|
||||||
which svnadmin
|
|
||||||
brew install curl
|
brew install curl
|
||||||
which curl
|
which curl
|
||||||
|
|
||||||
|
|||||||
@ -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)
|
||||||
|
|||||||
@ -763,10 +763,7 @@ class SubversionDownloadStrategy < VCSDownloadStrategy
|
|||||||
|
|
||||||
args << "--ignore-externals" if ignore_externals
|
args << "--ignore-externals" if ignore_externals
|
||||||
|
|
||||||
if meta[:trust_cert] == true
|
args.concat Utils::Svn.invalid_cert_flags if meta[:trust_cert] == true
|
||||||
args << "--trust-server-cert"
|
|
||||||
args << "--non-interactive"
|
|
||||||
end
|
|
||||||
|
|
||||||
if target.directory?
|
if target.directory?
|
||||||
command! "svn", args: ["update", *args], chdir: target.to_s, timeout: timeout&.remaining
|
command! "svn", args: ["update", *args], chdir: target.to_s, timeout: timeout&.remaining
|
||||||
|
|||||||
@ -8,7 +8,7 @@ class DependencyCollector
|
|||||||
def git_dep_if_needed(tags); end
|
def git_dep_if_needed(tags); end
|
||||||
|
|
||||||
def subversion_dep_if_needed(tags)
|
def subversion_dep_if_needed(tags)
|
||||||
Dependency.new("subversion", tags) if MacOS.version >= :catalina
|
Dependency.new("subversion", tags)
|
||||||
end
|
end
|
||||||
|
|
||||||
def cvs_dep_if_needed(tags)
|
def cvs_dep_if_needed(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
|
||||||
|
|||||||
@ -30,9 +30,22 @@ module Utils
|
|||||||
def remote_exists?(url)
|
def remote_exists?(url)
|
||||||
return true unless available?
|
return true unless available?
|
||||||
|
|
||||||
|
args = ["ls", url, "--depth", "empty"]
|
||||||
|
_, stderr, status = system_command("svn", args: args, print_stderr: false)
|
||||||
|
return status.success? unless stderr.include?("certificate verification failed")
|
||||||
|
|
||||||
# OK to unconditionally trust here because we're just checking if a URL exists.
|
# OK to unconditionally trust here because we're just checking if a URL exists.
|
||||||
system_command("svn", args: ["ls", url, "--depth", "empty",
|
system_command("svn", args: args.concat(invalid_cert_flags), print_stderr: false).success?
|
||||||
"--non-interactive", "--trust-server-cert"], print_stderr: false).success?
|
end
|
||||||
|
|
||||||
|
sig { returns(Array) }
|
||||||
|
def invalid_cert_flags
|
||||||
|
opoo "Ignoring Subversion certificate errors!"
|
||||||
|
args = ["--non-interactive", "--trust-server-cert"]
|
||||||
|
if Version.create(version || "-1") >= Version.create("1.9")
|
||||||
|
args << "--trust-server-cert-failures=expired,not-yet-valid"
|
||||||
|
end
|
||||||
|
args
|
||||||
end
|
end
|
||||||
|
|
||||||
def clear_version_cache
|
def clear_version_cache
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user