From 97fa28248d70e3b2b51d270ec3f4dcb7aca57f02 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Wed, 4 Jan 2012 20:50:19 -0600 Subject: [PATCH] Force creation of locale-specific man directories Signed-off-by: Jack Nagel --- Library/Homebrew/keg.rb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb index 0f1ce70fe7..e0bbc94f0a 100644 --- a/Library/Homebrew/keg.rb +++ b/Library/Homebrew/keg.rb @@ -56,6 +56,8 @@ class Keg < Pathname $d=0 share_mkpaths=%w[aclocal doc info locale man]+(1..8).collect{|x|"man/man#{x}"} + # cat pages are rare, but exist so the directories should be created + share_mkpaths << (1..8).collect{ |x| "man/cat#{x}" } # 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 @@ -63,7 +65,16 @@ class Keg < Pathname link_dir('bin') {:skip} link_dir('sbin') {:link} link_dir('include') {:link} - link_dir('share') {|path| :mkpath if share_mkpaths.include? path.to_s} + + link_dir('share') do |path| + # locale-specific directories have the form + # language[_territory][.codeset][@modifier] + if path.to_s =~ /man\/([a-z]{2}|C|POSIX)(_[A-Z]{2})?(\.[a-zA-Z\-0-9]+(@.+)?)?/ + :mkpath + elsif share_mkpaths.include? path.to_s + :mkpath + end + end link_dir('lib') do |path| case path.to_s