aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Nagel2014-03-27 17:13:39 -0500
committerJack Nagel2014-03-27 17:14:55 -0500
commiteddcd7587f762001a896d204e4de886dc96bcb5e (patch)
tree00e0af1ccfd85b0857fd7e59128e5b7303d9a52e
parentf788e398302f74f77c32e242a243d539908d942d (diff)
downloadhomebrew-eddcd7587f762001a896d204e4de886dc96bcb5e.tar.bz2
Put constant strings in a constant
-rw-r--r--Library/Homebrew/keg.rb20
1 files changed, 13 insertions, 7 deletions
diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb
index c72c1da04..a6683c9b3 100644
--- a/Library/Homebrew/keg.rb
+++ b/Library/Homebrew/keg.rb
@@ -17,6 +17,18 @@ class Keg < Pathname
case d when 'LinkedKegs' then HOMEBREW_LIBRARY/d else HOMEBREW_PREFIX/d end
end
+ # These paths relative to the keg's share directory should always be real
+ # directories in the prefix, never symlinks.
+ SHARE_PATHS = %w[
+ aclocal doc info locale man
+ man/man1 man/man2 man/man3 man/man4
+ man/man5 man/man6 man/man7 man/man8
+ man/cat1 man/cat2 man/cat3 man/cat4
+ man/cat5 man/cat6 man/cat7 man/cat8
+ applications gnome gnome/help icons
+ mime-info pixmaps sounds
+ ]
+
# if path is a file in a keg then this will return the containing Keg object
def self.for path
path = path.realpath
@@ -116,12 +128,6 @@ class Keg < Pathname
ObserverPathnameExtension.reset_counts!
- share_mkpaths = %w[aclocal doc info locale man]
- share_mkpaths.concat((1..8).map { |i| "man/man#{i}" })
- share_mkpaths.concat((1..8).map { |i| "man/cat#{i}" })
- # Paths used by Gnome Desktop support
- share_mkpaths.concat %w[applications gnome gnome/help icons mime-info pixmaps sounds]
-
# yeah indeed, you have to force anything you need in the main tree into
# these dirs REMEMBER that *NOT* everything needs to be in the main tree
link_dir('etc', mode) {:mkpath}
@@ -134,7 +140,7 @@ class Keg < Pathname
when 'locale/locale.alias' then :skip_file
when INFOFILE_RX then :info
when LOCALEDIR_RX then :mkpath
- when *share_mkpaths then :mkpath
+ when *SHARE_PATHS then :mkpath
when /^icons\/.*\/icon-theme\.cache$/ then :skip_file
# all icons subfolders should also mkpath
when /^icons\// then :mkpath