From 4b72e444613509b3102a94de1d1029a9318fcbad Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Sun, 9 Sep 2012 13:19:53 -0700 Subject: Use a class for FORMULA_META_FILES * lets more text types get picked up * better filter for `brew list` --- Library/Homebrew/build.rb | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'Library/Homebrew/build.rb') diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb index 85ff88705..656b5e8c0 100755 --- a/Library/Homebrew/build.rb +++ b/Library/Homebrew/build.rb @@ -144,19 +144,22 @@ def install f end # Find and link metafiles - FORMULA_META_FILES.each do |filename| - next if File.directory? filename - target_file = filename - target_file = "#{filename}.txt" if File.exists? "#{filename}.txt" - # Some software symlinks these files (see help2man.rb) - target_file = Pathname.new(target_file).resolved_path - f.prefix.install target_file => filename rescue nil - (f.prefix/filename).chmod 0644 rescue nil - end + install_meta_files Pathname.pwd, f.prefix end end end +def install_meta_files src_path, dst_path + src_path.children.each do |p| + next if p.directory? + next unless FORMULA_META_FILES.should_copy? p + # Some software symlinks these files (see help2man.rb) + filename = p.resolved_path + filename.chmod 0644 + dst_path.install filename + end +end + def fixopt f path = if f.linked_keg.directory? and f.linked_keg.symlink? f.linked_keg.realpath -- cgit v1.2.3