diff options
| author | Mike McQuaid | 2012-03-18 16:35:09 +1300 |
|---|---|---|
| committer | Mike McQuaid | 2012-03-18 16:35:09 +1300 |
| commit | 0d67d3baf102447340ad4909292d40e153929b64 (patch) | |
| tree | 4022cb3b9ffbcfa47b47384ae6672cc83716a652 /Library/Homebrew | |
| parent | 23b84ef73243e24444c6f16576097a3199243f2d (diff) | |
| download | brew-0d67d3baf102447340ad4909292d40e153929b64.tar.bz2 | |
Fix bottle redownloading and bad naming.
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/download_strategy.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 5e91ac11b..982b98e64 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -191,7 +191,14 @@ end class CurlBottleDownloadStrategy < CurlDownloadStrategy def initialize url, name, version, specs super - @tarball_path = HOMEBREW_CACHE/"#{name}-#{version}.#{MacOS.cat}.bottle#{ext}" + @tarball_path = HOMEBREW_CACHE/"#{name}-#{version}#{ext}" + + unless @tarball_path.exist? + old_bottle_path = HOMEBREW_CACHE/"#{name}-#{version}#{bottle_suffix}" + old_bottle_path = HOMEBREW_CACHE/"#{name}-#{version}-bottle.tar.gz" unless old_bottle_path.exist? + old_bottle_path = HOMEBREW_CACHE/"#{name}-#{version}.#{MacOS.cat}.bottle-bottle.tar.gz" unless old_bottle_path.exist? + FileUtils.mv old_bottle_path, @tarball_path if old_bottle_path.exist? + end end def stage ohai "Pouring #{File.basename(@tarball_path)}" |
