From 6d06b9a1796383e9daf40670a0995da6eefd330b Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Sat, 16 Jan 2010 17:54:14 -0800 Subject: [PATCH] Create Download Strategy sooner in formula install code. * Instantiate DownloadStrategy instance when creating a formula. * Rename CurlDownloadStrategy member to clarify what it is for. * Generate downloaded tarball name in initialize. --- Library/Homebrew/download_strategy.rb | 36 +++++++++++++++------------ Library/Homebrew/formula.rb | 13 +++++++--- 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 68cb0bf16c..c15ea4bd63 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -53,42 +53,46 @@ class AbstractDownloadStrategy end class CurlDownloadStrategy '-qq'}, @dl + quiet_safe_system '/usr/bin/unzip', {:quiet_flag => '-qq'}, @tarball_path chdir when /^\037\213/, /^BZh/, /^\037\235/ # gzip/bz2/compress compressed # TODO check if it's really a tar archive - safe_system '/usr/bin/tar', 'xf', @dl + safe_system '/usr/bin/tar', 'xf', @tarball_path chdir else # we are assuming it is not an archive, use original filename @@ -98,7 +102,7 @@ class CurlDownloadStrategy