aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-06-15 18:27:37 -0500
committerJack Nagel2014-06-15 20:23:20 -0500
commit550b0ae3910fc7dd9181d81941850ce60adc3841 (patch)
tree7a7f2270ea45f5dcb0d238ceae2e9665b38f2965 /Library
parenteb392257a4bd69a9c6133c1f90a8ffa648fed27b (diff)
downloadhomebrew-550b0ae3910fc7dd9181d81941850ce60adc3841.tar.bz2
Handle illegal constant names when fetching remote formulae
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formulary.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb
index 31a7fd51e..da64a43e5 100644
--- a/Library/Homebrew/formulary.rb
+++ b/Library/Homebrew/formulary.rb
@@ -141,7 +141,13 @@ class Formulary
# Downloads the formula's .rb file
def fetch
- unless Formulary.formula_class_defined? class_name
+ begin
+ have_klass = Formulary.formula_class_defined? class_name
+ rescue NameError
+ raise FormulaUnavailableError.new(name)
+ end
+
+ unless have_klass
HOMEBREW_CACHE_FORMULA.mkpath
FileUtils.rm path.to_s, :force => true
curl url, '-o', path.to_s