aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2012-03-18 16:35:09 +1300
committerMike McQuaid2012-03-18 16:35:09 +1300
commit23019d8ee8d3e6be37e561641b2650f372601127 (patch)
treeee34f130054dd833a4bc6c4c874ddb66815d38e9 /Library
parent9c16145d8c22e856ef7dca0ebcfca9519392687a (diff)
downloadhomebrew-23019d8ee8d3e6be37e561641b2650f372601127.tar.bz2
Fix bottle redownloading and bad naming.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/download_strategy.rb9
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)}"