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>
This commit is contained in:
parent
f2b6ec0bfc
commit
35c47f81f2
@ -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$/
|
||||
|
Loading…
x
Reference in New Issue
Block a user