Tab: handle non-core kegs without receipts

Passing Formula.factory the name of a keg that belongs to a non-core
formula will cause an error to be raised; we don't really care, so just
fake a totally empty install receipt in this case.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
Jack Nagel 2012-01-05 11:57:24 -06:00
parent 97fa28248d
commit d274d37263

View File

@ -33,7 +33,11 @@ class Tab < OpenStruct
if path.exist?
self.from_file path
else
self.dummy_tab Formula.factory(keg.parent.basename)
begin
self.dummy_tab Formula.factory(keg.parent.basename)
rescue FormulaUnavailableError
Tab.new :used_options => [], :unused_options => []
end
end
end