aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorMartin Afanasjew2016-01-06 08:38:44 +0100
committerMartin Afanasjew2016-01-06 21:59:33 +0100
commit2c2f5ade6a20a8dde02d86e3e85b8e026a17589d (patch)
tree7b8c6f72ffdc5ac5b2566ec8d56bf92c56dbcb8d /Library/Homebrew/cmd
parentf11bea015370ce813b14bf3bf425bffe159c5425 (diff)
downloadbrew-2c2f5ade6a20a8dde02d86e3e85b8e026a17589d.tar.bz2
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.
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/list.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/Library/Homebrew/cmd/list.rb b/Library/Homebrew/cmd/list.rb
index b35b0e389..0ebe5f578 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"