summaryrefslogtreecommitdiff
path: root/tool/update-deps
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-02-14 05:42:14 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-02-14 05:42:14 +0000
commitd1e6304a891fc5e9cc63e50520bdc798fb95b829 (patch)
treee31b2a18d929f8707d3168f73cdfb1d75363ad8a /tool/update-deps
parent4fc656a2f331a91a71208d5a426fce951fa5ca82 (diff)
Prefer relative directory from srcdir to top_srcdir
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/update-deps')
-rwxr-xr-xtool/update-deps10
1 files changed, 6 insertions, 4 deletions
diff --git a/tool/update-deps b/tool/update-deps
index 9a200bf4da..4aaf812430 100755
--- a/tool/update-deps
+++ b/tool/update-deps
@@ -211,8 +211,9 @@ def in_makefile(target, source)
end
["enc/depend", target2, source2]
when %r{\Aext/}
- unless File.exist?("#{File.dirname(target)}/extconf.rb")
- warn "warning: not found: #{File.dirname(target)}/extconf.rb"
+ targetdir = File.dirname(target)
+ unless File.exist?("#{targetdir}/extconf.rb")
+ warn "warning: not found: #{targetdir}/extconf.rb"
end
target2 = File.basename(target)
relpath = Pathname(source).relative_path_from(Pathname(target).dirname).to_s
@@ -224,8 +225,9 @@ def in_makefile(target, source)
when *FILES_SAME_NAME_TOP then source2 = "$(top_srcdir)/#{source}"
when %r{\A\.ext/include/[^/]+/ruby/} then source2 = "$(arch_hdrdir)/ruby/#{$'}"
when %r{\Ainclude/} then source2 = "$(hdrdir)/#{$'}"
- when %r{\A#{Regexp.escape File.dirname(target)}/extconf\.h\z} then source2 = "$(RUBY_EXTCONF_H)"
- when %r{\A#{Regexp.escape File.dirname(target)}/} then source2 = $'
+ when %r{\A#{Regexp.escape targetdir}/extconf\.h\z} then source2 = "$(RUBY_EXTCONF_H)"
+ when %r{\A#{Regexp.escape targetdir}/} then source2 = $'
+ when %r{\A#{Regexp.escape File.dirname(targetdir)}/} then source2 = "$(srcdir)/../#{$'}"
else source2 = "$(top_srcdir)/#{source}"
end
["#{File.dirname(target)}/depend", target2, source2]