mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
keg: don't skip linking based on relative pathname
ed1a674c ("keg: allow selective linking at the file level") had a regression which caused the link step to skip files with the same name as a directory in the user's CWD. Keg#link_dir yields a relative pathname, so assumptions cannot be made about the nature of that pathname in the block. Instead, introduce ":skip_dir" and ":skip_file" to replace the existing ":skip" directive. This way, we won't skip things marked ":skip_dir" when linking a file, and vice-versa. Fixes Homebrew/homebrew#10860. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
parent
27288547aa
commit
5b1957f13a
@ -68,13 +68,13 @@ class Keg < Pathname
|
||||
# yeah indeed, you have to force anything you need in the main tree into
|
||||
# these dirs REMEMBER that *NOT* everything needs to be in the main tree
|
||||
link_dir('etc') {:mkpath}
|
||||
link_dir('bin') { |path| :skip if path.directory? }
|
||||
link_dir('sbin') { |path| :skip if path.directory? }
|
||||
link_dir('bin') {:skip_dir}
|
||||
link_dir('sbin') {:skip_dir}
|
||||
link_dir('include') {:link}
|
||||
|
||||
link_dir('share') do |path|
|
||||
case path.to_s
|
||||
when 'locale/locale.alias' then :skip
|
||||
when 'locale/locale.alias' then :skip_file
|
||||
when INFOFILE_RX then :info if ENV['HOMEBREW_KEEP_INFO']
|
||||
when LOCALEDIR_RX then :mkpath
|
||||
when *share_mkpaths then :mkpath
|
||||
@ -84,7 +84,7 @@ class Keg < Pathname
|
||||
|
||||
link_dir('lib') do |path|
|
||||
case path.to_s
|
||||
when 'charset.alias' then :skip
|
||||
when 'charset.alias' then :skip_file
|
||||
# pkg-config database gets explicitly created
|
||||
when 'pkgconfig' then :mkpath
|
||||
# lib/language folders also get explicitly created
|
||||
@ -138,7 +138,7 @@ protected
|
||||
Find.prune if File.basename(src) == '.DS_Store'
|
||||
|
||||
case yield src.relative_path_from(root)
|
||||
when :skip
|
||||
when :skip_file
|
||||
Find.prune
|
||||
when :info
|
||||
dst.make_relative_symlink(src)
|
||||
@ -155,7 +155,7 @@ protected
|
||||
Find.prune if src.extname.to_s == '.app'
|
||||
|
||||
case yield src.relative_path_from(root)
|
||||
when :skip
|
||||
when :skip_dir
|
||||
Find.prune
|
||||
when :mkpath
|
||||
dst.mkpath unless resolve_any_conflicts(dst)
|
||||
|
Loading…
x
Reference in New Issue
Block a user