keg: make locale directory regexp a constant
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
parent
59458eac51
commit
8567570d97
@ -7,6 +7,8 @@ class Keg < Pathname
|
|||||||
raise "#{to_s} is not a directory" unless directory?
|
raise "#{to_s} is not a directory" unless directory?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# locale-specific directories have the form language[_territory][.codeset][@modifier]
|
||||||
|
LOCALEDIR_RX = /(locale|man)\/([a-z]{2}|C|POSIX)(_[A-Z]{2})?(\.[a-zA-Z\-0-9]+(@.+)?)?/
|
||||||
INFOFILE_RX = %r[/share/info/[^.].*?\.info$]
|
INFOFILE_RX = %r[/share/info/[^.].*?\.info$]
|
||||||
|
|
||||||
# if path is a file in a keg then this will return the containing Keg object
|
# if path is a file in a keg then this will return the containing Keg object
|
||||||
@ -70,9 +72,7 @@ class Keg < Pathname
|
|||||||
link_dir('include') {:link}
|
link_dir('include') {:link}
|
||||||
|
|
||||||
link_dir('share') do |path|
|
link_dir('share') do |path|
|
||||||
# locale-specific directories have the form
|
if path.to_s =~ LOCALEDIR_RX
|
||||||
# language[_territory][.codeset][@modifier]
|
|
||||||
if path.to_s =~ /(locale|man)\/([a-z]{2}|C|POSIX)(_[A-Z]{2})?(\.[a-zA-Z\-0-9]+(@.+)?)?/
|
|
||||||
:mkpath
|
:mkpath
|
||||||
elsif share_mkpaths.include? path.to_s
|
elsif share_mkpaths.include? path.to_s
|
||||||
:mkpath
|
:mkpath
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user