diff --git a/ruby-2.6.0-rdoc-6.0.2-check-nil-text-token.patch b/ruby-2.6.0-rdoc-6.0.2-check-nil-text-token.patch new file mode 100644 index 0000000..325a6bf --- /dev/null +++ b/ruby-2.6.0-rdoc-6.0.2-check-nil-text-token.patch @@ -0,0 +1,69 @@ +From 9d98bfe7f1abdeda5aedf9404588104980ee7a86 Mon Sep 17 00:00:00 2001 +From: aycabta +Date: Mon, 15 Jan 2018 22:32:56 +0900 +Subject: [PATCH] Check nil text token + +Sometimes :on_ignored_nl token has nil text. This commit checks and +bypasses the token. +--- + lib/rdoc/parser/ripper_state_lex.rb | 4 +++- + test/test_rdoc_parser_ruby.rb | 30 +++++++++++++++++++++++++++++ + 2 files changed, 33 insertions(+), 1 deletion(-) + +diff --git a/lib/rdoc/parser/ripper_state_lex.rb b/lib/rdoc/parser/ripper_state_lex.rb +index 2a285b97a4..c56cef46ee 100644 +--- a/lib/rdoc/parser/ripper_state_lex.rb ++++ b/lib/rdoc/parser/ripper_state_lex.rb +@@ -330,8 +330,10 @@ class RDoc::RipperStateLex + @heredoc_queue << retrieve_heredoc_info(tk) + @inner_lex.lex_state = EXPR_END unless RIPPER_HAS_LEX_STATE + when :on_nl, :on_ignored_nl, :on_comment, :on_heredoc_end then +- unless @heredoc_queue.empty? ++ if !@heredoc_queue.empty? + get_heredoc_tk(*@heredoc_queue.shift) ++ elsif tk[:text].nil? # :on_ignored_nl sometimes gives nil ++ tk[:text] = '' + end + when :on_words_beg then + tk = get_words_tk(tk) +diff --git a/test/rdoc/test_rdoc_parser_ruby.rb b/test/rdoc/test_rdoc_parser_ruby.rb +index 833ed2cc74..c9d57021ce 100644 +--- a/test/rdoc/test_rdoc_parser_ruby.rb ++++ b/test/rdoc/test_rdoc_parser_ruby.rb +@@ -306,6 +306,36 @@ def sum(n) + assert_equal @top_level, sum.file + end + ++ def test_parse_on_ignored_nl_with_nil_text ++ util_parser <def meth ++ variable # comment ++ .chain ++end ++EXPECTED ++ expected = expected.rstrip ++ ++ @parser.scan ++ ++ foo = @store.find_class_named 'Foo' ++ meth = foo.method_list.first ++ ++ assert_equal 'meth', meth.name ++ assert_equal @top_level, meth.file ++ ++ markup_code = meth.markup_code.sub(/^.*\n/, '') ++ assert_equal expected, markup_code ++ end ++ + def test_parse_alias + klass = RDoc::NormalClass.new 'Foo' + klass.parent = @top_level diff --git a/ruby.spec b/ruby.spec index 6ffd3e0..21bdf0d 100644 --- a/ruby.spec +++ b/ruby.spec @@ -21,7 +21,7 @@ %endif -%global release 110 +%global release 111 %{!?release_string:%global release_string %{?development_release:0.}%{release}%{?development_release:.%{development_release}}%{?dist}} @@ -198,6 +198,9 @@ Patch33: ruby-2.6.9-date-2.0.1-parse-length-limit.patch # https://github.com/ruby/ruby/commit/02c341c9bc5879eae568ed2ba02cf227ed948199 # https://github.com/ruby/cgi/commit/84dedc6fbb2a210ec070c35bc607b89003701fa2 Patch34: ruby-2.6.9-cgi-0.1.1-cookie-parse-not-decode-names.patch +# Fix rdoc nil token parsing +# https://github.com/ruby/rdoc/commit/a1631aa98a67112d96ac101c72909fdeec6f84f9 +Patch35: ruby-2.6.0-rdoc-6.0.2-check-nil-text-token.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} Suggests: rubypick @@ -602,6 +605,7 @@ sed -i 's/"evaluation\/incorrect_words.yaml"\.freeze, //' \ %patch32 -p1 %patch33 -p1 %patch34 -p1 +%patch35 -p1 # Provide an example of usage of the tapset: cp -a %{SOURCE3} . @@ -1154,6 +1158,10 @@ OPENSSL_SYSTEM_CIPHERS_OVERRIDE=xyz_nonexistent_file OPENSSL_CONF='' \ %{gem_dir}/specifications/xmlrpc-%{xmlrpc_version}.gemspec %changelog +* Thu May 25 2023 Todd Zullinger - 2.5.9-111 +- Fix rdoc parsing of nil text tokens. + Resolves: rhbz#2210326 + * Fri Jul 08 2022 Jun Aruga - 2.5.9-110 - Fix FTBFS due to an incompatible load directive. - Fix a fiddle import test on an optimized glibc on Power 9.