diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb index 1cabacefdd..6b274b1438 100644 --- a/Library/Homebrew/tab.rb +++ b/Library/Homebrew/tab.rb @@ -317,6 +317,10 @@ class Tab < OpenStruct end def write + # If this is a new installation, the cache of installed formulae + # will no longer be valid. + Formula.clear_cache unless tabfile.exist? + CACHE[tabfile] = self tabfile.atomic_write(to_json) end diff --git a/Library/Homebrew/test/keg_test.rb b/Library/Homebrew/test/keg_test.rb index fdc739c9d8..2c91027e5b 100644 --- a/Library/Homebrew/test/keg_test.rb +++ b/Library/Homebrew/test/keg_test.rb @@ -327,7 +327,6 @@ class InstalledDependantsTests < LinkTests f = stub_formula_name(name) keg = super Tab.create(f, DevelopmentTools.default_compiler, :libcxx).write - Formula.clear_cache keg end