aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2010-03-23 07:01:02 -0700
committerAdam Vandenberg2010-04-17 09:34:03 -0700
commitab9ccd7d8977e7929d948695b1f3d585cfb882f2 (patch)
tree9e8321a6770427010a0ae9899b9171fb8a2a95b1 /Library
parent9295f9c022305998bf375f12429593141203ce8d (diff)
downloadbrew-ab9ccd7d8977e7929d948695b1f3d585cfb882f2.tar.bz2
Read all formula in a 'rescue' block.
For operations that read all formulae, catch exceptions and skip broken ones, rather than bomb out entirely.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formula.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 4d67adfd6..10e345e70 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -34,10 +34,15 @@ class Formulary
def self.read_all
# yields once for each
Formulary.names.each do |name|
- require Formula.path(name)
- klass_name = Formula.class_s(name)
- klass = eval(klass_name)
- yield name, klass
+ begin
+ require Formula.path(name)
+ klass_name = Formula.class_s(name)
+ klass = eval(klass_name)
+ yield name, klass
+ rescue Exception=>e
+ opoo "Error importing #{name}:"
+ puts "#{e}"
+ end
end
end