Library/Homebrew/keg.rb
# symlinks the contents of self+foo recursively into #{HOMEBREW_PREFIX}/foo
symlinks the contents of self+foo recursively into #{HOMEBREW_PREFIX}/foo
symlinks the contents of self + foo recursively into # { HOMEBREW_PREFIX } / foo
def link_dir foo, mode=OpenStruct.new
    root = self+foo
    return unless root.exist?
    root.find do |src|
      next if src == root
      dst = HOMEBREW_PREFIX+src.relative_path_from(self)
      dst.extend ObserverPathnameExtension
      if src.file?
        Find.prune if File.basename(src) == '.DS_Store'
        if src.extname == '.pyc' && src.to_s =~ /site-packages/
          Find.prune
        end
        case yield src.relative_path_from(root)
        when :skip_file, nil
          Find.prune
        when :info
          next if File.basename(src) == 'dir' 
          make_relative_symlink dst, src, mode
          dst.install_info
        else
          make_relative_symlink dst, src, mode
        end
      elsif src.directory?
        if src.symlink? && !dst.exist?
          make_relative_symlink dst, src, mode
          Find.prune
        end
        next if dst.directory? and not dst.symlink?
        Find.prune if src.extname == '.app'
        case yield src.relative_path_from(root)
        when :skip_dir
          Find.prune
        when :mkpath
          dst.mkpath unless resolve_any_conflicts(dst)
        else
          unless resolve_any_conflicts(dst)
            make_relative_symlink dst, src, mode
            Find.prune
          end
        end
      end
    end
  end
def link_dir foo , mode = OpenStruct . new root = self + foo return unless root . exist? root . find do | src | next if src == root dst = HOMEBREW_PREFIX + src . relative_path_from ( self ) dst . extend ObserverPathnameExtension if src . file? Find . prune if File . basename ( src ) == '.DS_Store' if src . extname == '.pyc' && src . to_s =~ / site-packages / Find . prune end case yield src . relative_path_from ( root ) when :skip_file , nil Find . prune when :info next if File . basename ( src ) == 'dir' make_relative_symlink dst , src , mode dst . install_info else make_relative_symlink dst , src , mode end elsif src . directory? if src . symlink? && ! dst . exist? make_relative_symlink dst , src , mode Find . prune end next if dst . directory? and not dst . symlink? Find . prune if src . extname == '.app' case yield src . relative_path_from ( root ) when :skip_dir Find . prune when :mkpath dst . mkpath unless resolve_any_conflicts ( dst ) else unless resolve_any_conflicts ( dst ) make_relative_symlink dst , src , mode Find . prune end end end end end
symlinks the contents of self+foo recursively into #{HOMEBREW_PREFIX}/foo
symlinks the contents of self + foo recursively into # { HOMEBREW_PREFIX } / foo
# Don't link pyc files because Python overwrites these cached object # files and next time brew wants to link, the pyc file is in the way. # skip historical local 'dir' files # If the `src` in the Cellar is a symlink itself, link it directly. # For example Qt has `Frameworks/QtGui.framework -> lib/QtGui.framework` # Not making a link here, would result in an empty dir because the # `src` is not followed by `find`. # if the dst dir already exists, then great! walk the rest of the tree tho # no need to put .app bundles in the path, the user can just use # spotlight, or the open command and actual mac apps use an equivalent
foo
<not_specific>
mode
<not_specific>
new
<not_specific>