mirror of
https://github.com/mistydemeo/tigerbrew.git
synced 2026-12-01 13:09:47 -05:00
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.
This commit is contained in:
1 parent
5241271889
commit
75e371684e
3 files changed
+6
-6
No files matched your search
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user