diff --git a/Library/Homebrew/cmd/desc.rb b/Library/Homebrew/cmd/desc.rb index 19076dc140..46fff56915 100644 --- a/Library/Homebrew/cmd/desc.rb +++ b/Library/Homebrew/cmd/desc.rb @@ -72,11 +72,12 @@ module Homebrew else query = args.named.join(" ") string_or_regex = query_regexp(query) + eval_all = args.eval_all? || Homebrew::EnvConfig.eval_all? unless args.cask? ohai "Formulae" CacheStoreDatabase.use(:descriptions) do |db| cache_store = DescriptionCacheStore.new(db) - Descriptions.search(string_or_regex, search_type, cache_store).print + Descriptions.search(string_or_regex, search_type, cache_store, eval_all).print end end unless args.formula? @@ -84,7 +85,7 @@ module Homebrew ohai "Casks" CacheStoreDatabase.use(:cask_descriptions) do |db| cache_store = CaskDescriptionCacheStore.new(db) - Descriptions.search(string_or_regex, search_type, cache_store).print + Descriptions.search(string_or_regex, search_type, cache_store, eval_all).print end end end diff --git a/Library/Homebrew/description_cache_store.rb b/Library/Homebrew/description_cache_store.rb index e43f88e1ba..c4211c6f61 100644 --- a/Library/Homebrew/description_cache_store.rb +++ b/Library/Homebrew/description_cache_store.rb @@ -33,8 +33,8 @@ class DescriptionCacheStore < CacheStore # If the database is empty `update!` it with all known formulae. # # @return [nil] - def populate_if_empty! - return unless Homebrew::EnvConfig.eval_all? + def populate_if_empty!(eval_all: Homebrew::EnvConfig.eval_all?) + return unless eval_all return unless database.empty? Formula.all.each { |f| update!(f.full_name, f.desc) } diff --git a/Library/Homebrew/descriptions.rb b/Library/Homebrew/descriptions.rb index 81d451e2f9..ab72a922d8 100644 --- a/Library/Homebrew/descriptions.rb +++ b/Library/Homebrew/descriptions.rb @@ -13,8 +13,8 @@ class Descriptions extend Homebrew::Search # Given a regex, find all formulae whose specified fields contain a match. - def self.search(string_or_regex, field, cache_store) - cache_store.populate_if_empty! + def self.search(string_or_regex, field, cache_store, eval_all) + cache_store.populate_if_empty!(eval_all: eval_all) results = case field when :name