diff options
author | Po-Chuan Hsieh <sunpoet@FreeBSD.org> | 2021-04-26 04:32:52 +0800 |
---|---|---|
committer | Po-Chuan Hsieh <sunpoet@FreeBSD.org> | 2021-04-26 04:36:32 +0800 |
commit | 95fa9913f79cd0c31f0cc4df2294d934f5368bc5 (patch) | |
tree | f07de383777c5a4530c5825e3a524a1756a51e4e /lang/ruby30/files/patch-tool_rbinstall.rb | |
parent | lang/v8: Remove outdated patch after r563570 (a7d2ae454e62240f7349c94e02e45b5... (diff) |
lang/ruby30: Update to 3.0.1
Changes: https://www.ruby-lang.org/en/news/2020/12/25/ruby-3-0-0-released/
https://www.ruby-lang.org/en/news/2021/04/05/ruby-3-0-1-released/
PR: 251741
Reported by: Yasuhiro Kimura <yasu@utahime.org>
Diffstat (limited to 'lang/ruby30/files/patch-tool_rbinstall.rb')
-rw-r--r-- | lang/ruby30/files/patch-tool_rbinstall.rb | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/lang/ruby30/files/patch-tool_rbinstall.rb b/lang/ruby30/files/patch-tool_rbinstall.rb index 9e02a2c30733..18faf8e5f498 100644 --- a/lang/ruby30/files/patch-tool_rbinstall.rb +++ b/lang/ruby30/files/patch-tool_rbinstall.rb @@ -1,6 +1,6 @@ ---- tool/rbinstall.rb.orig 2020-10-02 17:47:07 UTC +--- tool/rbinstall.rb.orig 2020-12-08 09:02:31 UTC +++ tool/rbinstall.rb -@@ -864,147 +864,6 @@ end +@@ -864,164 +864,6 @@ end # :startdoc: @@ -11,16 +11,28 @@ - install_default_gem('ext', srcdir) -end - --def load_gemspec(file) +-def load_gemspec(file, expanded = false) - file = File.realpath(file) - code = File.read(file, encoding: "utf-8:-") -- code.gsub!(/`git.*?`/m, '""') -- code.gsub!(/%x\[git.*?\]/m, '""') +- code.gsub!(/(?:`git[^\`]*`|%x\[git[^\]]*\])\.split\([^\)]*\)/m) do +- files = [] +- if expanded +- base = File.dirname(file) +- Dir.glob("**/*", File::FNM_DOTMATCH, base: base) do |n| +- case File.basename(n); when ".", ".."; next; end +- next if File.directory?(File.join(base, n)) +- files << n.dump +- end +- end +- "[" + files.join(", ") + "]" +- end - spec = eval(code, binding, file) - unless Gem::Specification === spec - raise TypeError, "[#{file}] isn't a Gem::Specification (#{spec.class} instead)." - end - spec.loaded_from = file +- spec.files.reject! {|n| n.end_with?(".gemspec") or n.start_with?(".git")} +- - spec -end - @@ -93,9 +105,14 @@ - next if /^\s*(?:#|$)/ =~ name - next unless /^(\S+)\s+(\S+).*/ =~ name - gem_name = "#$1-#$2" -- path = "#{srcdir}/.bundle/gems/#{gem_name}/#$1.gemspec" -- next unless File.exist?(path) -- spec = load_gemspec(path) +- path = "#{srcdir}/.bundle/gems/#{gem_name}/#{gem_name}.gemspec" +- if File.exist?(path) +- spec = load_gemspec(path) +- else +- path = "#{srcdir}/.bundle/gems/#{gem_name}/#$1.gemspec" +- next unless File.exist?(path) +- spec = load_gemspec(path, true) +- end - next unless spec.platform == Gem::Platform::RUBY - next unless spec.full_name == gem_name - spec.extension_dir = "#{extensions_dir}/#{spec.full_name}" |