Fix bottle redownloading and bad naming.

This commit is contained in:
Mike McQuaid 2012-03-18 16:35:09 +13:00
parent 23b84ef732
commit 0d67d3baf1

View File

@ -191,7 +191,14 @@ end
class CurlBottleDownloadStrategy < CurlDownloadStrategy class CurlBottleDownloadStrategy < CurlDownloadStrategy
def initialize url, name, version, specs def initialize url, name, version, specs
super 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 end
def stage def stage
ohai "Pouring #{File.basename(@tarball_path)}" ohai "Pouring #{File.basename(@tarball_path)}"