diff options
| author | Mike McQuaid | 2016-09-06 09:04:51 +0100 |
|---|---|---|
| committer | Mike McQuaid | 2016-09-06 09:04:51 +0100 |
| commit | 1160d0e347d09ea57df4cf943f5ff35736657cc0 (patch) | |
| tree | e4bfe13fcd605f9addc2f4da623f768bccadae5b /Library/Homebrew/utils.rb | |
| parent | 3ebc5a88e89aa321ef7aa31900873b91d99cfd01 (diff) | |
| download | brew-1160d0e347d09ea57df4cf943f5ff35736657cc0.tar.bz2 | |
update-report: also link docs, completions.
These are more files in the HOMEBREW_REPOSITORY that we want to link to
the HOMEBREW_PREFIX.
Diffstat (limited to 'Library/Homebrew/utils.rb')
| -rw-r--r-- | Library/Homebrew/utils.rb | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 373320f75..4b8aeaff4 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -589,18 +589,19 @@ def truncate_text_to_approximate_size(s, max_bytes, options = {}) out end -def link_src_dst_dirs(src_dir, dst_dir, command) +def link_src_dst_dirs(src_dir, dst_dir, command, link_dir: false) return unless src_dir.exist? conflicts = [] - src_dir.find do |src| - next if src.directory? - dst = dst_dir/src.relative_path_from(src_dir.parent) + src_paths = link_dir ? [src_dir] : src_dir.find + src_paths.each do |src| + next if src.directory? && !link_dir + dst = dst_dir.parent/src.relative_path_from(src_dir.parent) next if dst.symlink? && src == dst.resolved_path if dst.exist? conflicts << dst next end - dst_dir.mkpath + dst_dir.parent.mkpath dst.make_relative_symlink(src) end unless conflicts.empty? @@ -614,5 +615,5 @@ def link_src_dst_dirs(src_dir, dst_dir, command) end def link_path_manpages(path, command) - link_src_dst_dirs(path/"man", HOMEBREW_PREFIX/"share", command) + link_src_dst_dirs(path/"man", HOMEBREW_PREFIX/"share/man", command) end |
