From 2c2f5ade6a20a8dde02d86e3e85b8e026a17589d Mon Sep 17 00:00:00 2001 From: Martin Afanasjew Date: Wed, 6 Jan 2016 08:38:44 +0100 Subject: [PATCH] list: exclude Homebrew logs from unbrewed Treat it like the cache, i.e., if the logs directory is inside the Homebrew prefix, skip it instead of listing all the logs. This avoids spurious output in `brew list --unbrewed` when the Homebrew logs directory is a subdirectory of the Homebrew prefix. --- Library/Homebrew/cmd/list.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/cmd/list.rb b/Library/Homebrew/cmd/list.rb index b35b0e3891..0ebe5f578b 100644 --- a/Library/Homebrew/cmd/list.rb +++ b/Library/Homebrew/cmd/list.rb @@ -61,9 +61,10 @@ module Homebrew dirs = HOMEBREW_PREFIX.subdirs.map { |dir| dir.basename.to_s } dirs -= %w[Library Cellar .git] - # Exclude the repository and cache, if they are located under the prefix - dirs.delete HOMEBREW_CACHE.relative_path_from(HOMEBREW_PREFIX).to_s - dirs.delete HOMEBREW_REPOSITORY.relative_path_from(HOMEBREW_PREFIX).to_s + # Exclude cache, logs, and repository, if they are located under the prefix. + [HOMEBREW_CACHE, HOMEBREW_LOGS, HOMEBREW_REPOSITORY].each do |dir| + dirs.delete dir.relative_path_from(HOMEBREW_PREFIX).to_s + end dirs.delete "etc" dirs.delete "var"