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