aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorMike McQuaid2013-06-20 13:07:43 +0100
committerMike McQuaid2013-06-20 13:07:43 +0100
commita783946b6dc1e2ccbce9260a5d132330811bd317 (patch)
treec40c555ab2398db8f94811acb9f30c7cc1d9a7f4 /Library/Homebrew
parentd456d42813e863f15660e6b07b3d397dc82a9e3e (diff)
downloadbrew-a783946b6dc1e2ccbce9260a5d132330811bd317.tar.bz2
Formula: improve local bottle failure messaging.
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/formula.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index a26e7e448..6026f5b6e 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -406,7 +406,15 @@ class Formula
elsif name.match bottle_regex
bottle_filename = Pathname(name).realpath
version = Version.parse(bottle_filename).to_s
- name = bottle_filename.basename.to_s.rpartition("-#{version}").first
+ bottle_basename = bottle_filename.basename.to_s
+ name_without_version = bottle_basename.rpartition("-#{version}").first
+ if name_without_version.empty?
+ if ARGV.homebrew_developer?
+ opoo "Add a new version regex to version.rb to parse this filename."
+ end
+ else
+ name = name_without_version
+ end
path = Formula.path(name)
install_type = :from_local_bottle
else