aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorJack Nagel2013-05-16 14:06:26 -0500
committerJack Nagel2013-05-16 14:06:26 -0500
commit75e371684eee49c699bcd192ecc98048855836ca (patch)
tree54e32525f8934b89957f91ab08bc4459a2707cfd /Library/Homebrew
parent5241271889a465215c4c37cb5f91b6c9762e5f8b (diff)
downloadhomebrew-75e371684eee49c699bcd192ecc98048855836ca.tar.bz2
Adjust semantics of Formula#fetch
It doesn't really make logical sense that this method returns both the fetched path (or sometimes nil!) and the downloader, so just return the path (again, or nil!) and callers that want the downloader can ask for it separately.
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/cmd/fetch.rb2
-rw-r--r--Library/Homebrew/formula.rb6
-rw-r--r--Library/Homebrew/formula_installer.rb4
3 files changed, 6 insertions, 6 deletions
diff --git a/Library/Homebrew/cmd/fetch.rb b/Library/Homebrew/cmd/fetch.rb
index cb0fd4660..24b1b0614 100644
--- a/Library/Homebrew/cmd/fetch.rb
+++ b/Library/Homebrew/cmd/fetch.rb
@@ -25,7 +25,7 @@ module Homebrew extend self
def fetch_formula f
f.cached_download.rmtree if already_fetched?(f) && ARGV.force?
- download, _ = f.fetch
+ download = f.fetch
# FIXME why are strategies returning different types?
return unless download.is_a? Pathname
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index dafb18ed0..53aec6dcf 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -618,7 +618,7 @@ class Formula
def fetch
# Ensure the cache exists
HOMEBREW_CACHE.mkpath
- return downloader.fetch, downloader
+ downloader.fetch
end
# For FormulaInstaller.
@@ -643,8 +643,8 @@ class Formula
private
def stage
- fetched, downloader = fetch
- verify_download_integrity fetched if fetched.kind_of? Pathname
+ fetched = fetch
+ verify_download_integrity(fetched) if fetched.kind_of? Pathname
mktemp do
downloader.stage
# Set path after the downloader changes the working folder.
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index e397195ef..fa7578c4f 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -406,8 +406,8 @@ class FormulaInstaller
end
def pour
- fetched, downloader = f.fetch
- f.verify_download_integrity fetched unless downloader.local_bottle_path
+ fetched, downloader = f.fetch, f.downloader
+ f.verify_download_integrity(fetched) unless downloader.local_bottle_path
HOMEBREW_CELLAR.cd do
downloader.stage
end