keg: cache runtime_dependencies.
This commit is contained in:
parent
3aa7624284
commit
eeb9ac36a2
@ -263,6 +263,7 @@ module Homebrew
|
||||
|
||||
changed_files = keg.replace_locations_with_placeholders unless args.skip_relocation?
|
||||
|
||||
Keg.clear_cache
|
||||
Tab.clear_cache
|
||||
tab = Tab.for_keg(keg)
|
||||
original_tab = tab.dup
|
||||
|
||||
@ -649,6 +649,7 @@ class FormulaInstaller
|
||||
|
||||
# Update tab with actual runtime dependencies
|
||||
tab = Tab.for_keg(keg)
|
||||
Keg.clear_cache
|
||||
Tab.clear_cache
|
||||
f_runtime_deps = formula.runtime_dependencies(read_from_tab: false)
|
||||
tab.runtime_dependencies = Tab.runtime_deps_hash(f_runtime_deps)
|
||||
|
||||
@ -6,6 +6,8 @@ require "lock_file"
|
||||
require "ostruct"
|
||||
|
||||
class Keg
|
||||
extend Cachable
|
||||
|
||||
class AlreadyLinkedError < RuntimeError
|
||||
def initialize(keg)
|
||||
super <<~EOS
|
||||
@ -519,7 +521,8 @@ class Keg
|
||||
end
|
||||
|
||||
def runtime_dependencies
|
||||
tab.runtime_dependencies
|
||||
Keg.cache[:runtime_dependencies] ||= {}
|
||||
Keg.cache[:runtime_dependencies][path] ||= tab.runtime_dependencies
|
||||
end
|
||||
|
||||
def aliases
|
||||
|
||||
@ -145,6 +145,7 @@ RSpec.configure do |config|
|
||||
|
||||
begin
|
||||
Homebrew.raise_deprecation_exceptions = true
|
||||
Keg.clear_cache
|
||||
Tap.clear_cache
|
||||
FormulaInstaller.clear_attempted
|
||||
|
||||
@ -177,6 +178,7 @@ RSpec.configure do |config|
|
||||
end
|
||||
|
||||
Tab.clear_cache
|
||||
Keg.clear_cache
|
||||
|
||||
FileUtils.rm_rf [
|
||||
TEST_DIRECTORIES.map(&:children),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user