aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2012-10-09 14:45:53 -0500
committerJack Nagel2012-10-09 14:49:38 -0500
commit35c47f81f28da1e6ca64014d3ddf09528b506763 (patch)
tree65d586ca05adc3661c2c71a64186bd2b3a59f47a /Library
parentf2b6ec0bfcc05e5f9061b64e6c236ba757de97eb (diff)
downloadbrew-35c47f81f28da1e6ca64014d3ddf09528b506763.tar.bz2
Don't munge tapped formula names in Formula.factory
This started happening as a result of bbc167b, which avoids reloading previously defined formulae. The exception alters its message if the name parameter appears to be a tapped formula, but this is lost if we only pass in the "stem" of the pathname. Long-term this probably needs some restructuring, perhaps with a separate exception for tapped formula, but for now this should re-enable the more useful error message. Fixes Homebrew/homebrew#15374. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formula.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 5ba20b473..d23aeea71 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -367,9 +367,14 @@ class Formula
install_type = :from_url
else
name = Formula.canonical_name(name)
- # If name was a path or mapped to a cached formula
- if name.include? "/"
+ if name =~ %r{^(\w+)/(\w+)/([^/])+$}
+ # name appears to be a tapped formula, so we don't munge it
+ # in order to provide a useful error message when require fails.
+ path = Pathname.new(name)
+ elsif name.include? "/"
+ # If name was a path or mapped to a cached formula
+
# require allows filenames to drop the .rb extension, but everything else
# in our codebase will require an exact and fullpath.
name = "#{name}.rb" unless name =~ /\.rb$/