aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/tab.rb4
-rw-r--r--Library/Homebrew/test/keg_test.rb1
2 files changed, 4 insertions, 1 deletions
diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb
index 1cabacefd..6b274b143 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 fdc739c9d..2c91027e5 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