aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/build.rb
diff options
context:
space:
mode:
authorAdam Vandenberg2012-09-09 13:19:53 -0700
committerAdam Vandenberg2012-11-11 10:27:03 -0800
commit4b72e444613509b3102a94de1d1029a9318fcbad (patch)
treee721a0f1810d016d601957031ce289c880afc368 /Library/Homebrew/build.rb
parentff55e7d82e7087567c9a370817d25e1542ff31f9 (diff)
downloadbrew-4b72e444613509b3102a94de1d1029a9318fcbad.tar.bz2
Use a class for FORMULA_META_FILES
* lets more text types get picked up * better filter for `brew list`
Diffstat (limited to 'Library/Homebrew/build.rb')
-rwxr-xr-xLibrary/Homebrew/build.rb21
1 files changed, 12 insertions, 9 deletions
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