aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/formula.rb
diff options
context:
space:
mode:
authorMike McQuaid2012-11-25 14:33:52 +0000
committerMike McQuaid2012-12-01 12:45:23 +0000
commitc4fb2b73e2602c07e02a78360ef9de59d417ca37 (patch)
treee8452a683d76d73010f5e68ee23d53f8719e45bb /Library/Homebrew/formula.rb
parent92c971fbb40c2212136c38fdb77fdb750e14a345 (diff)
downloadbrew-c4fb2b73e2602c07e02a78360ef9de59d417ca37.tar.bz2
Support installing bottles from local files.
Diffstat (limited to 'Library/Homebrew/formula.rb')
-rw-r--r--Library/Homebrew/formula.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index d553846e3..3563badec 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -355,6 +355,11 @@ class Formula
end
install_type = :from_url
+ elsif name.match bottle_regex
+ bottle_filename = Pathname(name).realpath
+ name = name.split('-').first
+ path = Formula.path(name)
+ install_type = :from_local_bottle
else
name = Formula.canonical_name(name)
@@ -395,6 +400,12 @@ class Formula
raise LoadError
end
+ if install_type == :from_local_bottle
+ formula = klass.new(name)
+ formula.downloader.local_bottle_path = bottle_filename
+ return formula
+ end
+
raise NameError if !klass.ancestors.include? Formula
return klass.new(name) if install_type == :from_name