Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
brew
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KMSCAKKSCFKA AKFACAMADCAS
brew
Commits
ea32b516
Commit
ea32b516
authored
11 years ago
by
Jack Nagel
Browse files
Options
Downloads
Patches
Plain Diff
ApacheDownloadStrategy: fall back to specified mirrors
Fixes Homebrew/homebrew#24157.
parent
45844074
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Library/Homebrew/download_strategy.rb
+7
-4
7 additions, 4 deletions
Library/Homebrew/download_strategy.rb
with
7 additions
and
4 deletions
Library/Homebrew/download_strategy.rb
+
7
−
4
View file @
ea32b516
...
...
@@ -236,13 +236,16 @@ class CurlApacheMirrorDownloadStrategy < CurlDownloadStrategy
end
def
_fetch
return
super
if
@tried_apache_mirror
@tried_apache_mirror
=
true
mirrors
=
Utils
::
JSON
.
load
(
apache_mirrors
)
url
=
mirrors
.
fetch
(
'preferred'
)
+
mirrors
.
fetch
(
'path_info'
)
@
url
=
mirrors
.
fetch
(
'preferred'
)
+
mirrors
.
fetch
(
'path_info'
)
ohai
"Best Mirror
#{
url
}
"
curl
url
,
'-C'
,
downloaded_size
,
'-o'
,
temporary_path
ohai
"Best Mirror
#{
@
url
}
"
super
rescue
IndexError
,
Utils
::
JSON
::
Error
raise
"Couldn't determine mirror
. T
ry again later."
raise
CurlDownloadStrategyError
,
"Couldn't determine mirror
, t
ry again later."
end
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment