diff options
| author | Charlie Sharpsteen | 2011-09-11 15:23:41 -0700 |
|---|---|---|
| committer | Charlie Sharpsteen | 2011-09-19 09:24:43 -0700 |
| commit | efcdbd691e672b8fa0f57540e1f687b07b7d84f8 (patch) | |
| tree | a865faf3aaff17c7a0bbfe0c5ec8647e68e3f070 /Library/Homebrew/cmd | |
| parent | 3b5869acb59c9cc7c9ab0dfdf3fe756f3245511c (diff) | |
| download | homebrew-efcdbd691e672b8fa0f57540e1f687b07b7d84f8.tar.bz2 | |
mirror support: Add mirror method to Formula.rb
Mirrors can now be declared using the `mirror` method which works similar to
`depends_on` and takes the same arguments as `url`.
The formula class now has a public `fetch` method that cycles through the
mirror list if the downloader for the primary URL throws a `DownloadError`.
Other brew commands, like brew-fetch, also benefit from mirror support by using
this method.
Closes #7574.
Diffstat (limited to 'Library/Homebrew/cmd')
| -rw-r--r-- | Library/Homebrew/cmd/fetch.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/fetch.rb b/Library/Homebrew/cmd/fetch.rb index de3efe124..19060bc01 100644 --- a/Library/Homebrew/cmd/fetch.rb +++ b/Library/Homebrew/cmd/fetch.rb @@ -10,7 +10,7 @@ module Homebrew extend self bucket << f bucket << f.recursive_deps end - + bucket = bucket.flatten.uniq else bucket = ARGV.formulae @@ -24,7 +24,7 @@ module Homebrew extend self FileUtils.rm_rf where_to if File.exist? where_to end - the_tarball = f.downloader.fetch + the_tarball, _ = f.fetch next unless the_tarball.kind_of? Pathname previous_md5 = f.instance_variable_get(:@md5) |
