From 0d67d3baf102447340ad4909292d40e153929b64 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sun, 18 Mar 2012 16:35:09 +1300 Subject: [PATCH] Fix bottle redownloading and bad naming. --- Library/Homebrew/download_strategy.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 5e91ac11be..982b98e64b 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)}"