aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike McQuaid2016-09-15 11:49:28 +0100
committerGitHub2016-09-15 11:49:28 +0100
commitfcb9659052eb0d626c2bb86898d5bf54c56b5a5a (patch)
treec29b391624f6fc527b4a5ac794ccb5d4510388f4
parente02962f84e42c37df328d42bebb0092fe8edf239 (diff)
parent842d6ce8bdc2296869c41c5866bbf5f046ac6eb8 (diff)
downloadbrew-fcb9659052eb0d626c2bb86898d5bf54c56b5a5a.tar.bz2
Merge pull request #967 from MikeMcQuaid/keg-all-top-dirs
keg: add ALL_TOP_LEVEL_DIRECTORIES constant.
-rw-r--r--Library/Homebrew/diagnostic.rb3
-rw-r--r--Library/Homebrew/keg.rb1
2 files changed, 2 insertions, 2 deletions
diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb
index 1b3018251..7cc6371bd 100644
--- a/Library/Homebrew/diagnostic.rb
+++ b/Library/Homebrew/diagnostic.rb
@@ -308,8 +308,7 @@ module Homebrew
def check_access_prefix_directories
not_writable_dirs = []
- extra_dirs = ["lib/pkgconfig", "share/locale", "share/man", "opt"]
- (Keg::TOP_LEVEL_DIRECTORIES + extra_dirs).each do |dir|
+ Keg::ALL_TOP_LEVEL_DIRECTORIES.each do |dir|
path = HOMEBREW_PREFIX/dir
next unless path.exist?
next if path.writable_real?
diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb
index bc4b9ed6e..d40994368 100644
--- a/Library/Homebrew/keg.rb
+++ b/Library/Homebrew/keg.rb
@@ -65,6 +65,7 @@ class Keg
LOCALEDIR_RX = /(locale|man)\/([a-z]{2}|C|POSIX)(_[A-Z]{2})?(\.[a-zA-Z\-0-9]+(@.+)?)?/
INFOFILE_RX = %r{info/([^.].*?\.info|dir)$}
TOP_LEVEL_DIRECTORIES = %w[bin etc include lib sbin share var Frameworks]
+ ALL_TOP_LEVEL_DIRECTORIES = (TOP_LEVEL_DIRECTORIES + %w[lib/pkgconfig share/locale share/man opt]).freeze
PRUNEABLE_DIRECTORIES = %w[bin etc include lib sbin share Frameworks LinkedKegs].map do |d|
case d when "LinkedKegs" then HOMEBREW_LIBRARY/d else HOMEBREW_PREFIX/d end
end