From 6ac0a285239d5fbd7943f070eac0e68847046ff8 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Wed, 24 Aug 2011 01:13:15 +0100 Subject: [PATCH] Implement bottles again Bottles now pour purely, without doing all the other unnecessary stuff that happened before the `brew upgrade` code shuffle. Formula.pourable? removed since it was install-specific metadata and not related to the formula itself. Now all such logic is in the FormulaInstaller which is much cleaner. I also changed the bottle cache location to the normal directory and added a .bottle pre-extension. Thus you can see everything in one directory without messing about. --- Library/Homebrew/download_strategy.rb | 3 +- Library/Homebrew/formula.rb | 40 ++++++++------------------- Library/Homebrew/formula_installer.rb | 16 +++++++++-- 3 files changed, 26 insertions(+), 33 deletions(-) diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 6db69f3e3b..32afea120d 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -183,8 +183,7 @@ end class CurlBottleDownloadStrategy e opoo "The cleaning step did not complete successfully" puts "Still, the installation was successful, so we will link it into your prefix" @@ -157,6 +157,18 @@ class FormulaInstaller @show_summary_heading = true end + def pour + HOMEBREW_CACHE.mkpath + downloader = CurlBottleDownloadStrategy.new f.bottle, f.name, f.version, nil + downloader.fetch + f.verify_download_integrity downloader.tarball_path, f.bottle_sha1, "SHA1" + HOMEBREW_CELLAR.cd do + downloader.stage + end + end + + ## checks + def paths @paths ||= ENV['PATH'].split(':').map{ |p| File.expand_path p } end